Documentation ¶
Index ¶
- Constants
- func AccessTokenRefreshPreRequestInterceptor(fields *auth.CommonConfigFields, ...) (err error)
- func CreateInitialRefreshableTokensIfNeeded(serverDetails *ServerDetails) (err error)
- func Export(details *ServerDetails) (string, error)
- func GetAndRemoveConfiguration(serverName string, configs []*ServerDetails) (*ServerDetails, []*ServerDetails)
- func GetJfrogDependenciesPath() (string, error)
- func IsBintrayConfExists() (bool, error)
- func IsServerConfExists() (bool, error)
- func SaveBintrayConf(details *BintrayDetails) error
- func SaveServersConf(details []*ServerDetails) error
- type BintrayDetails
- type ConfigV0
- type ConfigV4
- type ConfigV5
- type MissionControlDetails
- type SecurityConf
- type ServerDetails
- func GetAllServersConfigs() ([]*ServerDetails, error)
- func GetDefaultConfiguredConf(configs []*ServerDetails) (*ServerDetails, error)
- func GetDefaultServerConf() (*ServerDetails, error)
- func GetSpecificConfig(serverId string, defaultOrEmpty bool, excludeRefreshableTokens bool) (*ServerDetails, error)
- func Import(serverToken string) (*ServerDetails, error)
- func (serverDetails *ServerDetails) CreateAccessAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreateArtAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreateDistAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreatePipelinesAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreateXrayAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) GetAccessToken() string
- func (serverDetails *ServerDetails) GetAccessUrl() string
- func (serverDetails *ServerDetails) GetApiKey() string
- func (serverDetails *ServerDetails) GetArtifactoryUrl() string
- func (serverDetails *ServerDetails) GetClientCertKeyPath() string
- func (serverDetails *ServerDetails) GetClientCertPath() string
- func (serverDetails *ServerDetails) GetDistributionUrl() string
- func (serverDetails *ServerDetails) GetMissionControlUrl() string
- func (serverDetails *ServerDetails) GetPassword() string
- func (serverDetails *ServerDetails) GetPipelinesUrl() string
- func (serverDetails *ServerDetails) GetRefreshToken() string
- func (serverDetails *ServerDetails) GetUrl() string
- func (serverDetails *ServerDetails) GetUser() string
- func (serverDetails *ServerDetails) GetXrayUrl() string
- func (serverDetails *ServerDetails) IsEmpty() bool
- func (serverDetails *ServerDetails) SetAccessToken(accessToken string)
- func (serverDetails *ServerDetails) SetApiKey(apiKey string)
- func (serverDetails *ServerDetails) SetClientCertKeyPath(certificatePath string)
- func (serverDetails *ServerDetails) SetClientCertPath(certificatePath string)
- func (serverDetails *ServerDetails) SetPassword(password string)
- func (serverDetails *ServerDetails) SetRefreshToken(refreshToken string)
- func (serverDetails *ServerDetails) SetSshPassphrase(sshPassphrase string)
- func (serverDetails *ServerDetails) SetUser(username string)
Constants ¶
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 IsBintrayConfExists ¶
func IsServerConfExists ¶ added in v1.4.0
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.
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.
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 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)