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
- Variables
- func GetLoggerFromProvider(ctx context.Context, provider func(ctx context.Context) log.FieldLogger) log.FieldLogger
- func MakeDefaultHTTPClient(reqTimeout time.Duration, ...) *http.Client
- func MakeHTTPClientWithFastRetryPolicy(reqTimeout time.Duration, ...) *http.Client
- func PrepareLogger(logger log.FieldLogger) log.FieldLogger
- type JWKSResponse
- type OpenIDConfiguration
- type TokenResponse
- type TrustedIssuerStore
- type TrustedIssuerURLMatcher
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 MakeHTTPClientWithFastRetryPolicy ¶ added in v0.28.0
func MakeHTTPClientWithFastRetryPolicy( reqTimeout time.Duration, loggerProvider func(ctx context.Context) log.FieldLogger, requestIDProvider func(ctx context.Context) string, userAgent string, ) *http.Client
MakeHTTPClientWithFastRetryPolicy creates an HTTP client with a fast retry policy. It is useful for cases where we don't want to wait too long for retries (e.g., during token introspection, fetching JWKS, etc.)
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 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 ¶
Click to show internal directories.
Click to hide internal directories.