config

package
v1.0.86 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config parses config and plugin configuration files. It provides APIs to read and write config files and manage multiple profiles.

Index

Constants

View Source
const DefaultProfile = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Type   string
	Config map[string]interface{}
}

AuthConfig with metadata used for authenticating the caller.

type AuthenticatorPluginConfig added in v1.0.3

type AuthenticatorPluginConfig struct {
	Name string
	Path string
}

AuthenticatorPluginConfig holds the information about how to execute the external authenticator.

Authenticator plugins require a name and pathto the external executable.

type Config

type Config struct {
	Uri          *url.URL
	Organization string
	Tenant       string
	Path         map[string]string
	Query        map[string]string
	Header       map[string]string
	Auth         AuthConfig
	Insecure     bool
	Debug        bool
	Output       string
	Version      string
}

The Config structure holds the config data from the selected profile.

func (Config) ClientId added in v1.0.1

func (c Config) ClientId() string

func (Config) ClientSecret added in v1.0.1

func (c Config) ClientSecret() string

func (Config) ConfigureCredentialsAuth added in v1.0.1

func (c Config) ConfigureCredentialsAuth(clientId string, clientSecret string) bool

func (Config) ConfigureLoginAuth added in v1.0.1

func (c Config) ConfigureLoginAuth(clientId string, redirectUri string, scopes string) bool

func (*Config) ConfigureOrgTenant added in v1.0.1

func (c *Config) ConfigureOrgTenant(organization string, tenant string) bool

func (Config) ConfigurePatAuth added in v1.0.2

func (c Config) ConfigurePatAuth(pat string) bool

func (Config) Pat added in v1.0.2

func (c Config) Pat() string

func (Config) RedirectUri added in v1.0.1

func (c Config) RedirectUri() string

func (Config) Scopes added in v1.0.1

func (c Config) Scopes() string

func (Config) SetAuthGrantType added in v1.0.68

func (c Config) SetAuthGrantType(grantType string)

func (Config) SetAuthProperty added in v1.0.68

func (c Config) SetAuthProperty(key string, value string)

func (Config) SetAuthScopes added in v1.0.68

func (c Config) SetAuthScopes(scopes string)

func (*Config) SetDebug added in v1.0.68

func (c *Config) SetDebug(debug bool)

func (Config) SetHeader added in v1.0.68

func (c Config) SetHeader(key string, value string)

func (*Config) SetInsecure added in v1.0.68

func (c *Config) SetInsecure(insecure bool)

func (Config) SetPath added in v1.0.68

func (c Config) SetPath(key string, value string)

func (Config) SetQuery added in v1.0.68

func (c Config) SetQuery(key string, value string)

func (*Config) SetUri added in v1.0.68

func (c *Config) SetUri(uri string) error

func (*Config) SetVersion added in v1.0.76

func (c *Config) SetVersion(version string)

type ConfigFileStore added in v1.0.57

type ConfigFileStore struct {
	// contains filtered or unexported fields
}

ConfigFileStore reads and writes the configuration file

The config store is looking for the config file in "$HOME/.uipath/config" path.

func NewConfigFileStore added in v1.0.57

func NewConfigFileStore(filePath string) *ConfigFileStore

func NewConfigFileStoreWithData added in v1.0.57

func NewConfigFileStoreWithData(filePath string, data []byte) *ConfigFileStore

func (ConfigFileStore) Read added in v1.0.57

func (s ConfigFileStore) Read() ([]byte, error)

func (ConfigFileStore) Write added in v1.0.57

func (s ConfigFileStore) Write(data []byte) error

type ConfigProvider

type ConfigProvider struct {
	// contains filtered or unexported fields
}

ConfigProvider parses the config file with the profiles.

func NewConfigProvider added in v1.0.57

func NewConfigProvider(store ConfigStore) *ConfigProvider

func (ConfigProvider) Config

func (p ConfigProvider) Config(name string) *Config

func (*ConfigProvider) Load

func (p *ConfigProvider) Load() error

func (ConfigProvider) New added in v1.0.1

func (p ConfigProvider) New() Config

func (*ConfigProvider) Update

func (p *ConfigProvider) Update(profileName string, config Config) error

type ConfigStore added in v1.0.17

type ConfigStore interface {
	Read() ([]byte, error)
	Write(data []byte) error
}

ConfigStore provides an abstraction for reading and writing the config file.

type PluginConfig added in v1.0.3

type PluginConfig struct {
	Authenticators []AuthenticatorPluginConfig
}

PluginConfig keeps metadata about the configured plugins.

Currently supports only external authenticators. Example: https://github.com/UiPath/uipathcli-authenticator-k8s

type PluginConfigFileStore added in v1.0.57

type PluginConfigFileStore struct {
	// contains filtered or unexported fields
}

PluginConfigFileStore reads the plugin configuration file from disk

The store searches in the $HOME/.uipath for a file called 'plugin' to read the available authenticator plugins.

func NewPluginConfigFileStore added in v1.0.57

func NewPluginConfigFileStore(filePath string) *PluginConfigFileStore

func (PluginConfigFileStore) Read added in v1.0.57

func (s PluginConfigFileStore) Read() ([]byte, error)

type PluginConfigProvider added in v1.0.3

type PluginConfigProvider struct {
	// contains filtered or unexported fields
}

PluginConfigProvider parses the plugin configuration file.

func NewPluginConfigProvider added in v1.0.56

func NewPluginConfigProvider(store PluginConfigStore) *PluginConfigProvider

func (PluginConfigProvider) Config added in v1.0.17

func (cp PluginConfigProvider) Config() PluginConfig

func (*PluginConfigProvider) Load added in v1.0.17

func (cp *PluginConfigProvider) Load() error

type PluginConfigStore added in v1.0.17

type PluginConfigStore interface {
	Read() ([]byte, error)
}

PluginConfigStore is an abstraction for reading plugin configuration

Jump to

Keyboard shortcuts

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