Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyADGroupName(value interface{}) (interface{}, error)
- func ApplyArray(value interface{}) (interface{}, error)
- func ApplyCSVToArray(value interface{}) (interface{}, error)
- func ApplyClaimsTransformation(value interface{}, transformation string) (interface{}, error)
- func ApplyCommonTransformation(value interface{}, transformation string) (interface{}, error)
- func ApplyJWTExtractScope(value interface{}) (interface{}, error)
- func ApplyJWTNormalizeGroups(value interface{}) (interface{}, error)
- func ApplyLDAPAttributeValues(value interface{}) (interface{}, error)
- func ApplyLDAPDNToCN(value interface{}) (interface{}, error)
- func ApplyLDAPDNToCNArray(value interface{}) (interface{}, error)
- func ApplyLDAPTransformation(value interface{}, transformation string) (interface{}, error)
- func ApplyLowercase(value interface{}) (interface{}, error)
- func ApplyPostgresArray(value interface{}) (interface{}, error)
- func ApplySQLTransformation(value interface{}, transformation string) (interface{}, error)
- func ApplyString(value interface{}) (interface{}, error)
- func ApplyUppercase(value interface{}) (interface{}, error)
- func EscapeLDAPFilter(value string) string
- func ExtractCNFromDN(dn string) string
- func GetAllClaimsTransformations() []string
- func GetAllLDAPTransformations() []string
- func GetAllSQLTransformations() []string
- func GetClaimsTransformations() []string
- func GetCommonTransformations() []string
- func GetLDAPTransformations() []string
- func GetSQLTransformations() []string
- func IsCommonTransformation(transformation string) bool
- func IsSupportedByProvider(transformation, providerType string) bool
- type Registry
Constants ¶
const ( ProviderTypeSQL = "sql" ProviderTypeLDAP = "ldap" ProviderTypeClaims = "claims" )
Provider type constants
const ( // Basic data type transformations CommonArray = "array" CommonString = "string" CommonLowercase = "lowercase" CommonUppercase = "uppercase" // Common parsing transformations CommonCSVToArray = "csv_to_array" )
Common transformation constants - usable by all providers
const ( LDAPDNToCNArray = "ldap_dn_to_cn_array" LDAPDNToCN = "ldap_dn_to_cn" LDAPAttrValues = "ldap_attribute_values" LDAPADGroupName = "ad_group_name" )
LDAP-specific transformation constants
const ( ClaimsExtractScope = "jwt_extract_scope" ClaimsNormalizeGroups = "jwt_normalize_groups" )
Claims-specific transformation constants
const (
SQLPostgresArray = "postgres_array"
)
SQL-specific transformation constants
Variables ¶
var DefaultRegistry = NewRegistry()
Global registry instance for convenience
Functions ¶
func ApplyADGroupName ¶
func ApplyADGroupName(value interface{}) (interface{}, error)
ApplyADGroupName extracts group name from Active Directory group DN
func ApplyArray ¶
func ApplyArray(value interface{}) (interface{}, error)
ApplyArray ensures the value is returned as an array type
func ApplyCSVToArray ¶
func ApplyCSVToArray(value interface{}) (interface{}, error)
ApplyCSVToArray converts comma-separated strings to string arrays
func ApplyClaimsTransformation ¶
ApplyClaimsTransformation applies Claims-specific transformations
func ApplyCommonTransformation ¶
ApplyCommonTransformation applies common transformations that work across all providers
func ApplyJWTExtractScope ¶
func ApplyJWTExtractScope(value interface{}) (interface{}, error)
ApplyJWTExtractScope extracts scopes from space-separated scope claim OAuth2/OIDC scopes are typically space-separated per RFC 6749
func ApplyJWTNormalizeGroups ¶
func ApplyJWTNormalizeGroups(value interface{}) (interface{}, error)
ApplyJWTNormalizeGroups normalizes group names from various formats Handles comma-separated, space-separated, or array formats
func ApplyLDAPAttributeValues ¶
func ApplyLDAPAttributeValues(value interface{}) (interface{}, error)
ApplyLDAPAttributeValues extracts values from LDAP attribute (handle multi-valued attributes)
func ApplyLDAPDNToCN ¶
func ApplyLDAPDNToCN(value interface{}) (interface{}, error)
ApplyLDAPDNToCN converts single DN to CN
func ApplyLDAPDNToCNArray ¶
func ApplyLDAPDNToCNArray(value interface{}) (interface{}, error)
ApplyLDAPDNToCNArray converts array of DNs to array of CNs
func ApplyLDAPTransformation ¶
ApplyLDAPTransformation applies LDAP-specific transformations
func ApplyLowercase ¶
func ApplyLowercase(value interface{}) (interface{}, error)
ApplyLowercase converts string values to lowercase
func ApplyPostgresArray ¶
func ApplyPostgresArray(value interface{}) (interface{}, error)
ApplyPostgresArray handles PostgreSQL array format: {item1,item2,item3}
func ApplySQLTransformation ¶
ApplySQLTransformation applies SQL-specific transformations
func ApplyString ¶
func ApplyString(value interface{}) (interface{}, error)
ApplyString converts any value to its string representation
func ApplyUppercase ¶
func ApplyUppercase(value interface{}) (interface{}, error)
ApplyUppercase converts string values to uppercase
func EscapeLDAPFilter ¶
EscapeLDAPFilter escapes special characters in LDAP filter values This is a utility function for LDAP providers
func ExtractCNFromDN ¶
ExtractCNFromDN extracts the Common Name (CN) from a Distinguished Name (DN) Example: "CN=Users,OU=Groups,DC=example,DC=com" -> "Users"
func GetAllClaimsTransformations ¶
func GetAllClaimsTransformations() []string
GetAllClaimsTransformations returns common + Claims transformations
func GetAllLDAPTransformations ¶
func GetAllLDAPTransformations() []string
GetAllLDAPTransformations returns common + LDAP transformations
func GetAllSQLTransformations ¶
func GetAllSQLTransformations() []string
GetAllSQLTransformations returns common + SQL transformations
func GetClaimsTransformations ¶
func GetClaimsTransformations() []string
GetClaimsTransformations returns Claims-specific transformations
func GetCommonTransformations ¶
func GetCommonTransformations() []string
GetCommonTransformations returns all common transformations available to any provider
func GetLDAPTransformations ¶
func GetLDAPTransformations() []string
GetLDAPTransformations returns LDAP-specific transformations
func GetSQLTransformations ¶
func GetSQLTransformations() []string
GetSQLTransformations returns SQL-specific transformations
func IsCommonTransformation ¶
IsCommonTransformation checks if a transformation is a common one
func IsSupportedByProvider ¶
IsSupportedByProvider checks if a transformation is supported by a specific provider type
Types ¶
type Registry ¶
type Registry struct{}
Registry provides a unified interface for applying transformations across all provider types with fallback to common transformations
func (*Registry) ApplyTransformation ¶
func (r *Registry) ApplyTransformation(value interface{}, transformation string, providerType string) (interface{}, error)
ApplyTransformation applies a transformation with provider-aware fallback
func (*Registry) GetSupportedTransformations ¶
GetSupportedTransformations returns all transformations supported by a provider type