server

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthServerEnvConf *envAuthServerConfig

AuthServerEnvConf stores the loaded environment variables

Functions

func Authorized

func Authorized(a *dexApp, req *http.Request) (bool, error)

Authorized tests an http request for the Authorization: Bearer [token] header and returns whether or not it's allowed to execute that request

func Cmd

func Cmd() *cobra.Command

Cmd provides main Command of Auth Server

func GetOauth2Token

func GetOauth2Token(a *dexApp, r *http.Request) (*oauth2.Token, *jwt.Token, error)

GetOauth2Token obtains a new oauth2Token from dex

func NewAuthCodeURL

func NewAuthCodeURL(a *dexApp, r *http.Request) (string, error)

NewAuthCodeURL make a new authCodeURL with "rd" query, scopes, and stateToken

func ParseAuthEnv

func ParseAuthEnv() error

ParseAuthEnv parses the environment variables for the auth server

func ParseJWT

func ParseJWT(token string, hmacSecret string) (*jwt.Token, error)

ParseJWT parses a JWT token from a string, checks for validity, and returns it

Types

type OAuth2Config

type OAuth2Config interface {
	GenerateAuthCodeURL(tokenString string, scopes []string, options []oauth2.AuthCodeOption) string
	ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error)
	ExchangeRefreshForToken(ctx context.Context, refresh *oauth2.Token) (*oauth2.Token, error)
	GetTokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
}

OAuth2Config provides an interface to perform standard OAuth2 functions with a provider

type Verifier

type Verifier interface {
	Verify(ctx context.Context, rawIDToken string) error
}

Verifier provides an interface to verify a given ID token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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