config

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 37 Imported by: 40

Documentation

Index

Constants

View Source
const DefaultServerId = "Default-Server"

This is the default server id. It is used when adding a server config without providing a server ID

Variables

This section is empty.

Functions

func AccessTokenRefreshPreRequestInterceptor

func AccessTokenRefreshPreRequestInterceptor(fields *auth.CommonConfigFields, httpClientDetails *httputils.HttpClientDetails) (err error)

func CreateInitialRefreshableTokensIfNeeded

func CreateInitialRefreshableTokensIfNeeded(serverDetails *ServerDetails) (err error)

func Export

func Export(details *ServerDetails) (string, error)

func GetAndRemoveConfiguration

func GetAndRemoveConfiguration(serverName string, configs []*ServerDetails) (*ServerDetails, []*ServerDetails)

func GetJfrogDependenciesPath

func GetJfrogDependenciesPath() (string, error)

func IsBintrayConfExists

func IsBintrayConfExists() (bool, error)

func IsServerConfExists added in v1.4.0

func IsServerConfExists() (bool, error)

func SaveBintrayConf

func SaveBintrayConf(details *BintrayDetails) error

func SaveServersConf added in v1.4.0

func SaveServersConf(details []*ServerDetails) error

Types

type BintrayDetails

type BintrayDetails struct {
	ApiUrl            string `json:"-"`
	DownloadServerUrl string `json:"-"`
	User              string `json:"user,omitempty"`
	Key               string `json:"key,omitempty"`
	DefPackageLicense string `json:"defPackageLicense,omitempty"`
}

func ReadBintrayConf

func ReadBintrayConf() (*BintrayDetails, error)

type ConfigV0

type ConfigV0 struct {
	Artifactory    *ServerDetails         `json:"artifactory,omitempty"`
	Bintray        *BintrayDetails        `json:"bintray,omitempty"`
	MissionControl *MissionControlDetails `json:"MissionControl,omitempty"`
}

This struct was created before the version property was added to the config.

func (*ConfigV0) Convert

func (o *ConfigV0) Convert() *ConfigV4

type ConfigV4 added in v1.1.0

type ConfigV4 struct {
	Artifactory    []*ServerDetails       `json:"artifactory"`
	Bintray        *BintrayDetails        `json:"bintray,omitempty"`
	MissionControl *MissionControlDetails `json:"missionControl,omitempty"`
	Version        string                 `json:"version,omitempty"`
	Enc            bool                   `json:"enc,omitempty"`
}

This struct is suitable for versions 1, 2, 3 and 4.

func (*ConfigV4) Convert added in v1.4.0

func (o *ConfigV4) Convert() *ConfigV5

type ConfigV5 added in v1.4.0

type ConfigV5 struct {
	Servers []*ServerDetails `json:"servers"`
	Bintray *BintrayDetails  `json:"bintray,omitempty"`
	Version string           `json:"version,omitempty"`
	Enc     bool             `json:"enc,omitempty"`
}

type MissionControlDetails

type MissionControlDetails struct {
	Url         string `json:"url,omitempty"`
	AccessToken string `json:"accessToken,omitempty"`
}

Deprecated

func (*MissionControlDetails) GetAccessToken

func (missionControlDetails *MissionControlDetails) GetAccessToken() string

func (*MissionControlDetails) SetAccessToken

func (missionControlDetails *MissionControlDetails) SetAccessToken(accessToken string)

type SecurityConf

type SecurityConf struct {
	Version   string `yaml:"version,omitempty"`
	MasterKey string `yaml:"masterKey,omitempty"`
}

type ServerDetails added in v1.4.0

type ServerDetails struct {
	Url                  string `json:"url,omitempty"`
	SshUrl               string `json:"-"`
	ArtifactoryUrl       string `json:"artifactoryUrl,omitempty"`
	DistributionUrl      string `json:"distributionUrl,omitempty"`
	XrayUrl              string `json:"xrayUrl,omitempty"`
	MissionControlUrl    string `json:"missionControlUrl,omitempty"`
	PipelinesUrl         string `json:"pipelinesUrl,omitempty"`
	AccessUrl            string `json:"accessUrl,omitempty"`
	User                 string `json:"user,omitempty"`
	Password             string `json:"password,omitempty"`
	SshKeyPath           string `json:"sshKeyPath,omitempty"`
	SshPassphrase        string `json:"sshPassphrase,omitempty"`
	AccessToken          string `json:"accessToken,omitempty"`
	RefreshToken         string `json:"refreshToken,omitempty"`
	TokenRefreshInterval int    `json:"tokenRefreshInterval,omitempty"`
	ClientCertPath       string `json:"clientCertPath,omitempty"`
	ClientCertKeyPath    string `json:"clientCertKeyPath,omitempty"`
	ServerId             string `json:"serverId,omitempty"`
	IsDefault            bool   `json:"isDefault,omitempty"`
	InsecureTls          bool   `json:"-"`
	// Deprecated, use password option instead.
	ApiKey string `json:"apiKey,omitempty"`
}

func GetAllServersConfigs added in v1.4.0

func GetAllServersConfigs() ([]*ServerDetails, error)

func GetDefaultConfiguredConf added in v1.4.0

func GetDefaultConfiguredConf(configs []*ServerDetails) (*ServerDetails, error)

Returns the default server configuration or error if not found. Caller should perform the check error if required.

func GetDefaultServerConf added in v1.4.0

func GetDefaultServerConf() (*ServerDetails, error)

Returns default artifactory conf. Returns nil if default server doesn't exists.

func GetSpecificConfig added in v1.4.0

func GetSpecificConfig(serverId string, defaultOrEmpty bool, excludeRefreshableTokens bool) (*ServerDetails, error)

Returns the configured server or error if the server id was not found. If defaultOrEmpty: return empty details if no configurations found, or default conf for empty serverId. Exclude refreshable tokens when working with external tools (build tools, curl, etc) or when sending requests not via ArtifactoryHttpClient.

func Import

func Import(serverToken string) (*ServerDetails, error)

func (*ServerDetails) CreateAccessAuthConfig added in v1.10.0

func (serverDetails *ServerDetails) CreateAccessAuthConfig() (auth.ServiceDetails, error)

func (*ServerDetails) CreateArtAuthConfig added in v1.4.0

func (serverDetails *ServerDetails) CreateArtAuthConfig() (auth.ServiceDetails, error)

func (*ServerDetails) CreateDistAuthConfig added in v1.4.0

func (serverDetails *ServerDetails) CreateDistAuthConfig() (auth.ServiceDetails, error)

func (*ServerDetails) CreatePipelinesAuthConfig added in v1.5.0

func (serverDetails *ServerDetails) CreatePipelinesAuthConfig() (auth.ServiceDetails, error)

func (*ServerDetails) CreateXrayAuthConfig added in v1.4.0

func (serverDetails *ServerDetails) CreateXrayAuthConfig() (auth.ServiceDetails, error)

func (*ServerDetails) GetAccessToken added in v1.4.0

func (serverDetails *ServerDetails) GetAccessToken() string

func (*ServerDetails) GetAccessUrl added in v1.10.0

func (serverDetails *ServerDetails) GetAccessUrl() string

func (*ServerDetails) GetApiKey added in v1.4.0

func (serverDetails *ServerDetails) GetApiKey() string

func (*ServerDetails) GetArtifactoryUrl added in v1.4.0

func (serverDetails *ServerDetails) GetArtifactoryUrl() string

func (*ServerDetails) GetClientCertKeyPath added in v1.4.0

func (serverDetails *ServerDetails) GetClientCertKeyPath() string

func (*ServerDetails) GetClientCertPath added in v1.4.0

func (serverDetails *ServerDetails) GetClientCertPath() string

func (*ServerDetails) GetDistributionUrl added in v1.4.0

func (serverDetails *ServerDetails) GetDistributionUrl() string

func (*ServerDetails) GetMissionControlUrl added in v1.4.0

func (serverDetails *ServerDetails) GetMissionControlUrl() string

func (*ServerDetails) GetPassword added in v1.4.0

func (serverDetails *ServerDetails) GetPassword() string

func (*ServerDetails) GetPipelinesUrl added in v1.4.0

func (serverDetails *ServerDetails) GetPipelinesUrl() string

func (*ServerDetails) GetRefreshToken added in v1.4.0

func (serverDetails *ServerDetails) GetRefreshToken() string

func (*ServerDetails) GetUrl added in v1.4.0

func (serverDetails *ServerDetails) GetUrl() string

func (*ServerDetails) GetUser added in v1.4.0

func (serverDetails *ServerDetails) GetUser() string

func (*ServerDetails) GetXrayUrl added in v1.4.0

func (serverDetails *ServerDetails) GetXrayUrl() string

func (*ServerDetails) IsEmpty added in v1.4.0

func (serverDetails *ServerDetails) IsEmpty() bool

func (*ServerDetails) SetAccessToken added in v1.4.0

func (serverDetails *ServerDetails) SetAccessToken(accessToken string)

func (*ServerDetails) SetApiKey added in v1.4.0

func (serverDetails *ServerDetails) SetApiKey(apiKey string)

func (*ServerDetails) SetClientCertKeyPath added in v1.4.0

func (serverDetails *ServerDetails) SetClientCertKeyPath(certificatePath string)

func (*ServerDetails) SetClientCertPath added in v1.4.0

func (serverDetails *ServerDetails) SetClientCertPath(certificatePath string)

func (*ServerDetails) SetPassword added in v1.4.0

func (serverDetails *ServerDetails) SetPassword(password string)

func (*ServerDetails) SetRefreshToken added in v1.4.0

func (serverDetails *ServerDetails) SetRefreshToken(refreshToken string)

func (*ServerDetails) SetSshPassphrase added in v1.9.0

func (serverDetails *ServerDetails) SetSshPassphrase(sshPassphrase string)

func (*ServerDetails) SetUser added in v1.4.0

func (serverDetails *ServerDetails) SetUser(username string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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