server

package
v2.0.0-alpha.3+incompa... Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package server implements an OpenID Connect server with federated logins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(s storage.Storage) api.DexServer

NewAPI returns a server which implements the gRPC API interface.

Types

type Config

type Config struct {
	Issuer string

	// The backing persistence layer.
	Storage storage.Storage

	// Strategies for federated identity.
	Connectors []Connector

	// Valid values are "code" to enable the code flow and "token" to enable the implicit
	// flow. If no response types are supplied this value defaults to "code".
	SupportedResponseTypes []string

	// If enabled, the server won't prompt the user to approve authorization requests.
	// Logging in implies approval.
	SkipApprovalScreen bool

	RotateKeysAfter  time.Duration // Defaults to 6 hours.
	IDTokensValidFor time.Duration // Defaults to 24 hours

	GCFrequency time.Duration // Defaults to 5 minutes

	// If specified, the server will use this function for determining time.
	Now func() time.Time

	EnablePasswordDB bool

	TemplateConfig TemplateConfig
}

Config holds the server's configuration options.

Multiple servers using the same storage are expected to be configured identically.

type Connector

type Connector struct {
	ID          string
	DisplayName string
	Connector   connector.Connector
}

Connector is a connector with metadata.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the top level object.

func NewServer

func NewServer(ctx context.Context, c Config) (*Server, error)

NewServer constructs a server from the provided config.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TemplateConfig

type TemplateConfig struct {

	// Directory of the templates. If empty, these will be loaded from memory.
	Dir string `yaml:"dir"`

	// Defaults to the CoreOS logo and "dex".
	LogoURL string `yaml:"logoURL"`
	Issuer  string `yaml:"issuerName"`
}

TemplateConfig describes.

Jump to

Keyboard shortcuts

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