oidc

package
v0.1.298 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func AddOIDCConfigAccessor

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

AddOIDCConfigAccessor adds service to the DI container

Types

type ClaimFact added in v0.1.207

type ClaimFact struct {
	Claim     claimsprincipalContracts.Claim
	Directive ClaimFactDirective
}

ClaimFact ...

func NewClaimFactType added in v0.1.208

func NewClaimFactType(claimType string) ClaimFact

NewClaimFactType ...

func NewClaimFactTypeAndValue added in v0.1.208

func NewClaimFactTypeAndValue(claimType string, value string) ClaimFact

NewClaimFactTypeAndValue ...

func NewClaimFactTypeAndValueClaim added in v0.1.208

func NewClaimFactTypeAndValueClaim(claim claimsprincipalContracts.Claim) ClaimFact

NewClaimFactTypeAndValueClaim ...

type ClaimFactDirective added in v0.1.207

type ClaimFactDirective int64

ClaimFactDirective ...

const (
	// ClaimTypeAndValue ...
	ClaimTypeAndValue ClaimFactDirective = 0
	// ClaimType ...
	ClaimType = 1
)

type ClaimsConfig

type ClaimsConfig struct {
	OR    []*ClaimFact `mapstructure:"OR"`
	AND   []*ClaimFact `mapstructure:"AND"`
	Child *ClaimsConfig
}

ClaimsConfig ...

func (*ClaimsConfig) GetChild added in v0.1.215

func (s *ClaimsConfig) GetChild() *ClaimsConfig

GetChild gets or creates a child config that will be changed to the parent for evalutation

func (*ClaimsConfig) WithGrpcEntrypointPermissionsClaimFactsMapAND added in v0.1.215

func (s *ClaimsConfig) WithGrpcEntrypointPermissionsClaimFactsMapAND(claimFacts ...*ClaimFact) *ClaimsConfig

WithGrpcEntrypointPermissionsClaimFactsMapAND helper to add a single entrypoint config

func (*ClaimsConfig) WithGrpcEntrypointPermissionsClaimFactsMapOR added in v0.1.215

func (s *ClaimsConfig) WithGrpcEntrypointPermissionsClaimFactsMapOR(claimFacts ...*ClaimFact) *ClaimsConfig

WithGrpcEntrypointPermissionsClaimFactsMapOR helper to add a single entrypoint config

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
}

DiscoveryDocument ...

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"`
	MetaData       map[string]interface{} `mapstructure:"META_DATA"`
}

EntryPointConfig ...

type IOIDCConfig

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

IOIDCConfig ...

type IOIDCConfigAccessor

type IOIDCConfigAccessor interface {
	GetOIDCConfig() IOIDCConfig
}

IOIDCConfigAccessor ...

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"`
}

JSONWebKey ...

type JSONWebKeyResponse

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

JSONWebKeyResponse ...

type NewGinIntrospectionValidationMiddlewareOptions

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

	DiscoveryURL *url.URL
	ClientID     string
	ClientSecret string
}

NewGinIntrospectionValidationMiddlewareOptions ...

type NewJWTValidationMiddlewareOptions

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

	DiscoveryURL *url.URL
}

NewJWTValidationMiddlewareOptions ...

type NewOIDCAuthenticationOptions

type NewOIDCAuthenticationOptions struct {
	Authority *url.URL
}

NewOIDCAuthenticationOptions ...

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

GetAuthority ...

func (*OIDCConfig) GetCronRefreshSchedule

func (c *OIDCConfig) GetCronRefreshSchedule() string

GetCronRefreshSchedule ...

func (*OIDCConfig) GetEntryPoints

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

GetEntryPoints ...

type User

type User struct {
	Claims jwt.MapClaims
}

User ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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