Documentation ¶
Index ¶
Constants ¶
View Source
const FiberTokenDataKey = "tokendata"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CidaasInterceptor ¶
type CidaasInterceptor struct { Options Options // contains filtered or unexported fields }
CidaasInterceptor to secure APIs based on OAuth 2.0
func New ¶
func New(opts Options) (*CidaasInterceptor, error)
New returns a newly constructed cidaasInterceptor instance with the provided options
func (*CidaasInterceptor) VerifyTokenByIntrospect ¶
func (m *CidaasInterceptor) VerifyTokenByIntrospect(next http.Handler, scopes []string, roles []string) http.Handler
VerifyTokenByIntrospect (check for exp time, issuer and scopes and roles)
func (*CidaasInterceptor) VerifyTokenBySignature ¶
func (m *CidaasInterceptor) VerifyTokenBySignature(next http.Handler, scopes []string, roles []string) http.Handler
VerifyTokenBySignature (check for exp time and scopes and roles)
type FiberInterceptor ¶ added in v1.1.3
type FiberInterceptor struct { Options Options // contains filtered or unexported fields }
func NewFiberInterceptor ¶ added in v1.1.3
func NewFiberInterceptor(opts Options) (*FiberInterceptor, error)
NewFiberInterceptor returns a newly constructed cidaasInterceptor instance with the provided options
func (*FiberInterceptor) VerifyTokenByIntrospect ¶ added in v1.2.0
func (m *FiberInterceptor) VerifyTokenByIntrospect(scopes []string, roles []string) fiber.Handler
VerifyTokenByIntrospect (check for exp time, issuer and scopes and roles)
func (*FiberInterceptor) VerifyTokenBySignature ¶ added in v1.1.3
func (m *FiberInterceptor) VerifyTokenBySignature(scopes []string, roles []string) fiber.Handler
VerifyTokenBySignature (check for exp time and scopes and roles)
type JSONWebKey ¶
type JSONWebKey struct { Kty string `json:"kty"` Kid string `json:"kid"` Use string `json:"use"` N string `json:"n"` E string `json:"e"` Alg string `json:"alg"` }
JSONWebKey struct containing data of a key to verify a signature of token
type Jwks ¶
type Jwks struct {
Keys []JSONWebKey `json:"keys"`
}
Jwks struct containing a list of keys to verify a signature of token
Click to show internal directories.
Click to hide internal directories.