Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoSessionKey is thrown when no key was provided for HMAC signing ErrNoSessionKey = errors.New("no session key") // ErrMalformedSession is thrown when the session value doesn't conform to expectations ErrMalformedSession = errors.New("malformed session") // ErrInvalidSession the signature included with the session can't be verified with the provided session key \ // or is malformed in some way ErrInvalidSession = errors.New("invalid session") )
note @adam-hanna: can these be constants?
View Source
var ( // ErrBase64Encode is thrown when a byte slice could not be base64 encoded ErrBase64Encode = errors.New("Base64 encoding failed") // ErrBase64Decode is thrown when a byte slice could not be base64 decoded ErrBase64Decode = errors.New("Base64 decoding failed") )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Key is a slice of bytes for performing HMAC signing and verification operations Key []byte }
Options defines the behavior of the auth service
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs signing and verification actions using HMAC
func (*Service) SignAndBase64Encode ¶
SignAndBase64Encode signs the sessionID with the key and returns a base64 encoded string
Click to show internal directories.
Click to hide internal directories.