Documentation ¶
Index ¶
Constants ¶
View Source
const ( ALGORITHM = "ES256K" SIG_LENGTH = 65 R_LENGTH = 32 S_LENGTH = 32 )
View Source
const ( MAX_TOKEN_DURATION = 2 * time.Hour MAX_CLOCK_SKEW = 2 * time.Minute )
View Source
const (
TOKEN_DURATION = time.Hour
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type JWTVerifier ¶
type RegistryVerifier ¶
type RegistryVerifier struct {
// contains filtered or unexported fields
}
func NewRegistryVerifier ¶
func NewRegistryVerifier(registry registry.NodeRegistry, myNodeID uint32) *RegistryVerifier
A RegistryVerifier connects to the NodeRegistry and verifies JWTs against the registered public keys based on the JWT's subject field
func (*RegistryVerifier) Verify ¶
func (v *RegistryVerifier) Verify(tokenString string) error
type SigningMethodSecp256k1 ¶
type SigningMethodSecp256k1 struct{}
* The JWT signing method for secp256k1. Inspired by https://github.com/ureeves/jwt-go-secp256k1/blob/master/secp256k1.go but updated to work with the latest version of jwt-go.
func (*SigningMethodSecp256k1) Alg ¶
func (sm *SigningMethodSecp256k1) Alg() string
type TokenFactory ¶
type TokenFactory struct {
// contains filtered or unexported fields
}
func NewTokenFactory ¶
func NewTokenFactory(privateKey *ecdsa.PrivateKey, nodeID uint32) *TokenFactory
func (*TokenFactory) CreateToken ¶
func (f *TokenFactory) CreateToken(forNodeID uint32) (*Token, error)
Click to show internal directories.
Click to hide internal directories.