Documentation ¶
Index ¶
- func AuthCookieName(unsecure bool) string
- func CSRFCookieName(unsecure bool) string
- func CurrentUserID(ctx context.Context) string
- func ExtractToken(hdr http.Header, name, prefix string) string
- func GenerateAuthCookies(userID string, sc *scommon.CookieSigningData, unsecureCookies bool) (*http.Cookie, *http.Cookie, error)
- func IsUserAdmin(ctx context.Context) bool
- func IsUserLogged(ctx context.Context) bool
- func IsUserLoggedOrAdmin(ctx context.Context) bool
- func SecondaryAuthCookieName() string
- type AuthCookie
- type ContextKey
- type SecondaryAuthCookie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthCookieName ¶ added in v0.8.0
func CSRFCookieName ¶ added in v0.8.0
func CurrentUserID ¶
func GenerateAuthCookies ¶ added in v0.8.0
func IsUserAdmin ¶
func IsUserLogged ¶
func IsUserLoggedOrAdmin ¶
func SecondaryAuthCookieName ¶ added in v0.8.0
func SecondaryAuthCookieName() string
Types ¶
type AuthCookie ¶ added in v0.8.0
type ContextKey ¶
type ContextKey int
const ( ContextKeyUserID ContextKey = iota ContextKeyUsername ContextKeyUserAdmin ContextKeyTokenAuth )
type SecondaryAuthCookie ¶ added in v0.8.0
type SecondaryAuthCookie struct {
SecondaryToken string `json:"secondaryToken"`
}
Click to show internal directories.
Click to hide internal directories.