idputil

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package idputil provides utilities for working with identity providers. It's used in the internal code and not exposed to the public API.

Index

Constants

View Source
const (
	DefaultHTTPRequestTimeout          = 30 * time.Second
	DefaultHTTPRequestMaxRetryAttempts = 3
)
View Source
const GrantTypeJWTBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer" //nolint: gosec // false positive
View Source
const JWTTypeAccessToken = "at+jwt"
View Source
const JWTTypeAppAccessToken = "application/at+jwt"
View Source
const OpenIDConfigurationPath = "/.well-known/openid-configuration"
View Source
const TokenTypeBearer = "Bearer"

Variables

View Source
var DefaultLogger = log.NewDisabledLogger()

Functions

func GetLoggerFromProvider added in v0.7.0

func GetLoggerFromProvider(ctx context.Context, provider func(ctx context.Context) log.FieldLogger) log.FieldLogger

func MakeDefaultHTTPClient added in v0.4.0

func MakeDefaultHTTPClient(
	reqTimeout time.Duration,
	loggerProvider func(ctx context.Context) log.FieldLogger,
	requestIDProvider func(ctx context.Context) string,
	userAgent string,
) *http.Client

func PrepareLogger added in v0.4.0

func PrepareLogger(logger log.FieldLogger) log.FieldLogger

Types

type JWKSResponse added in v0.6.0

type JWKSResponse struct {
}

type OpenIDConfiguration

type OpenIDConfiguration struct {
	TokenURL              string `json:"token_endpoint"`
	IntrospectionEndpoint string `json:"introspection_endpoint"`
	JWKSURI               string `json:"jwks_uri"`
}

func GetOpenIDConfiguration

func GetOpenIDConfiguration(
	ctx context.Context,
	httpClient *http.Client,
	targetURL string,
	additionalHeaders map[string]string,
	logger log.FieldLogger,
	promMetrics *metrics.PrometheusMetrics,
) (OpenIDConfiguration, error)

type TokenResponse added in v0.6.0

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int64  `json:"expires_in"`
}

type TrustedIssuerStore

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

func NewTrustedIssuerStore

func NewTrustedIssuerStore() *TrustedIssuerStore

func (*TrustedIssuerStore) AddTrustedIssuer

func (s *TrustedIssuerStore) AddTrustedIssuer(issName, issURL string)

func (*TrustedIssuerStore) AddTrustedIssuerURL

func (s *TrustedIssuerStore) AddTrustedIssuerURL(issURL string) error

func (*TrustedIssuerStore) GetURLForIssuer

func (s *TrustedIssuerStore) GetURLForIssuer(issuer string) (string, bool)

type TrustedIssuerURLMatcher

type TrustedIssuerURLMatcher func(issURL *url.URL) bool

Jump to

Keyboard shortcuts

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