Interface GitConfigurationProvider
- All Known Implementing Classes:
GitConfigurationProviderImpl
@PublicApi
public interface GitConfigurationProvider
API for providing repository git plugin's specific configuration based on repository data
coming from any repository plugin (Bitbucket, Github, etc.).
- Since:
- 10.1
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Constants used acrossGitConfigurationProvider
and Git dependent plugins. -
Method Summary
Modifier and TypeMethodDescription@NotNull GitCacheKey
getCacheKey
(@NotNull VcsRepositoryData vcsRepositoryData) Constructs a git cache key based on the provided VCS repository data.@NotNull GitCredentialsBag
getCredentialsBag
(@NotNull VcsRepositoryData vcsRepositoryData) Retrieves the git credentials bag from the provided VCS repository data.@NotNull String
getRepositoryUrl
(@NotNull VcsRepositoryData vcsRepositoryData) Retrieves the repository URL from the provided VCS repository data.static @NotNull String
getSharedCredentialsIdField
(@NotNull Map<String, String> config) Gets the shared credentials ID field to look up based on the provided configuration.@NotNull String
getSubstitutedRepositoryUrl
(@NotNull VcsRepositoryData vcsRepositoryData) Retrieves the repository URL from the provided VCS repository data, with variables substituted.static boolean
isUsingSharedCredentials
(@NotNull Map<String, String> serverCfg) Determines if the repository with the provided server configuration uses shared credentials.@NotNull GitCredentialsBag
substituteCredentialsBag
(@NotNull GitCredentialsBag gitCredentialsBag) Substitutes the git credentials bag with variable context and returns a new immutable object.
-
Method Details
-
getRepositoryUrl
Retrieves the repository URL from the provided VCS repository data.- Parameters:
vcsRepositoryData
- the VCS repository data- Returns:
- the repository URL
-
getSubstitutedRepositoryUrl
@NotNull @NotNull String getSubstitutedRepositoryUrl(@NotNull @NotNull VcsRepositoryData vcsRepositoryData) Retrieves the repository URL from the provided VCS repository data, with variables substituted.- Parameters:
vcsRepositoryData
- the VCS repository data- Returns:
- the substituted repository URL
-
getCredentialsBag
@NotNull @NotNull GitCredentialsBag getCredentialsBag(@NotNull @NotNull VcsRepositoryData vcsRepositoryData) Retrieves the git credentials bag from the provided VCS repository data.- Parameters:
vcsRepositoryData
- the VCS repository data- Returns:
- the Git credentials bag
-
substituteCredentialsBag
@NotNull @NotNull GitCredentialsBag substituteCredentialsBag(@NotNull @NotNull GitCredentialsBag gitCredentialsBag) Substitutes the git credentials bag with variable context and returns a new immutable object. The provided credentials bag is not modified; a new object is returned.- Parameters:
gitCredentialsBag
- the credentials bag to transform- Returns:
- the substituted Git credentials bag
-
getCacheKey
Constructs a git cache key based on the provided VCS repository data. A git cache is an on-disk clone of a git repository.- Parameters:
vcsRepositoryData
- the VCS repository data- Returns:
- the git cache key