credential

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTransform

func ApplyTransform(value any, transform string) any

ApplyTransform applies a named transformation to a value.

func GetNestedValue

func GetNestedValue(doc map[string]any, path string) (any, bool)

GetNestedValue retrieves a value from a map using dot-notation path.

func SetNestedValue

func SetNestedValue(doc map[string]any, path string, value any) error

SetNestedValue sets a value in a map using dot-notation path. Example: "identity.family_name" creates map[identity][family_name] = value

Types

type ClaimTransformer

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

ClaimTransformer transforms external attributes/claims into credential document structures. Protocol-agnostic — works for SAML OIDs, OIDC claim names, or any other attribute source.

func NewClaimTransformer

func NewClaimTransformer(mappings map[string]model.CredentialMapping) *ClaimTransformer

NewClaimTransformer creates a new claim transformer from credential mappings.

func (*ClaimTransformer) GetMapping

func (t *ClaimTransformer) GetMapping(credentialType string) (*model.CredentialMapping, error)

GetMapping returns the credential mapping for a credential type.

func (*ClaimTransformer) TransformClaims

func (t *ClaimTransformer) TransformClaims(
	credentialType string,
	attributes map[string]any,
) (map[string]any, error)

TransformClaims converts external attributes (keyed by protocol-specific identifiers) to a generic document structure using the configured mappings.

Jump to

Keyboard shortcuts

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