Documentation
¶
Index ¶
Constants ¶
View Source
const ISSUER = "https://api.memberstack.com"
View Source
const JWKS_ENDPOINT = "http://member-jwt.s3-website-us-east-1.amazonaws.com/"
Variables ¶
View Source
var (
ErrBadJwks = errors.New("bad JWKS")
)
Functions ¶
This section is empty.
Types ¶
type MemberstackAdmin ¶
type MemberstackAdmin struct { Options Options // contains filtered or unexported fields }
func NewMemberstackAdmin ¶
func NewMemberstackAdmin(o Options) MemberstackAdmin
func (*MemberstackAdmin) GetJwksKeyfunc ¶ added in v0.3.0
func (a *MemberstackAdmin) GetJwksKeyfunc() (keyfunc.Keyfunc, error)
GetJwksKeyfunc fetches the JWKS from the HTTP server, parses it into a key function jwt.Parse understands, and caches it on MemberstackAdmin. Subsequent calls returns the cached value.
func (*MemberstackAdmin) GetLatestJwksKeyfunc ¶ added in v0.3.0
func (a *MemberstackAdmin) GetLatestJwksKeyfunc() (keyfunc.Keyfunc, error)
GetLatestJwksKeyfunc does the same as GetJwksKeyfunc() but always fetches from the HTTP server, updating the local cache along the way.
func (*MemberstackAdmin) VerifyToken ¶
func (a *MemberstackAdmin) VerifyToken(tokenString string) (*jwt.Token, error)
type MemberstackJwtClaims ¶ added in v0.2.0
type MemberstackJwtClaims struct { MemberID string `json:"id,omitempty"` Type string `json:"type,omitempty"` IsAdmin bool `json:"isAdmin,omitempty"` jwt.RegisteredClaims }
func GetMemberstackClaims ¶ added in v0.2.0
func GetMemberstackClaims(token *jwt.Token) *MemberstackJwtClaims
GetMemberstackClaims is a utility function to correctly type the verified jwt.Token.Claims to Memberstack-specific JWT format
Click to show internal directories.
Click to hide internal directories.