Documentation
¶
Index ¶
- Constants
- func GetUserAuthFromContext(ctx context.Context) (auth.UserAuth, error)
- func GetUserAuthFromRequest(r *http.Request) (auth.UserAuth, error)
- func RoleFromContext(ctx context.Context) (string, bool)
- func SetUserAuthInContext(ctx context.Context, userAuth auth.UserAuth) context.Context
- func SetUserAuthInRequest(r *http.Request, userAuth auth.UserAuth) *http.Request
- func WithRole(ctx context.Context, role string) context.Context
Constants ¶
View Source
const ( RequestIDKey = nbcontext.RequestIDKey AccountIDKey = nbcontext.AccountIDKey RoleKey = nbcontext.RoleKey UserIDKey = nbcontext.UserIDKey PeerIDKey = nbcontext.PeerIDKey )
View Source
const (
UserAuthContextKey key = iota
)
Variables ¶
This section is empty.
Functions ¶
func GetUserAuthFromContext ¶ added in v0.37.0
func GetUserAuthFromRequest ¶ added in v0.37.0
func RoleFromContext ¶ added in v0.72.0
RoleFromContext returns the role stored in ctx, or empty string and false if absent.
func SetUserAuthInContext ¶ added in v0.37.0
func SetUserAuthInRequest ¶ added in v0.37.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.