oauth

package
v3.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Mount       string   `name:"mount" description:"Path on the server where the OAuth server will be served"`
	UI          UIConfig `name:"ui"`
	CSRFAuthKey []byte   `name:"-"`
}

Config is the configuration for the OAuth server.

type ConfigProvider added in v3.9.1

type ConfigProvider func(context.Context) Config

ConfigProvider returns the server configuration based on the context.

func StaticConfigProvider added in v3.9.1

func StaticConfigProvider(conf Config) ConfigProvider

StaticConfigProvider is a provider that always returns the same config.

type FrontendConfig

type FrontendConfig struct {
	Language    string `json:"language" name:"-"`
	StackConfig `json:"stack_config" name:",squash"`
}

FrontendConfig is the configuration for the OAuth frontend.

type Server

type Server interface {
	web.Registerer

	Login(c echo.Context) error
	CurrentUser(c echo.Context) error
	Logout(c echo.Context) error
	Authorize(authorizePage echo.HandlerFunc) echo.HandlerFunc
	Token(c echo.Context) error
}

Server is the interface for the OAuth server.

func NewServer

func NewServer(c *component.Component, store Store, configProvider ConfigProvider) (Server, error)

NewServer returns a new OAuth server on top of the given store.

type StackConfig

type StackConfig struct {
	IS webui.APIConfig `json:"is" name:"is"`
}

StackConfig is the configuration of the stack components.

type Store

type Store interface {
	// UserStore and UserSessionStore are needed for user login/logout.
	store.UserStore
	store.UserSessionStore
	// ClientStore is needed for getting the OAuth client.
	store.ClientStore
	// OAuth is needed for OAuth authorizations.
	store.OAuthStore
}

Store used by the OAuth server.

type UIConfig

type UIConfig struct {
	webui.TemplateData `name:",squash"`
	FrontendConfig     `name:",squash"`
}

UIConfig is the combined configuration for the OAuth UI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL