Documentation ¶
Index ¶
- Constants
- func AccessTokenRefreshPreRequestInterceptor(fields *auth.CommonConfigFields, ...) (err error)
- func ArtifactoryTokenRefreshPreRequestInterceptor(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 IsServerConfExists() (bool, error)
- func SaveServersConf(details []*ServerDetails) error
- type Config
- type ConfigV0
- type ConfigV4
- type ConfigV5
- type ConfigV6
- 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(configTokenString 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) CreateLifecycleAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreatePipelinesAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreateXrayAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) CreateXscAuthConfig() (auth.ServiceDetails, error)
- func (serverDetails *ServerDetails) GetAccessToken() string
- func (serverDetails *ServerDetails) GetAccessUrl() string
- func (serverDetails *ServerDetails) GetArtifactoryUrl() string
- func (serverDetails *ServerDetails) GetAuthenticationCredentials() (string, string, error)
- func (serverDetails *ServerDetails) GetClientCertKeyPath() string
- func (serverDetails *ServerDetails) GetClientCertPath() string
- func (serverDetails *ServerDetails) GetDistributionUrl() string
- func (serverDetails *ServerDetails) GetLifecycleUrl() 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) SetArtifactoryRefreshToken(refreshToken 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)
- type TokenType
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 ArtifactoryTokenRefreshPreRequestInterceptor ¶ added in v2.14.0
func ArtifactoryTokenRefreshPreRequestInterceptor(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 IsServerConfExists ¶
func SaveServersConf ¶
func SaveServersConf(details []*ServerDetails) error
Types ¶
type Config ¶ added in v2.14.0
type Config struct {
ConfigV6
}
Config represents the CLI latest config version.
type ConfigV0 ¶
type ConfigV0 struct { Artifactory *ServerDetails `json:"artifactory,omitempty"` MissionControl *MissionControlDetails `json:"MissionControl,omitempty"` }
This struct was created before the version property was added to the config.
type ConfigV4 ¶
type ConfigV4 struct { Artifactory []*ServerDetails `json:"artifactory"` 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 ¶
type ConfigV5 struct { Servers []*ServerDetails `json:"servers"` 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 ¶
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"` XscUrl string `json:"xscUrl,omitempty"` MissionControlUrl string `json:"missionControlUrl,omitempty"` PipelinesUrl string `json:"pipelinesUrl,omitempty"` AccessUrl string `json:"accessUrl,omitempty"` LifecycleUrl string `json:"-"` 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"` ArtifactoryRefreshToken string `json:"artifactoryRefreshToken,omitempty"` ArtifactoryTokenRefreshInterval 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:"-"` WebLogin bool `json:"webLogin,omitempty"` }
func GetAllServersConfigs ¶
func GetAllServersConfigs() ([]*ServerDetails, error)
func GetDefaultConfiguredConf ¶
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 ¶
func GetDefaultServerConf() (*ServerDetails, error)
Returns default artifactory conf. Returns nil if default server doesn't exists.
func GetSpecificConfig ¶
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(configTokenString string) (*ServerDetails, error)
func (*ServerDetails) CreateAccessAuthConfig ¶ added in v2.2.0
func (serverDetails *ServerDetails) CreateAccessAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreateArtAuthConfig ¶
func (serverDetails *ServerDetails) CreateArtAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreateDistAuthConfig ¶
func (serverDetails *ServerDetails) CreateDistAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreateLifecycleAuthConfig ¶ added in v2.37.0
func (serverDetails *ServerDetails) CreateLifecycleAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreatePipelinesAuthConfig ¶
func (serverDetails *ServerDetails) CreatePipelinesAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreateXrayAuthConfig ¶
func (serverDetails *ServerDetails) CreateXrayAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) CreateXscAuthConfig ¶ added in v2.51.0
func (serverDetails *ServerDetails) CreateXscAuthConfig() (auth.ServiceDetails, error)
func (*ServerDetails) GetAccessToken ¶
func (serverDetails *ServerDetails) GetAccessToken() string
func (*ServerDetails) GetAccessUrl ¶ added in v2.2.0
func (serverDetails *ServerDetails) GetAccessUrl() string
func (*ServerDetails) GetArtifactoryUrl ¶
func (serverDetails *ServerDetails) GetArtifactoryUrl() string
func (*ServerDetails) GetAuthenticationCredentials ¶ added in v2.47.0
func (serverDetails *ServerDetails) GetAuthenticationCredentials() (string, string, error)
GetAuthenticationCredentials retrieves authentication credentials for the serverDetails instance. If both a username and password are provided, they are returned. If only an access token is provided, the function extracts the username from the access token, and both the username and access token are returned.
Returns: - Username and password if both are provided. - Username extracted from the access token, along with the access token, if the access token is provided. - An error if neither username/password nor access token is provided, with details about the missing credentials.
func (*ServerDetails) GetClientCertKeyPath ¶
func (serverDetails *ServerDetails) GetClientCertKeyPath() string
func (*ServerDetails) GetClientCertPath ¶
func (serverDetails *ServerDetails) GetClientCertPath() string
func (*ServerDetails) GetDistributionUrl ¶
func (serverDetails *ServerDetails) GetDistributionUrl() string
func (*ServerDetails) GetLifecycleUrl ¶ added in v2.37.0
func (serverDetails *ServerDetails) GetLifecycleUrl() string
func (*ServerDetails) GetMissionControlUrl ¶
func (serverDetails *ServerDetails) GetMissionControlUrl() string
func (*ServerDetails) GetPassword ¶
func (serverDetails *ServerDetails) GetPassword() string
func (*ServerDetails) GetPipelinesUrl ¶
func (serverDetails *ServerDetails) GetPipelinesUrl() string
func (*ServerDetails) GetRefreshToken ¶
func (serverDetails *ServerDetails) GetRefreshToken() string
func (*ServerDetails) GetUrl ¶
func (serverDetails *ServerDetails) GetUrl() string
func (*ServerDetails) GetUser ¶
func (serverDetails *ServerDetails) GetUser() string
func (*ServerDetails) GetXrayUrl ¶
func (serverDetails *ServerDetails) GetXrayUrl() string
func (*ServerDetails) IsEmpty ¶
func (serverDetails *ServerDetails) IsEmpty() bool
func (*ServerDetails) SetAccessToken ¶
func (serverDetails *ServerDetails) SetAccessToken(accessToken string)
func (*ServerDetails) SetArtifactoryRefreshToken ¶ added in v2.14.0
func (serverDetails *ServerDetails) SetArtifactoryRefreshToken(refreshToken string)
func (*ServerDetails) SetClientCertKeyPath ¶
func (serverDetails *ServerDetails) SetClientCertKeyPath(certificatePath string)
func (*ServerDetails) SetClientCertPath ¶
func (serverDetails *ServerDetails) SetClientCertPath(certificatePath string)
func (*ServerDetails) SetPassword ¶
func (serverDetails *ServerDetails) SetPassword(password string)
func (*ServerDetails) SetRefreshToken ¶
func (serverDetails *ServerDetails) SetRefreshToken(refreshToken string)
func (*ServerDetails) SetSshPassphrase ¶ added in v2.2.0
func (serverDetails *ServerDetails) SetSshPassphrase(sshPassphrase string)
func (*ServerDetails) SetUser ¶
func (serverDetails *ServerDetails) SetUser(username string)