Documentation
¶
Index ¶
- type Config
- type Console
- func (console *Console) AuthCookie() *cookie.Cookie
- func (console *Console) Callback(c echo.Context) error
- func (console *Console) Login(c echo.Context) error
- func (console *Console) Logout(c echo.Context) error
- func (console *Console) RefreshToken(c echo.Context) error
- func (console *Console) RegisterRoutes(server *web.Server)
- func (console *Console) StateCookie() *cookie.Cookie
- func (console *Console) Token(c echo.Context) error
- type OAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// PublicURL is the public URL of the Console.
PublicURL string `name:"public-url" description:"Public URL of the Console"`
// DefaultLanguage is the default language of the Console.
DefaultLanguage string `name:"language" description:"Default language of the Console"`
// OAuthURL is the location of the OAuth provider.
OAuthURL string `name:"oauth-url" description:"URL of the OAuth provider"`
// OAuth is the OAuth config for the Console.
OAuth OAuth `name:"oauth"`
// contains filtered or unexported fields
}
Config is the configuration for the Console.
type Console ¶
Console is the Console component.
func (*Console) AuthCookie ¶
AuthCookie returns a new authCookie.
func (*Console) Callback ¶
Callback is the OAuth callback that accepts the authorization code and exchanges it for an access token (+ refresh token). The access token is stored in the authorization cookie for later reference.
func (*Console) RefreshToken ¶
RefreshToken is an echo request handler that refreshes the token currently stored in the authCookie and sets in the response the new authCookie.
func (*Console) RegisterRoutes ¶
RegisterRoutes implements web.Registerer. It registers the Console to the web server.
func (*Console) StateCookie ¶
StateCookie returns the cookie storing the state of the console.
type OAuth ¶
type OAuth struct {
// ID is the client ID for the Console.
ID string `name:"client-id" description:"The OAuth client ID for the Console"`
// Secret is the client secret for the Console.
Secret string `name:"client-secret" description:"The OAuth client secret for the Console" json:"-"`
}
OAuth is the OAuth config for the Console.