Documentation
¶
Index ¶
- Constants
- Variables
- type Action
- type AuthHeaderStyle
- type Information
- type MetaData
- type Oauth2
- type Options
- type Provider
- type ProviderWrapper
- type Registry
- type Session
- func (s *Session) DelToken(c echo.Context) error
- func (m *Session) Do(next echo.HandlerFunc, c echo.Context) error
- func (s *Session) GetStore() StoreInf
- func (m *Session) Info(c echo.Context) error
- func (m *Session) Init(ctx context.Context, name string) error
- func (m *Session) IsLogged(c echo.Context) (bool, error)
- func (m *Session) Middleware(ctx context.Context, name string) (echo.MiddlewareFunc, error)
- func (m *Session) RedirectToLogin(c echo.Context, store StoreInf, addRedirectPath bool, removeSession bool) error
- func (m *Session) RedirectToMain(c echo.Context) error
- func (m *Session) SetAction() error
- func (s *Session) SetStore(ctx context.Context) error
- func (s *Session) SetToken(c echo.Context, token []byte, providerName string) error
- type Store
- type StoreInf
- type Token
- type TokenData
Constants ¶
View Source
const ( CtxTokenHeaderKey = "token_header" CtxDisableRedirectKey = "disable_redirect" )
Variables ¶
View Source
var ( TokenKey = "token" ProviderKey = "provider" )
View Source
var GlobalRegistry = &Registry{ Store: make(map[string]*Session), }
Functions ¶
This section is empty.
Types ¶
type AuthHeaderStyle ¶ added in v0.5.8
type AuthHeaderStyle int
AuthHeaderStyle is a type to set Authorization header style.
const ( AuthHeaderStyleBasic AuthHeaderStyle = iota AuthHeaderStyleBearerSecret AuthHeaderStyleParams )
type Information ¶
type Information struct { // Values list to store in the cookie like "preferred_username", "given_name", "family_name", "sid", "azp", "aud" Values []string `cfg:"values"` // Custom map to store in the cookie. Custom map[string]interface{} `cfg:"custom"` // Roles to store in the cookie as []string. Roles bool `cfg:"roles"` // Scopes to store in the cookie as []string. Scopes bool `cfg:"scopes"` }
type Oauth2 ¶ added in v0.5.8
type Oauth2 struct { // ClientID is the application's ID. ClientID string `cfg:"client_id"` // ClientSecret is the application's secret. ClientSecret string `cfg:"client_secret" log:"false"` // Scope specifies optional requested permissions. Scopes []string `cfg:"scopes"` // CertURL is the resource server's public key URL. CertURL string `cfg:"cert_url"` // IntrospectURL is the check the active or not with request. IntrospectURL string `cfg:"introspect_url"` // AuthURL is the resource server's authorization endpoint // use for redirection to login page. AuthURL string `cfg:"auth_url"` // TokenURL is the resource server's token endpoint URL. TokenURL string `cfg:"token_url"` LogoutURL string `cfg:"logout_url"` // AuthHeaderStyle is optional. If not set, AuthHeaderStyleBasic will be used. AuthHeaderStyle AuthHeaderStyle }
type ProviderWrapper ¶ added in v0.5.7
func (*ProviderWrapper) GetCertURL ¶ added in v0.5.7
func (p *ProviderWrapper) GetCertURL() string
func (*ProviderWrapper) IsNoop ¶ added in v0.5.7
func (p *ProviderWrapper) IsNoop() bool
type Session ¶
type Session struct { SessionKey string `cfg:"session_key"` Store Store `cfg:"store"` Options Options `cfg:"options"` CookieName string `cfg:"cookie_name"` Action Action `cfg:"action"` Information Information `cfg:"information"` Provider map[string]Provider `cfg:"provider"` // contains filtered or unexported fields }
func (*Session) Middleware ¶
func (*Session) RedirectToLogin ¶
func (*Session) RedirectToMain ¶
type TokenData ¶ added in v0.5.7
type TokenData struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` RefreshExpiresIn int `json:"refresh_expires_in"` RefreshToken string `json:"refresh_token"` TokenType string `json:"token_type"` NotBeforePolicy int `json:"not-before-policy"` SessionState string `json:"session_state"` Scope string `json:"scope"` IDToken string `json:"id_token"` }
func ParseToken ¶ added in v0.5.7
func ParseToken64 ¶ added in v0.5.7
Parse64 parse the cookie
Source Files
¶
Click to show internal directories.
Click to hide internal directories.