Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultExpireTimeInterval = time.Second * 120
Variables ¶
View Source
var ErrSignatureExpired = errors.New("signature expired")
View Source
var ErrSignatureInvalid = func(e error) SignatureInvalidError { return SignatureInvalidError{content: "signature invalid: %w", err: e} }
View Source
var ErrUIDInvalid = errors.New("uid invalid")
Functions ¶
This section is empty.
Types ¶
type APIAuthenticator ¶
type APIRequest ¶
type APIRequest struct {
// contains filtered or unexported fields
}
func NewAPIRequest ¶
func NewAPIRequest(signature, metadata string, pubKey []byte) *APIRequest
func NewAPIRequestFromToken ¶
func NewAPIRequestFromToken(token string) (*APIRequest, error)
func (*APIRequest) GetMetadata ¶
func (t *APIRequest) GetMetadata() string
func (*APIRequest) GetPublicKey ¶
func (t *APIRequest) GetPublicKey() []byte
func (*APIRequest) GetSignature ¶
func (t *APIRequest) GetSignature() string
func (*APIRequest) GetToken ¶
func (t *APIRequest) GetToken() string
type DefaultAPIAuthenticator ¶
type DefaultAPIAuthenticator struct {
// contains filtered or unexported fields
}
func NewDefaultAPIAuthenticator ¶
func NewDefaultAPIAuthenticator() *DefaultAPIAuthenticator
func NewDefaultAPIAuthenticatorAsDriver ¶
func NewDefaultAPIAuthenticatorAsDriver(driver xcrypt.Encrypt) *DefaultAPIAuthenticator
type Signatory ¶
type Signatory struct {
// contains filtered or unexported fields
}
func NewSignatory ¶
func (*Signatory) DoSignature ¶
func (*Signatory) GetMetadata ¶
type SignatureInvalidError ¶
type SignatureInvalidError struct {
// contains filtered or unexported fields
}
func (SignatureInvalidError) Error ¶
func (e SignatureInvalidError) Error() string
func (SignatureInvalidError) Unwrap ¶
func (e SignatureInvalidError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.