Documentation
¶
Index ¶
- Variables
- func AdminOnly(opts *Opts) func(http.Handler) http.Handler
- func CreateAccessToken(opts *CreateTokenOpts) (string, error)
- func CreateRefreshToken(opts *CreateTokenOpts) (string, error)
- func CreateServiceJwt(params *ServiceJwtOpts) (tokenJwt string, err error)
- func CreateTokens(opts *CreateTokenOpts) (access, refresh string, err error)
- func ExtractToken(jwtSecret []byte) func(http.Handler) http.Handler
- func GenerateJTI() (string, error)
- func GenerateRandomToken() (string, error)
- func GetRefreshTokenID() (string, error)
- func GetResolverSigningKey(ctx context.Context, resolver indigodid.Resolver, iss string) (crypto.PublicKey, error)
- func RefreshTokenOnly(opts *Opts) func(http.Handler) http.Handler
- func Required(opts *Opts) func(http.Handler) http.Handler
- func StashUser(ctx context.Context, auth *xrpc.Auth) context.Context
- func TokenFromContext(ctx context.Context) *jwt.Token
- func UserFromContext(ctx context.Context) *xrpc.Auth
- type ContextKey
- type CreateTokenOpts
- type Middelware
- type Opts
- type Scope
- type ServiceJwtOpts
- type SigningMethodK256
- type SigningMethodP256
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var ( K256SigningMethod *SigningMethodK256 P256SigningMethod *SigningMethodP256 )
Functions ¶
func CreateAccessToken ¶
func CreateAccessToken(opts *CreateTokenOpts) (string, error)
CreateAccessToken generates an access token.
func CreateRefreshToken ¶
func CreateRefreshToken(opts *CreateTokenOpts) (string, error)
CreateRefreshToken generates a refresh token.
func CreateServiceJwt ¶
func CreateServiceJwt(params *ServiceJwtOpts) (tokenJwt string, err error)
func CreateTokens ¶
func CreateTokens(opts *CreateTokenOpts) (access, refresh string, err error)
func ExtractToken ¶
ExtractToken is a middleware function that will store a jwt token in the request context if one is present. It will not fail if the jwt token is invalid or not found.
func GenerateJTI ¶
func GenerateRandomToken ¶
GenerateRandomToken generates a random token formatted as xxxxx-xxxxx
func GetRefreshTokenID ¶
getRefreshTokenID generates a unique identifier for the refresh token.
func GetResolverSigningKey ¶
Types ¶
type ContextKey ¶
type ContextKey string
type CreateTokenOpts ¶
type Middelware ¶
func ServiceJwt ¶
func ServiceJwt(opts *Opts) Middelware
type ServiceJwtOpts ¶
type SigningMethodK256 ¶
type SigningMethodK256 struct{}
func (*SigningMethodK256) Alg ¶
func (sm *SigningMethodK256) Alg() string
type SigningMethodP256 ¶
type SigningMethodP256 struct{}
func (*SigningMethodP256) Alg ¶
func (sm *SigningMethodP256) Alg() string
Click to show internal directories.
Click to hide internal directories.