server

package
v0.0.0-...-0cbb5ad Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 18 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 {
	// Dex server address, Optional.
	DexAddress string
	// URL of the OpenID Connect issuer
	IssuerURL string
	// callback url for OpenID Connect Provider response.
	RedirectURL string
	// OAuth2 client ID of this application
	ClientID string
	// OAuth2 client secret of this application
	ClientSecret string
	// Scope specifies optional requested permissions
	Scopes []string
	// UsernameClaim is the JWT field to use as the user's username.
	UsernameClaim string
	// GroupsClaim, if specified, causes the OIDCAuthenticator to try to populate the user's
	// groups with an ID Token field. If the GroupsClaim field is present in an ID Token the value
	// must be a string or list of strings.
	GroupsClaim string
	// backend session store
	Store sessions.Store
	// CORS allowed origins
	AllowedOrigins []string
	// Whether to use AccessTypeOffline or not
	OfflineAccess bool
}

type DexRewriteURLRoundTripper

type DexRewriteURLRoundTripper struct {
	DexURL *url.URL
	T      http.RoundTripper
}

DexRewriteURLRoundTripper is an HTTP RoundTripper to rewrite HTTP requests to the specified dex server address. This is used when requests Dex in same cluster to avoid from api gateway or external load balancer, which is not always permitted in firewalled/air-gapped networks.

func NewDexRewriteURLRoundTripper

func NewDexRewriteURLRoundTripper(dexAddr string, t http.RoundTripper) DexRewriteURLRoundTripper

NewDexRewriteURLRoundTripper creates a new DexRewriteURLRoundTripper

func (DexRewriteURLRoundTripper) RoundTrip

type Server

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

func NewServer

func NewServer(config Config) (*Server, error)

func (*Server) ServeHTTP

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

type UserIDOpts

type UserIDOpts struct {
	Header      string
	TokenHeader string
	Prefix      string
	Claim       string
}

Jump to

Keyboard shortcuts

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