Documentation
¶
Index ¶
- Constants
- func NewMiddleware(opts Options, logOut io.Writer) func(http.Handler) http.Handler
- func NormalizeMode(raw string) string
- func RoleFromContext(ctx context.Context) string
- func RoleFromRequest(r *http.Request) string
- func WithWorkspaceID(ctx context.Context, workspaceID string) context.Context
- func WorkspaceIDFromContext(ctx context.Context) string
- func WorkspaceIDFromRequest(r *http.Request) string
- type Options
Constants ¶
View Source
const ( ModeOff = "off" ModeExternalRequired = "external-required" ModeRequired = "required" DefaultWorkspaceHeader = "Tars-Workspace-Id" )
View Source
const ( RoleUser = "user" RoleAdmin = "admin" )
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func NormalizeMode ¶
func RoleFromContext ¶
func RoleFromRequest ¶
func WithWorkspaceID ¶
func WorkspaceIDFromContext ¶
func WorkspaceIDFromRequest ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.