oidclocal

package
v1.29.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package oidclocal provides a Dex-backed local OIDC integration definition for development testing

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOAuthTokenMissing indicates the OAuth access token is missing from the auth-managed credential
	ErrOAuthTokenMissing = errors.New("oidclocal: oauth token missing")
	// ErrSubjectMissing indicates the OIDC subject claim is missing from the auth-managed credential
	ErrSubjectMissing = errors.New("oidclocal: subject claim missing")
	// ErrCredentialEncode indicates the credential could not be serialized
	ErrCredentialEncode = errors.New("oidclocal: credential encode failed")
	// ErrCredentialDecode indicates the credential could not be deserialized
	ErrCredentialDecode = errors.New("oidclocal: credential decode failed")
	// ErrResultEncode indicates an operation result could not be serialized
	ErrResultEncode = errors.New("oidclocal: result encode failed")
)

Functions

func Builder

func Builder(cfg Config) registry.Builder

Builder returns the local Dex-backed OIDC definition builder with the supplied operator config applied

Types

type ClaimsInspect

type ClaimsInspect struct {
	// Claims is the full set of OIDC claims stored in the auth-managed credential
	Claims map[string]any `json:"claims,omitempty"`
}

ClaimsInspect returns the stored OIDC claims for inspection

func (ClaimsInspect) Handle

func (ci ClaimsInspect) Handle() types.OperationHandler

Handle adapts claim inspection to the generic operation registration boundary

func (ClaimsInspect) Run

Run returns the stored OIDC claims for local inspection

type Config

type Config struct {
	// Enabled controls whether the local OIDC test definition is exposed in the catalog
	Enabled bool `json:"enabled" koanf:"enabled" default:"false"`
	// ClientID is the OIDC application client identifier configured in Dex
	ClientID string `json:"clientid" koanf:"clientid" default:"local-core-oidc"`
	// ClientSecret is the OIDC application client secret configured in Dex
	ClientSecret string `json:"clientsecret" koanf:"clientsecret" sensitive:"true" default:"local-core-oidc-secret"`
	// DiscoveryURL is the OIDC issuer URL used for endpoint discovery
	DiscoveryURL string `json:"discoveryurl" koanf:"discoveryurl" default:"http://localhost:5557/dex"`
	// RedirectURL is the OAuth callback URL registered with the OIDC provider
	RedirectURL string `json:"redirecturl" koanf:"redirecturl" default:"http://localhost:17608/v1/integrations/auth/callback"`
}

Config holds operator-level configuration for the local Dex-backed OIDC definition

type HealthCheck

type HealthCheck struct {
	// Issuer is the OIDC issuer claim
	Issuer string `json:"issuer,omitempty"`
	// Subject is the OIDC subject claim
	Subject string `json:"subject,omitempty"`
	// Email is the OIDC email claim
	Email string `json:"email,omitempty"`
	// PreferredUsername is the OIDC preferred_username claim
	PreferredUsername string `json:"preferredUsername,omitempty"`
	// Groups captures any group names emitted in the ID token claims
	Groups []string `json:"groups,omitempty"`
}

HealthCheck holds the result of an OIDC credential health check

func (HealthCheck) Handle

func (h HealthCheck) Handle() types.OperationHandler

Handle adapts the OIDC health check to the generic operation registration boundary

func (HealthCheck) Run

Run validates the stored OIDC credential and returns a small identity summary

type InstallationMetadata

type InstallationMetadata struct {
	// Issuer is the OIDC issuer claim
	Issuer string `json:"issuer,omitempty" jsonschema:"title=Issuer"`
	// Subject is the OIDC subject claim
	Subject string `json:"subject,omitempty" jsonschema:"title=Subject"`
	// Email is the OIDC email claim
	Email string `json:"email,omitempty" jsonschema:"title=Email"`
	// PreferredUsername is the OIDC preferred_username claim
	PreferredUsername string `json:"preferredUsername,omitempty" jsonschema:"title=Preferred Username"`
}

InstallationMetadata holds the stable OIDC identity selected for one local test installation

func (InstallationMetadata) InstallationIdentity

InstallationIdentity implements types.InstallationIdentifiable

Jump to

Keyboard shortcuts

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