Documentation ¶
Index ¶
Constants ¶
const ( // UCANVersion is the current version of the UCAN spec UCANVersion = "0.7.0" // UCANVersionKey is the key used in version headers for the UCAN spec UCANVersionKey = "ucv" // PrfKey denotes "Proofs" in a UCAN. Stored in JWT Claims PrfKey = "prf" // FctKey denotes "Facts" in a UCAN. Stored in JWT Claims FctKey = "fct" // AttKey denotes "Attenuations" in a UCAN. Stored in JWT Claims AttKey = "att" // CapKey indicates a resource Capability. Used in an attenuation CapKey = "cap" )
Variables ¶
var ErrInvalidToken = errors.New("invalid access token")
ErrInvalidToken indicates an access token is invalid
Functions ¶
func ExtractBearerToken ¶
It takes a string, splits it on a space, and returns the second element of the resulting array
Types ¶
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
`JWT` is a struct that has a field called `options` of type `JWTOptions`. @property {JWTOptions} options - This is a struct that contains the options for the JWT.
func DefaultNew ¶
func DefaultNew() *JWT
`DefaultNew()` returns a new instance of `JWT` with the default options
func (*JWT) BuildJWTParseMiddleware ¶
func (j *JWT) BuildJWTParseMiddleware(headers string) JWTParserMiddleware
A function that returns a function.
type JWTOptions ¶
type JWTOptions struct {
// contains filtered or unexported fields
}
`JWTOptions` is a struct that contains a `[]byte` named `secret`, a `jwt.SigningMethod` named `singingMethod`, and an `int64` named `ttl`. @property {[]byte} secret - This is the secret key used to sign the JWT. @property singingMethod - The signing method used to sign the token. @property {int64} ttl - Time to live in seconds.
func (*JWTOptions) DefaultTestConfig ¶
func (opts *JWTOptions) DefaultTestConfig() JWTOptions
A method that returns a `JWTOptions` struct.
func (*JWTOptions) WithConfig ¶
func (j *JWTOptions) WithConfig(config JWTOptions)
Setting the `options` variable to the `config` variable.
type JWTParserMiddleware ¶
type JWTParserMiddleware = func() error