client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOptionalBool

func ParseOptionalBool(raw string) *bool

func ParseTime

func ParseTime(value string) (*time.Time, error)

func ParseTypeColonID

func ParseTypeColonID(value string) (string, string, error)

func ValidateEntitlementFields

func ValidateEntitlementFields(data *LoadedData) error

ValidateEntitlementFields checks that every entitlement has the required resource_id and entitlement_slug fields populated.

func ValidateLoadedData

func ValidateLoadedData(rawBytes []byte, format string) error

func ValidateReferences

func ValidateReferences(data *LoadedData) error

ValidateReferences checks that every cross-reference between sections points to an existing ID. This catches typos and missing definitions at startup rather than producing scattered runtime warnings during sync.

func ValidateSecretFields

func ValidateSecretFields(data *LoadedData) error

ValidateSecretFields checks that secret-specific fields (created_at, expires_at, created_by, identity) are only used on resources with the "secret" trait. Using them on other traits has no effect and almost always indicates a mistake.

func ValidateTraits

func ValidateTraits(data *LoadedData) error

ValidateTraits checks that every resource has a recognized trait value.

func ValidateUniqueIDs

func ValidateUniqueIDs(data *LoadedData) error

ValidateUniqueIDs checks that no ID appears more than once across users and resources. IDs must be globally unique because grants and parent references resolve by raw ID — a collision would silently drop data.

Types

type DirectUserGrant

type DirectUserGrant struct {
	PrincipalID     string `yaml:"principal_id" json:"principal_id"`
	ResourceID      string `yaml:"resource_id" json:"resource_id"`
	EntitlementSlug string `yaml:"entitlement_slug" json:"entitlement_slug"`
}

type EntitlementData

type EntitlementData struct {
	ResourceID      string `yaml:"resource_id" json:"resource_id"`
	EntitlementSlug string `yaml:"entitlement_slug" json:"entitlement_slug"`
	DisplayName     string `yaml:"display_name" json:"display_name"`
	Description     string `yaml:"description" json:"description"`
}

type FlexibleStringList

type FlexibleStringList []string

func SplitCommaSeparated

func SplitCommaSeparated(raw string) FlexibleStringList

func (*FlexibleStringList) UnmarshalJSON

func (f *FlexibleStringList) UnmarshalJSON(data []byte) error

func (*FlexibleStringList) UnmarshalYAML

func (f *FlexibleStringList) UnmarshalYAML(node *yaml.Node) error

type GrantInheritanceMapping

type GrantInheritanceMapping struct {
	PrincipalResourceID      string `yaml:"principal_resource_id" json:"principal_resource_id"`
	PrincipalEntitlementSlug string `yaml:"principal_entitlement_slug" json:"principal_entitlement_slug"`
	InheritedResourceID      string `yaml:"inherited_resource_id" json:"inherited_resource_id"`
	InheritedEntitlementSlug string `yaml:"inherited_entitlement_slug" json:"inherited_entitlement_slug"`
	InheritanceDepth         string `yaml:"inheritance_depth" json:"inheritance_depth"`
}

type LoadedData

type LoadedData struct {
	Users                    []UserData                `yaml:"users" json:"users"`
	Resources                []ResourceData            `yaml:"resources" json:"resources"`
	Entitlements             []EntitlementData         `yaml:"entitlements" json:"entitlements"`
	DirectUserGrants         []DirectUserGrant         `yaml:"direct_user_grants" json:"direct_user_grants"`
	GrantInheritanceMappings []GrantInheritanceMapping `yaml:"grant_inheritance_mappings" json:"grant_inheritance_mappings"`
}

func LoadFileData

func LoadFileData(filePath string) (*LoadedData, error)

type ResourceData

type ResourceData struct {
	ResourceType   string                 `yaml:"resource_type" json:"resource_type"`
	Trait          string                 `yaml:"trait" json:"trait"`
	ID             string                 `yaml:"id" json:"id"`
	DisplayName    string                 `yaml:"display_name" json:"display_name"`
	Description    string                 `yaml:"description" json:"description"`
	ParentResource string                 `yaml:"parent_resource" json:"parent_resource"`
	Profile        map[string]interface{} `yaml:"profile" json:"profile"`
	CreatedAt      string                 `yaml:"created_at" json:"created_at"`
	ExpiresAt      string                 `yaml:"expires_at" json:"expires_at"`
	CreatedBy      string                 `yaml:"created_by" json:"created_by"`
	Identity       string                 `yaml:"identity" json:"identity"`
}

type UserData

type UserData struct {
	ID               string                 `yaml:"id" json:"id"`
	DisplayName      string                 `yaml:"display_name" json:"display_name"`
	Email            string                 `yaml:"email" json:"email"`
	Status           string                 `yaml:"status" json:"status"`
	LastLogin        string                 `yaml:"last_login" json:"last_login"`
	Type             string                 `yaml:"type" json:"type"`
	Profile          map[string]interface{} `yaml:"profile" json:"profile"`
	EmployeeID       FlexibleStringList     `yaml:"employee_id" json:"employee_id"`
	Login            string                 `yaml:"login" json:"login"`
	LoginAliases     FlexibleStringList     `yaml:"login_aliases" json:"login_aliases"`
	AdditionalEmails FlexibleStringList     `yaml:"additional_emails" json:"additional_emails"`
	MFAEnabled       *bool                  `yaml:"mfa_enabled" json:"mfa_enabled"`
	SSOEnabled       *bool                  `yaml:"sso_enabled" json:"sso_enabled"`
	StatusDetails    string                 `yaml:"status_details" json:"status_details"`
}

Jump to

Keyboard shortcuts

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