Documentation ¶
Index ¶
- Constants
- func AccessTokenRefreshPreRequestInterceptor(fields *auth.CommonConfigFields, ...) (err error)
- func CreateInitialRefreshableTokensIfNeeded(artifactoryDetails *ArtifactoryDetails) (err error)
- func Export(details *ArtifactoryDetails) (string, error)
- func GetAndRemoveConfiguration(serverName string, configs []*ArtifactoryDetails) (*ArtifactoryDetails, []*ArtifactoryDetails)
- func GetJfrogDependenciesPath() (string, error)
- func IsArtifactoryConfExists() (bool, error)
- func IsBintrayConfExists() (bool, error)
- func IsMissionControlConfExists() (bool, error)
- func SaveArtifactoryConf(details []*ArtifactoryDetails) error
- func SaveBintrayConf(details *BintrayDetails) error
- func SaveMissionControlConf(details *MissionControlDetails) error
- type ArtifactoryDetails
- func GetAllArtifactoryConfigs() ([]*ArtifactoryDetails, error)
- func GetArtifactorySpecificConfig(serverId string, defaultOrEmpty bool, excludeRefreshableTokens bool) (*ArtifactoryDetails, error)
- func GetDefaultArtifactoryConf() (*ArtifactoryDetails, error)
- func GetDefaultConfiguredArtifactoryConf(configs []*ArtifactoryDetails) (*ArtifactoryDetails, error)
- func Import(serverToken string) (*ArtifactoryDetails, error)
- func (artifactoryDetails *ArtifactoryDetails) CreateArtAuthConfig() (auth.ServiceDetails, error)
- func (artifactoryDetails *ArtifactoryDetails) CreateDistAuthConfig() (auth.ServiceDetails, error)
- func (artifactoryDetails *ArtifactoryDetails) GetAccessToken() string
- func (artifactoryDetails *ArtifactoryDetails) GetApiKey() string
- func (artifactoryDetails *ArtifactoryDetails) GetClientCertKeyPath() string
- func (artifactoryDetails *ArtifactoryDetails) GetClientCertPath() string
- func (artifactoryDetails *ArtifactoryDetails) GetDistributionUrl() string
- func (artifactoryDetails *ArtifactoryDetails) GetPassword() string
- func (artifactoryDetails *ArtifactoryDetails) GetRefreshToken() string
- func (artifactoryDetails *ArtifactoryDetails) GetUrl() string
- func (artifactoryDetails *ArtifactoryDetails) GetUser() string
- func (artifactoryDetails *ArtifactoryDetails) IsEmpty() bool
- func (artifactoryDetails *ArtifactoryDetails) SetAccessToken(accessToken string)
- func (artifactoryDetails *ArtifactoryDetails) SetApiKey(apiKey string)
- func (artifactoryDetails *ArtifactoryDetails) SetClientCertKeyPath(certificatePath string)
- func (artifactoryDetails *ArtifactoryDetails) SetClientCertPath(certificatePath string)
- func (artifactoryDetails *ArtifactoryDetails) SetPassword(password string)
- func (artifactoryDetails *ArtifactoryDetails) SetRefreshToken(refreshToken string)
- func (artifactoryDetails *ArtifactoryDetails) SetUser(username string)
- type BintrayDetails
- type ConfigV0
- type ConfigV4
- type MissionControlDetails
- type SecurityConf
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(artifactoryDetails *ArtifactoryDetails) (err error)
func Export ¶
func Export(details *ArtifactoryDetails) (string, error)
func GetAndRemoveConfiguration ¶
func GetAndRemoveConfiguration(serverName string, configs []*ArtifactoryDetails) (*ArtifactoryDetails, []*ArtifactoryDetails)
func IsArtifactoryConfExists ¶
func IsBintrayConfExists ¶
func SaveArtifactoryConf ¶
func SaveArtifactoryConf(details []*ArtifactoryDetails) error
func SaveBintrayConf ¶
func SaveBintrayConf(details *BintrayDetails) error
func SaveMissionControlConf ¶
func SaveMissionControlConf(details *MissionControlDetails) error
Types ¶
type ArtifactoryDetails ¶
type ArtifactoryDetails struct { Url string `json:"url,omitempty"` SshUrl string `json:"-"` DistributionUrl string `json:"distributionUrl,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 GetAllArtifactoryConfigs ¶
func GetAllArtifactoryConfigs() ([]*ArtifactoryDetails, error)
func GetArtifactorySpecificConfig ¶
func GetArtifactorySpecificConfig(serverId string, defaultOrEmpty bool, excludeRefreshableTokens bool) (*ArtifactoryDetails, 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 GetDefaultArtifactoryConf ¶
func GetDefaultArtifactoryConf() (*ArtifactoryDetails, error)
Returns default artifactory conf. Returns nil if default server doesn't exists.
func GetDefaultConfiguredArtifactoryConf ¶
func GetDefaultConfiguredArtifactoryConf(configs []*ArtifactoryDetails) (*ArtifactoryDetails, error)
Returns the default server configuration or error if not found. Caller should perform the check error if required.
func Import ¶
func Import(serverToken string) (*ArtifactoryDetails, error)
func (*ArtifactoryDetails) CreateArtAuthConfig ¶
func (artifactoryDetails *ArtifactoryDetails) CreateArtAuthConfig() (auth.ServiceDetails, error)
func (*ArtifactoryDetails) CreateDistAuthConfig ¶
func (artifactoryDetails *ArtifactoryDetails) CreateDistAuthConfig() (auth.ServiceDetails, error)
func (*ArtifactoryDetails) GetAccessToken ¶
func (artifactoryDetails *ArtifactoryDetails) GetAccessToken() string
func (*ArtifactoryDetails) GetApiKey ¶
func (artifactoryDetails *ArtifactoryDetails) GetApiKey() string
func (*ArtifactoryDetails) GetClientCertKeyPath ¶
func (artifactoryDetails *ArtifactoryDetails) GetClientCertKeyPath() string
func (*ArtifactoryDetails) GetClientCertPath ¶
func (artifactoryDetails *ArtifactoryDetails) GetClientCertPath() string
func (*ArtifactoryDetails) GetDistributionUrl ¶
func (artifactoryDetails *ArtifactoryDetails) GetDistributionUrl() string
func (*ArtifactoryDetails) GetPassword ¶
func (artifactoryDetails *ArtifactoryDetails) GetPassword() string
func (*ArtifactoryDetails) GetRefreshToken ¶
func (artifactoryDetails *ArtifactoryDetails) GetRefreshToken() string
func (*ArtifactoryDetails) GetUrl ¶
func (artifactoryDetails *ArtifactoryDetails) GetUrl() string
func (*ArtifactoryDetails) GetUser ¶
func (artifactoryDetails *ArtifactoryDetails) GetUser() string
func (*ArtifactoryDetails) IsEmpty ¶
func (artifactoryDetails *ArtifactoryDetails) IsEmpty() bool
func (*ArtifactoryDetails) SetAccessToken ¶
func (artifactoryDetails *ArtifactoryDetails) SetAccessToken(accessToken string)
func (*ArtifactoryDetails) SetApiKey ¶
func (artifactoryDetails *ArtifactoryDetails) SetApiKey(apiKey string)
func (*ArtifactoryDetails) SetClientCertKeyPath ¶
func (artifactoryDetails *ArtifactoryDetails) SetClientCertKeyPath(certificatePath string)
func (*ArtifactoryDetails) SetClientCertPath ¶
func (artifactoryDetails *ArtifactoryDetails) SetClientCertPath(certificatePath string)
func (*ArtifactoryDetails) SetPassword ¶
func (artifactoryDetails *ArtifactoryDetails) SetPassword(password string)
func (*ArtifactoryDetails) SetRefreshToken ¶
func (artifactoryDetails *ArtifactoryDetails) SetRefreshToken(refreshToken string)
func (*ArtifactoryDetails) SetUser ¶
func (artifactoryDetails *ArtifactoryDetails) SetUser(username string)
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 *ArtifactoryDetails `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 []*ArtifactoryDetails `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 MissionControlDetails ¶
type MissionControlDetails struct { Url string `json:"url,omitempty"` AccessToken string `json:"accessToken,omitempty"` }
func ReadMissionControlConf ¶
func ReadMissionControlConf() (*MissionControlDetails, error)
func (*MissionControlDetails) GetAccessToken ¶
func (missionControlDetails *MissionControlDetails) GetAccessToken() string
func (*MissionControlDetails) SetAccessToken ¶
func (missionControlDetails *MissionControlDetails) SetAccessToken(accessToken string)