config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTLSGenDir = os.ExpandEnv("$HOME/.config/aserto/scim/certs")
	ErrInvalidConfig = errors.New("invalid config")
)

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Basic struct {
		Enabled  bool   `json:"enabled"`
		Username string `json:"username"`
		Password string `json:"password"`
	} `json:"basic"`
	Bearer struct {
		Enabled bool   `json:"enabled"`
		Token   string `json:"token"`
	} `json:"bearer"`
}

type Config

type Config struct {
	Logging   logger.Config `json:"logging"`
	Directory client.Config `json:"directory"`
	Server    struct {
		ListenAddress string           `json:"listen_address"`
		Certs         client.TLSConfig `json:"certs"`
		Auth          AuthConfig       `json:"auth"`
	} `json:"server"`

	SCIM struct {
		CreateEmailIdentities bool            `json:"create_email_identities"`
		CreateRoleGroups      bool            `json:"create_role_groups"`
		GroupMappings         []ObjectMapping `json:"group_mappings"`
		UserMappings          []ObjectMapping `json:"user_mappings"`
		UserObjectType        string          `json:"user_object_type"`
		GroupMemberRelation   string          `json:"group_member_relation"`
		GroupObjectType       string          `json:"group_object_type"`
		IdentityObjectType    string          `json:"identity_object_type"`
		IdentityRelation      string          `json:"identity_relation"`
		Identity              struct {
			ObjectType string
			Relation   string
		} `json:"-"`
	} `json:"scim"`
}

func NewConfig

func NewConfig(configPath string) (*Config, error)

func (*Config) Validate added in v0.1.0

func (cfg *Config) Validate() error

type ObjectMapping added in v0.0.6

type ObjectMapping struct {
	SubjectID       string `json:"subject_id"`
	ObjectType      string `json:"object_type"`
	ObjectID        string `json:"object_id"`
	Relation        string `json:"relation"`
	SubjectRelation string `json:"subject_relation"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳