Class OAuthConnectionDescriptor
- java.lang.Object
-
- jetbrains.buildServer.serverSide.oauth.OAuthConnectionDescriptor
-
- All Implemented Interfaces:
Loggable
,ConnectionDescriptor
,ParametersDescriptor
,SProjectFeatureDescriptor
public class OAuthConnectionDescriptor extends Object implements ConnectionDescriptor, Loggable
Describes a specific OAuth connection.
-
-
Constructor Summary
Constructors Constructor Description OAuthConnectionDescriptor(SProject connectionOwner, SProjectFeatureDescriptor projectFeatureDescriptor, ExtensionHolder extensionHolder)
-
Method Summary
-
-
-
Constructor Detail
-
OAuthConnectionDescriptor
public OAuthConnectionDescriptor(@NotNull SProject connectionOwner, @NotNull SProjectFeatureDescriptor projectFeatureDescriptor, @NotNull ExtensionHolder extensionHolder)
-
-
Method Detail
-
getId
@NotNull public String getId()
Description copied from interface:ParametersDescriptor
Returns unique id of this descriptor- Specified by:
getId
in interfaceParametersDescriptor
- Specified by:
getId
in interfaceSProjectFeatureDescriptor
- Returns:
- unique connection id
-
getProjectId
@NotNull public String getProjectId()
- Specified by:
getProjectId
in interfaceSProjectFeatureDescriptor
- Returns:
- internal id of project holding this feature
-
getType
@NotNull public String getType()
Description copied from interface:ParametersDescriptor
Returns type of the parameters- Specified by:
getType
in interfaceParametersDescriptor
- Returns:
- parameters type
-
getProviderType
@Nullable public String getProviderType()
-
getTokenStorageId
@NotNull public String getTokenStorageId()
-
getConnectionDisplayName
@NotNull public String getConnectionDisplayName()
- Returns:
- connection display name
-
getDisplayName
@NotNull public String getDisplayName()
- Specified by:
getDisplayName
in interfaceConnectionDescriptor
- Returns:
- connection display name
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:ParametersDescriptor
Returns parameters map.- Specified by:
getParameters
in interfaceParametersDescriptor
- Returns:
- connection parameters
-
getOauthProvider
@NotNull @Deprecated public OAuthProvider getOauthProvider()
Deprecated.- Returns:
- OAuth provider which supports this type of OAuth connection
-
getConnectionProvider
@NotNull public ConnectionProvider getConnectionProvider()
- Specified by:
getConnectionProvider
in interfaceConnectionDescriptor
- Returns:
- OAuth provider which supports this type of OAuth connection
-
getDescription
@NotNull public String getDescription()
- Returns:
- human friendly description of connection parameters
-
getDescriptionForUI
@NotNull public String getDescriptionForUI()
- Returns:
- description of the connection parameters for ui. Will be combined with the return value of getAdditionalDescription
- Since:
- 2023.11
-
getAdditionalDescription
@NotNull public String getAdditionalDescription()
- Returns:
- additional description for the ui that won't be escaped(can include html)
-
getProject
@NotNull public SProject getProject()
- Returns:
- project this OAuth connection belongs to
-
isTransientConnection
public boolean isTransientConnection()
-
hasCapability
public boolean hasCapability(@NotNull ConnectionCapability capability)
-
hasCapabilities
public boolean hasCapabilities(@NotNull Set<ConnectionCapability> requiredCapabilities)
-
describe
@NotNull public String describe(boolean verbose)
-
isHidden
public boolean isHidden()
-
isAcquiringTokenSupported
public boolean isAcquiringTokenSupported()
-
getScopeForIntent
@Nullable public String getScopeForIntent(@NotNull TokenIntent intent)
Returns a specific OAuth scope to request for the given token intent, if needed. Both this connection and the token intent are taken into account.- Parameters:
intent
- the intended token usage- Returns:
- specific OAuth scope, if any
- Since:
- 2024.03
-
isUseUniqueRedirect
public boolean isUseUniqueRedirect()
Determines whether this connection is configured to use a unique redirect URL. Defaults to false.- Returns:
- true if unique redirect URL must be used, false otherwise
- Since:
- 2024.07
-
getTokenUsageParamsForVcsRoot
@NotNull public Map<String,String> getTokenUsageParamsForVcsRoot(@NotNull OAuthToken token)
Returns the necessary parameters for usage of the provided token for authentication in aSVcsRoot
.- Parameters:
token
- the token to be potentially used on a VCS root- Returns:
- mutable map of parameters
- Since:
- 2024.07
- See Also:
OAuthProvider.getTokenUsageParamsForVcsRoot(OAuthConnectionDescriptor, OAuthToken)
-
-