Documentation ¶
Index ¶
Constants ¶
View Source
const ClaimsKey contextKey = "claims"
SessionContextKey is the context key for the Login Session
View Source
const HeadersKey contextKey = "headers"
Variables ¶
View Source
var ( ErrHeadersMissing = errors.New("tumbler headers missing in context") ErrClaimsMissing = errors.New("tumbler claims missing in context") )
Functions ¶
func WithClaimsFromRequest ¶
func WithClaimsFromRequest(w http.ResponseWriter, r *http.Request, run func(TumblerClaims))
Types ¶
type ServerMiddleware ¶ added in v0.2.0
func NewServer ¶ added in v0.2.0
func NewServer(log logging.Logger, times stime.TimeService, jweService jwe.JWEService) (ServerMiddleware, error)
func NewServerFromConfig ¶ added in v0.2.0
func NewServerFromConfig(log logging.Logger, times stime.TimeService, config TumblerConfig) (ServerMiddleware, error)
type TumblerClaims ¶
type TumblerClaims struct { jwe.Claims // These must match up with their json attribute names to the identity/pkg/session/Session json id names IdentityID uuid.UUID `json:"iid"` CredentialID *uuid.UUID `json:"cid"` TenantID uuid.UUID `json:"tid"` OrganizationID *uuid.UUID `json:"oid"` // contains filtered or unexported fields }
func ClaimsFromRequest ¶
func ClaimsFromRequest(r *http.Request) (*TumblerClaims, error)
func (*TumblerClaims) ApplyToHeaders ¶ added in v0.2.0
func (c *TumblerClaims) ApplyToHeaders(headers *http.Header)
func (*TumblerClaims) LogContext ¶
func (s *TumblerClaims) LogContext() map[string]string
func (*TumblerClaims) RequestContext ¶ added in v0.2.1
func (s *TumblerClaims) RequestContext() context.Context
type TumblerConfig ¶
type TumblerConfig struct {
Keys webkeys.WebKeysConfig
}
type TumblerHeaders ¶ added in v0.2.0
type TumblerHeaders struct { XRequestID string XAuthToken string XForwardedFor string XForwardedProto string XForwardedHost string Origin string Referer string }
func TumblerHeadersFromHeaders ¶ added in v0.2.0
func TumblerHeadersFromHeaders(headers *http.Header) TumblerHeaders
func (*TumblerHeaders) ApplyToHeaders ¶ added in v0.2.0
func (h *TumblerHeaders) ApplyToHeaders(headers *http.Header)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.