openid_connect_jwt

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
)

Functions

func NewFactory

func NewFactory() auth.IAuthFactory

NewFactory 生成一个 auth_apiKey工厂

func Register

func Register()

Register 注册auth驱动工厂

Types

type Config

type Config struct {
	application.Auth
	Users []*User `json:"users" label:"用户列表"`
}

type DiscoveryConfig

type DiscoveryConfig struct {
	TokenEndpoint                     string   `json:"token_endpoint"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
	JwksUri                           string   `json:"jwks_uri"`
	ResponseModesSupported            []string `json:"response_modes_supported"`
	SubjectTypesSupported             []string `json:"subject_types_supported"`
	IdTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported"`
	ResponseTypesSupported            []string `json:"response_types_supported"`
	ScopesSupported                   []string `json:"scopes_supported"`
	Issuer                            string   `json:"issuer"`
	MicrosoftMultiRefreshToken        bool     `json:"microsoft_multi_refresh_token"`
	AuthorizationEndpoint             string   `json:"authorization_endpoint"`
	DeviceAuthorizationEndpoint       string   `json:"device_authorization_endpoint"`
	HttpLogoutSupported               bool     `json:"http_logout_supported"`
	FrontchannelLogoutSupported       bool     `json:"frontchannel_logout_supported"`
	EndSessionEndpoint                string   `json:"end_session_endpoint"`
	ClaimsSupported                   []string `json:"claims_supported"`
	CheckSessionIframe                string   `json:"check_session_iframe"`
	UserinfoEndpoint                  string   `json:"userinfo_endpoint"`
	KerberosEndpoint                  string   `json:"kerberos_endpoint"`
	TenantRegionScope                 string   `json:"tenant_region_scope"`
	CloudInstanceName                 string   `json:"cloud_instance_name"`
	CloudGraphHostName                string   `json:"cloud_graph_host_name"`
	MsgraphHost                       string   `json:"msgraph_host"`
	RbacUrl                           string   `json:"rbac_url"`
}

type IVerifyClaim

type IVerifyClaim interface {
	Verify(obj interface{}) error
}

type IssuerConfig

type IssuerConfig struct {
	ID            string             `json:"id"`
	Issuer        string             `json:"issuer"`
	Configuration *DiscoveryConfig   `json:"configuration"`
	Keys          []JWK              `json:"keys"`
	UpdateTime    time.Time          `json:"update_time"`
	JWKKeys       map[string]jwk.Key `json:"-"`
}

type JWK

type JWK struct {
	Kid     string   `json:"kid"`
	Kty     string   `json:"kty"`
	Alg     string   `json:"alg"`
	Use     string   `json:"use"`
	N       string   `json:"n"`
	E       string   `json:"e"`
	X5C     []string `json:"x5c"`
	X5T     string   `json:"x5t"`
	X5TS256 string   `json:"x5t#S256"`
}

type JWKs

type JWKs struct {
	Keys []JWK `json:"keys"`
}

type Manager

type Manager struct {
	Issuers eosc.Untyped[string, *IssuerConfig]
	Apps    eosc.Untyped[string, map[string]struct{}]
}

func NewManager

func NewManager() *Manager

func (*Manager) Del

func (m *Manager) Del(id string)

func (*Manager) DelIssuerIDMap

func (m *Manager) DelIssuerIDMap(appID string) (map[string]struct{}, bool)

func (*Manager) GetIssuerIDMap

func (m *Manager) GetIssuerIDMap(appID string) map[string]struct{}

func (*Manager) Set

func (m *Manager) Set(id string, config *IssuerConfig)

func (*Manager) SetIssuerIDMap

func (m *Manager) SetIssuerIDMap(appID string, issuerIDMap map[string]struct{})

type Pattern

type Pattern struct {
	Issuer                   string   `json:"issuer"`
	AuthenticatedGroupsClaim []string `json:"authenticated_groups_claim"`
}

type User

type User struct {
	Pattern Pattern `json:"pattern" label:"用户信息"`
	application.User
}

func (*User) Username

func (u *User) Username() string

Jump to

Keyboard shortcuts

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