Documentation
¶
Index ¶
- Constants
- func ContextWithProviderURL(ctx context.Context, url string) context.Context
- func FirstExtraValue(extra map[string][]string, key string) string
- func GetSessionIDFromCookieValue(cookieValue string) string
- func GetSessionInfoFromRequest(req *http.Request) (sessionID, sessionCookie string)
- func ProviderURLFromContext(ctx context.Context) string
- type GroupInfo
- type SerializableRequest
- type SerializableState
Constants ¶
const (
ObotAccessTokenCookie = "obot_access_token"
)
Variables ¶
This section is empty.
Functions ¶
func ContextWithProviderURL ¶
ContextWithProviderURL adds the auth provider URL to the context
func FirstExtraValue ¶ added in v0.11.0
FirstExtraValue returns the first value for the given key in the extra map.
func GetSessionIDFromCookieValue ¶ added in v0.10.0
GetSessionIDFromCookieValue extracts the session ID from a cookie value string. The cookie value should be an oauth2-proxy ticket cookie with three segments separated by pipes.
func GetSessionInfoFromRequest ¶ added in v0.10.0
GetSessionInfoFromRequest extracts the session ID and cookie value from the request's obot access token cookie.
func ProviderURLFromContext ¶
ProviderURLFromContext retrieves the auth provider URL from the context
Types ¶
type GroupInfo ¶
type GroupInfo struct {
ID string `json:"id"`
Name string `json:"name"`
IconURL *string `json:"iconURL"`
}
GroupInfo represents information about a user group from an authentication provider
type SerializableRequest ¶ added in v0.10.0
type SerializableRequest struct {
Method string `json:"method"`
URL string `json:"url"`
Header map[string][]string `json:"header"`
}
SerializableRequest represents an HTTP request that can be serialized for authentication flows
type SerializableState ¶ added in v0.10.0
type SerializableState struct {
ExpiresOn *time.Time `json:"expiresOn"`
AccessToken string `json:"accessToken"`
PreferredUsername string `json:"preferredUsername"`
User string `json:"user"`
Email string `json:"email"`
SetCookies []string `json:"setCookies"`
}
SerializableState represents the authentication state returned from auth providers
func (SerializableState) ProviderUsername ¶ added in v0.10.0
func (ss SerializableState) ProviderUsername(providerName string) string
ProviderUsername returns the username for the given provider.