Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStoreIDToCtx ¶
Extract StoreID (internal_id) from CustomClaims and add to request context.
Must only be used after the EnsureValidToken method on the middleware chain
func EnsureValidToken ¶
EnsureValidToken is a middleware that will check the validity of our JWT.
Types ¶
type CustomClaims ¶
type CustomClaims struct { InternalID string `json:"internal_id,omitempty"` Scope string `json:"scope"` }
CustomClaims contains custom data we want from the token.
func (CustomClaims) HasScope ¶
func (c CustomClaims) HasScope(expectedScope string) bool
HasScope checks whether our claims have a specific scope.
type CustomLogger ¶
type CustomLogger struct {
// contains filtered or unexported fields
}
func (*CustomLogger) NewLogEntry ¶
func (cl *CustomLogger) NewLogEntry(r *http.Request) middleware.LogEntry
Click to show internal directories.
Click to hide internal directories.