config

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName    = "cb365"
	AppVersion = "0.1.0-dev"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the config directory path

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the full path to the config file

Types

type AuthMode

type AuthMode string

AuthMode represents the authentication mode

const (
	AuthModeDelegated AuthMode = "delegated"
	AuthModeAppOnly   AuthMode = "app-only"
)

type Config

type Config struct {
	ActiveProfile string              `json:"active_profile"`
	Profiles      map[string]*Profile `json:"profiles"`
	Settings      Settings            `json:"settings"`
}

Config represents the cb365 configuration file

func Load

func Load() (*Config, error)

Load reads the config from disk

func (*Config) ActiveProfileConfig

func (c *Config) ActiveProfileConfig() (*Profile, error)

ActiveProfileConfig returns the currently active profile

func (*Config) Save

func (c *Config) Save() error

Save writes the config to disk

func (*Config) SetActiveProfile

func (c *Config) SetActiveProfile(name string) error

SetActiveProfile switches the active profile

type ManagedDelegatedMetadata added in v0.3.0

type ManagedDelegatedMetadata struct {
	HomeAccountID            string            `json:"home_account_id"`
	SecretID                 string            `json:"secret_id"`
	OrganisationID           string            `json:"organisation_id"`
	ProjectID                string            `json:"project_id"`
	AssignedHost             string            `json:"assigned_host"`
	MigrationState           string            `json:"migration_state"`
	ChannelMessageProvenance map[string]string `json:"channel_message_provenance,omitempty"`
}

ManagedDelegatedMetadata contains non-secret references for a delegated profile whose bearer material lives exclusively in Bitwarden Secrets Manager EU. None of these fields is sufficient to authenticate to either Bitwarden or Entra.

type Profile

type Profile struct {
	Name             string                    `json:"name"`
	TenantID         string                    `json:"tenant_id"`
	ClientID         string                    `json:"client_id"`
	AuthMode         AuthMode                  `json:"auth_mode"`
	Scopes           []string                  `json:"scopes,omitempty"`
	Username         string                    `json:"username,omitempty"`
	Active           bool                      `json:"active,omitempty"`
	ManagedDelegated *ManagedDelegatedMetadata `json:"managed_delegated,omitempty"`
}

Profile represents a configured authentication profile

type Settings

type Settings struct {
	IPv4Only bool `json:"ipv4_only,omitempty"`
}

Settings holds global CLI settings

Jump to

Keyboard shortcuts

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