testutil

package
v0.0.0-...-ccca5b4 Latest Latest
Warning

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

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

Documentation

Overview

Taken from dex, therefore their license applies. Removed functionality to required for tests.

Index

Constants

View Source
const (
	DexClientID     = "smorgasbord"
	DexClientSecret = "ZXhhbXBsZS1hcHAtc2VjcmV0"
	DexUserEmail    = "test@kubism.io"
	DexUserPassword = "password"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Issuer  string  `json:"issuer"`
	Storage Storage `json:"storage"`
	Web     Web     `json:"web"`
	OAuth2  OAuth2  `json:"oauth2"`

	Frontend server.WebConfig `json:"frontend"`

	// StaticConnectors are user defined connectors specified in the ConfigMap
	// Write operations, like updating a connector, will fail.
	StaticConnectors []storage.Connector `json:"connectors"`

	// StaticClients cause the server to use this list of clients rather than
	// querying the storage. Write operations, like creating a client, will fail.
	StaticClients []storage.Client `json:"staticClients"`

	// StaticPasswords cause the server use this list of passwords rather than
	// querying the storage. Cannot be specified without enabling a passwords
	// database.
	StaticPasswords []storage.Password `json:"staticPasswords"`
}

Config is the config format for the main application.

type DebugLog

type DebugLog = func(string, ...interface{})

type Dex

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

func NewDex

func NewDex(redirectURL string) (*Dex, error)

func (*Dex) Close

func (d *Dex) Close() error

func (*Dex) GetAddr

func (d *Dex) GetAddr() string

func (*Dex) GetAuthCodeURLMutator

func (d *Dex) GetAuthCodeURLMutator() func(string) string

func (*Dex) GetIssuerURL

func (d *Dex) GetIssuerURL() string

type GitServer

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

func NewGitServer

func NewGitServer(rootDir string) (*GitServer, error)

func (*GitServer) Close

func (g *GitServer) Close() error

func (*GitServer) GetAddr

func (g *GitServer) GetAddr() string

type OAuth2

type OAuth2 struct {
	ResponseTypes []string `json:"responseTypes"`
	// If specified, do not prompt the user to approve client authorization. The
	// act of logging in implies authorization.
	SkipApprovalScreen bool `json:"skipApprovalScreen"`
	// If specified, show the connector selection screen even if there's only one
	AlwaysShowLoginScreen bool `json:"alwaysShowLoginScreen"`
	// This is the connector that can be used for password grant
	PasswordConnector string `json:"passwordConnector"`
}

OAuth2 describes enabled OAuth2 extensions.

type Storage

type Storage struct {
	Type   string        `json:"type"`
	Config StorageConfig `json:"config"`
}

Storage holds app's storage configuration.

type StorageConfig

type StorageConfig interface {
	Open(logger log.Logger) (storage.Storage, error)
}

StorageConfig is a configuration that can create a storage.

type Web

type Web struct {
	HTTP           string   `json:"http"`
	HTTPS          string   `json:"https"`
	TLSCert        string   `json:"tlsCert"`
	TLSKey         string   `json:"tlsKey"`
	AllowedOrigins []string `json:"allowedOrigins"`
}

Web is the config format for the HTTP server.

Jump to

Keyboard shortcuts

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