account

package
v0.0.0-...-4fc5b5b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderUnknown accountProvider = 0 // Unknown Provider
	ProviderM365    accountProvider = 1 // M365
)
View Source
const (
	// M365 config
	AccountProviderTypeKey = "account_provider"
	AzureTenantIDKey       = "azure_tenantid"
	AzureClientID          = "azure_client_id"
	AzureSecret            = "azure_secret"
)
View Source
const (
	AzureTenantID = "AZURE_TENANT_ID"
)

config exported name consts

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Provider accountProvider
	Config   map[string]string
}

Account defines an account provider, along with any credentials and identifiers required to set up or communicate with that provider.

func NewAccount

func NewAccount(p accountProvider, cfgs ...providerIDer) (Account, error)

NewAccount aggregates all the supplied configurations into a single configuration

func (Account) GetAccountConfigHash

func (a Account) GetAccountConfigHash() (string, error)

func (Account) ID

func (a Account) ID() string

ID returns the primary tenant ID held by its configuration. Ex: if the account uses an M365 provider, the M365 tenant ID is returned. If the account contains no ID info, returns an empty string.

func (Account) M365Config

func (a Account) M365Config() (M365Config, error)

M365Config retrieves the M365Config details from the Account config.

type M365Config

type M365Config struct {
	credentials.M365 // requires: ClientID, ClientSecret
	AzureTenantID    string
}

func (M365Config) StringConfig

func (c M365Config) StringConfig() (map[string]string, error)

StringConfig transforms a m365Config struct into a plain map[string]string. All values in the original struct which serialize into the map are expected to be strings.

Jump to

Keyboard shortcuts

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