Rename package from jwtauth to httpauthjwt to follow ecosystem convention (repo name = package name, hyphens removed). Bump httpauth dependency from v0.1.0 to v1.0.0 and rbac indirect dependency from v0.9.0 to v1.0.0. BREAKING CHANGE: import path unchanged (code.nochebuena.dev/go/httpauth-jwt) but package identifier changes from jwtauth to httpauthjwt — update all usages accordingly.
31 lines
859 B
Go
31 lines
859 B
Go
package httpauthjwt_test
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
httpauthjwt "code.nochebuena.dev/go/httpauth-jwt"
|
|
"github.com/golang-jwt/jwt/v5"
|
|
)
|
|
|
|
type mockSigner struct{}
|
|
|
|
func (m *mockSigner) Sign(_ jwt.Claims) (string, error) { return "", nil }
|
|
func (m *mockSigner) Verify(_ string) (*jwt.Token, error) { return nil, nil }
|
|
|
|
type mockVerifier struct{}
|
|
|
|
func (m *mockVerifier) Verify(_ string) (*jwt.Token, error) { return nil, nil }
|
|
|
|
type mockBlacklist struct{}
|
|
|
|
func (m *mockBlacklist) IsRevoked(_ context.Context, _ string) (bool, error) { return false, nil }
|
|
func (m *mockBlacklist) Revoke(_ context.Context, _ string, _ time.Duration) error {
|
|
return nil
|
|
}
|
|
|
|
// Compile-time interface satisfaction checks.
|
|
var _ httpauthjwt.Signer = (*mockSigner)(nil)
|
|
var _ httpauthjwt.Verifier = (*mockVerifier)(nil)
|
|
var _ httpauthjwt.Blacklist = (*mockBlacklist)(nil)
|