Documentation
¶
Index ¶
- Constants
- func SessionExpiresAt(c echo.Context, maxSessionDuration time.Duration) time.Time
- func SetSessionStart(c echo.Context, maxSessionDuration time.Duration, secure bool)
- func SetUser(c echo.Context, user *User, opts CookieOptions) error
- func SetVerifier(v *oidc.IDTokenVerifier)
- func ValidateAuthHeaderExists(c echo.Context, cfgProvider *config.ConfigProviderWithRefresh) error
- func ValidateSessionDuration(c echo.Context, maxSessionDuration time.Duration) error
- type Claims
- type CookieOptions
- type IDToken
- type User
- type UserResponse
Constants ¶
const (
AuthorizationExtrasHeader = "authorization-extras"
)
Variables ¶
This section is empty.
Functions ¶
func SessionExpiresAt ¶ added in v2.55.0
SessionExpiresAt reports when the session recorded by the session_start cookie reaches maxSessionDuration. It returns the zero time when no max duration is configured, or when the cookie is missing or unreadable.
func SetSessionStart ¶ added in v2.45.2
SetSessionStart sets a cookie with the current timestamp to track when the session began. This should only be called on initial login, NOT on token refresh.
func SetVerifier ¶ added in v2.45.2
func SetVerifier(v *oidc.IDTokenVerifier)
func ValidateAuthHeaderExists ¶ added in v2.16.0
func ValidateAuthHeaderExists(c echo.Context, cfgProvider *config.ConfigProviderWithRefresh) error
ValidateAuthHeaderExists validates that the autorization header exists if auth is enabled. User autorization should be done in the frontend by claim-mapper and authorizer plugins. See https://docs.temporal.io/security#authentication
Types ¶
type CookieOptions ¶ added in v2.55.0
type CookieOptions struct {
// Secure marks the cookies Secure.
Secure bool
// SessionExpiresAt is when the current session reaches the configured
// maxSessionDuration. The zero value means no max duration is configured.
SessionExpiresAt time.Time
// RefreshTokenDuration is the provider's configured refresh token lifetime.
// Zero means unset.
RefreshTokenDuration time.Duration
}
CookieOptions carries the deployment settings that decide how the auth cookies are written.