oidc

package
v0.1.147-herb-example-... Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeIOIDCConfig         = di.GetInterfaceReflectType((*IOIDCConfig)(nil))
	TypeIOIDCConfigAccessor = di.GetInterfaceReflectType((*IOIDCConfigAccessor)(nil))
)

Functions

func AddOIDCConfigAccessor

func AddOIDCConfigAccessor(builder *di.Builder, obj interface{})

AddOIDCConfigAccessor adds service to the DI container

Types

type ClaimsConfig

type ClaimsConfig struct {
	OR  []claimsprincipalContracts.Claim `mapstructure:"OR"`
	AND []claimsprincipalContracts.Claim `mapstructure:"AND"`
}

type DiscoveryDocument

type DiscoveryDocument struct {
	DiscoveryURL          url.URL
	Algorithms            []string `json:"id_token_signing_alg_values_supported"`
	IntrospectionEndpoint string
	Issuer                string `json:"issuer"`
	JWKSURL               string `json:"jwks_uri"`
	KeyResponse           *JSONWebKeyResponse
}

func NewDiscoveryDocument

func NewDiscoveryDocument(discoveryURL url.URL) *DiscoveryDocument

func (*DiscoveryDocument) Initialize

func (document *DiscoveryDocument) Initialize() error

type EntryPointConfig

type EntryPointConfig struct {
	FullMethodName string       `mapstructure:"FULL_METHOD_NAME"`
	ClaimsConfig   ClaimsConfig `mapstructure:"CLAIMS_CONFIG"`
}

type IOIDCConfig

type IOIDCConfig interface {
	GetAuthority() string
	GetCronRefreshSchedule() string
	GetEntryPoints() map[string]EntryPointConfig
}

type IOIDCConfigAccessor

type IOIDCConfigAccessor interface {
	GetOIDCConfig() IOIDCConfig
}

func GetOIDCConfigAccessorFromContainer

func GetOIDCConfigAccessorFromContainer(ctn di.Container) IOIDCConfigAccessor

type JSONWebKey

type JSONWebKey struct {
	Alg string   `json:"alg"`
	Kty string   `json:"kty"`
	Kid string   `json:"kid"`
	Use string   `json:"use"`
	N   string   `json:"n"`
	E   string   `json:"e"`
	X5c []string `json:"x5c"`
}

type JSONWebKeyResponse

type JSONWebKeyResponse struct {
	Keys []JSONWebKey `json:"keys"`
}

type NewGinIntrospectionValidationMiddlewareOptions

type NewGinIntrospectionValidationMiddlewareOptions struct {
	Out      io.Writer
	LogLevel logrus.Level

	DiscoveryURL *url.URL
	ClientID     string
	ClientSecret string
}

type NewJWTValidationMiddlewareOptions

type NewJWTValidationMiddlewareOptions struct {
	Out      io.Writer
	LogLevel logrus.Level

	DiscoveryURL *url.URL
}

type NewOIDCAuthenticationOptions

type NewOIDCAuthenticationOptions struct {
	Authority *url.URL
}

type OIDCConfig

type OIDCConfig struct {
	Authority string `mapstructure:"AUTHORITY"`
	// CronRefreshSchedule i.e. @every 0h1m0s
	CronRefreshSchedule string                      `mapstructure:"CRON_REFRESH_SCHEDULE"`
	EntryPoints         map[string]EntryPointConfig `mapstructure:"ENTRY_POINTS"`
}

OIDCConfig env:OIDC_CONFIG

func (*OIDCConfig) GetAuthority

func (c *OIDCConfig) GetAuthority() string

func (*OIDCConfig) GetCronRefreshSchedule

func (c *OIDCConfig) GetCronRefreshSchedule() string

func (*OIDCConfig) GetEntryPoints

func (c *OIDCConfig) GetEntryPoints() map[string]EntryPointConfig

type User

type User struct {
	Claims jwt.MapClaims
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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