Class SpaceOAuthProvider
- java.lang.Object
 - 
- jetbrains.buildServer.serverSide.oauth.OAuthProvider
 - 
- jetbrains.buildServer.serverSide.oauth.space.SpaceOAuthProvider
 
 
 
- 
- All Implemented Interfaces:
 ConnectionProvider,ServerExtension,TeamCityExtension
public class SpaceOAuthProvider extends OAuthProvider
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.oauth.OAuthProvider
OAuthProvider.CapabilityResolver 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description static StringTYPEstatic StringURL_TYPE- 
Fields inherited from class jetbrains.buildServer.serverSide.oauth.OAuthProvider
COMPOUND_STORAGE_ID_PREFIX, myCapabilityResolvers, NOPE 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SpaceOAuthProvider(WebLinks webLinks, SpaceClientFactory clientFactory, ApplicationInformationCapabilityResolver appInfoCapabilityResolver) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconnectionIsHidden(OAuthConnectionDescriptor connection)StringdescribeConnection(OAuthConnectionDescriptor connection)StringdescribeConnectionForUI(OAuthConnectionDescriptor connection)Will be combined with getAdditionalUIConnectionDescription return valueStringgetAdditionalUIConnectionDescription(OAuthConnectionDescriptor connection)Will not be escaped, and so should not include any unvalidated user inputStringgetCapabilitiesUrl()Get the URL to rendering the dynamic description of a connection's capabilities.Map<String,String>getDefaultProperties()StringgetDisplayName()StringgetEditParametersUrl()StringgetFallbackRedirectPath()Returns the path to be included in redirect URLs.PropertiesProcessorgetPropertiesProcessor()StringgetProviderTypeForUniqueRedirect()Returns the provider type to be included in unique redirect URLs.StringgetScopeForIntent(OAuthConnectionDescriptor connection, TokenIntent intent)Returns the provider-specific OAuth scope to request for the given token intent.Set<TokenIntentType>getSupportedTokenIntentTypes()Gets the token intent types this provider fully supports.StringgetTokenPopupPath()StringgetTokenStorageId(OAuthConnectionDescriptor connection)Returns an id of the token storage used by connection.Set<String>getTokenStorageParameters()Returns the parameters used when constructing the token storage ID for connections of this provider type.Map<String,String>getTokenUsageParamsForVcsRoot(OAuthConnectionDescriptor connection, OAuthToken token)Returns the necessary parameters for usage of the provided token for authentication in aSVcsRoot.StringgetType()StringgetTypeForUrl()booleanisAcquiringTokenSupported()Whether acquiring tokens is supported for this provider.booleanisCapabilitiesEnabledForProject(SProject project)Whether capabilities (if supported) are enabled in the scope of the given project.booleanisCapabilitiesSupported()Whether this provider supports resolving ofConnectionCapabilityfor individual connections.booleanisSuitableToken(OAuthToken token, TokenIntent intent)booleanisTokenRefreshSupported()booleanisUniqueRedirectsSupported()Whether this provider supports the creation of unique redirect URLs.protected StringredirectUri(OAuthConnectionDescriptor connectionDescriptor)OAuthTokenrefreshToken(OAuthConnectionDescriptor connection, OAuthToken token)- 
Methods inherited from class jetbrains.buildServer.serverSide.oauth.OAuthProvider
applyAccessibleEntities, buildCompoundTokenStorageId, connectionHasCapability, getAccessibleEntitiesEndpoint, getCapabilityResolver, getScope, isAccessibleEntitiesSupported, isAcquiringTokenSupportedForConnection, isAvailable, registerCapabilityResolver, testConnection 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface jetbrains.buildServer.serverSide.connections.ConnectionProvider
describeConnection, getDisplayOrderRank 
 - 
 
 - 
 
- 
- 
Field Detail
- 
TYPE
public static final String TYPE
- See Also:
 - Constant Field Values
 
 
- 
URL_TYPE
public static final String URL_TYPE
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
SpaceOAuthProvider
public SpaceOAuthProvider(@NotNull WebLinks webLinks, @NotNull SpaceClientFactory clientFactory, @NotNull ApplicationInformationCapabilityResolver appInfoCapabilityResolver) 
 - 
 
- 
Method Detail
- 
getType
@NotNull public String getType()
- Returns:
 - String used to identify the Connection Provider type. All Connection features store this property in parameters.
 
 
- 
getTypeForUrl
public String getTypeForUrl()
 
- 
getDisplayName
@NotNull public String getDisplayName()
- Returns:
 - human friendly provider name
 
 
- 
describeConnection
@NotNull public String describeConnection(@NotNull OAuthConnectionDescriptor connection)
- Overrides:
 describeConnectionin classOAuthProvider- Returns:
 - human friendly description of OAuth connection
 
 
- 
describeConnectionForUI
@NotNull public String describeConnectionForUI(@NotNull OAuthConnectionDescriptor connection)
Description copied from class:OAuthProviderWill be combined with getAdditionalUIConnectionDescription return value- Overrides:
 describeConnectionForUIin classOAuthProvider- Returns:
 - Description of OAuth connection for ui
 
 
- 
getAdditionalUIConnectionDescription
@NotNull public String getAdditionalUIConnectionDescription(@NotNull OAuthConnectionDescriptor connection)
Description copied from class:OAuthProviderWill not be escaped, and so should not include any unvalidated user input- Overrides:
 getAdditionalUIConnectionDescriptionin classOAuthProvider- Returns:
 - Additional description for ui
 
 
- 
getTokenStorageId
@NotNull public String getTokenStorageId(@NotNull OAuthConnectionDescriptor connection)
Description copied from class:OAuthProviderReturns an id of the token storage used by connection. Depending on the connection type multiple connections can use the same token storage. In case of OAuth2 apps, this id may be based on the client/application id of the OAuth2 app configured in a third party system.- Overrides:
 getTokenStorageIdin classOAuthProvider- Parameters:
 connection- descriptor- Returns:
 - token storage id
 
 
- 
getPropertiesProcessor
@Nullable public PropertiesProcessor getPropertiesProcessor()
- Specified by:
 getPropertiesProcessorin interfaceConnectionProvider- Overrides:
 getPropertiesProcessorin classOAuthProvider- Returns:
 - processor for connection provider parameters. Properties processor performs validation function and is called when connection is edited or created.
 
 
- 
getEditParametersUrl
@Nullable public String getEditParametersUrl()
- Specified by:
 getEditParametersUrlin interfaceConnectionProvider- Overrides:
 getEditParametersUrlin classOAuthProvider- Returns:
 - URL to edit connection parameters page
 
 
- 
getDefaultProperties
@Nullable public Map<String,String> getDefaultProperties()
- Specified by:
 getDefaultPropertiesin interfaceConnectionProvider- Overrides:
 getDefaultPropertiesin classOAuthProvider- Returns:
 - all default parameters related to this ConnectionProvider. Defaults for all possible parameter names.
 
 
- 
isTokenRefreshSupported
public boolean isTokenRefreshSupported()
- Overrides:
 isTokenRefreshSupportedin classOAuthProvider
 
- 
refreshToken
@NotNull public OAuthToken refreshToken(@NotNull OAuthConnectionDescriptor connection, @NotNull OAuthToken token)
- Overrides:
 refreshTokenin classOAuthProvider
 
- 
redirectUri
@NotNull protected String redirectUri(@NotNull OAuthConnectionDescriptor connectionDescriptor)
 
- 
isSuitableToken
public boolean isSuitableToken(@NotNull OAuthToken token, @NotNull TokenIntent intent)- Overrides:
 isSuitableTokenin classOAuthProvider
 
- 
getScopeForIntent
@Nullable public String getScopeForIntent(@NotNull OAuthConnectionDescriptor connection, @NotNull TokenIntent intent)
Description copied from class:OAuthProviderReturns the provider-specific OAuth scope to request for the given token intent.- Overrides:
 getScopeForIntentin classOAuthProvider- Parameters:
 connection- the connection to be used for issuing the tokenintent- the intended token usage- Returns:
 - specific OAuth scope, if any
 
 
- 
isAcquiringTokenSupported
public boolean isAcquiringTokenSupported()
Description copied from class:OAuthProviderWhether acquiring tokens is supported for this provider. See also: JSP Tag oauth:obtainToken- Overrides:
 isAcquiringTokenSupportedin classOAuthProvider- Returns:
 - true, if supported
 
 
- 
getTokenPopupPath
public String getTokenPopupPath()
- Overrides:
 getTokenPopupPathin classOAuthProvider
 
- 
isCapabilitiesSupported
public boolean isCapabilitiesSupported()
Description copied from class:OAuthProviderWhether this provider supports resolving ofConnectionCapabilityfor individual connections.- Overrides:
 isCapabilitiesSupportedin classOAuthProvider- Returns:
 - true if supported
 
 
- 
isCapabilitiesEnabledForProject
public boolean isCapabilitiesEnabledForProject(@NotNull SProject project)Description copied from class:OAuthProviderWhether capabilities (if supported) are enabled in the scope of the given project.- Overrides:
 isCapabilitiesEnabledForProjectin classOAuthProvider- Parameters:
 project- project scope- Returns:
 - true if enabled
 
 
- 
getCapabilitiesUrl
@Nullable public String getCapabilitiesUrl()
Description copied from class:OAuthProviderGet the URL to rendering the dynamic description of a connection's capabilities. Can only be used if capabilities are supported by this provider.- Overrides:
 getCapabilitiesUrlin classOAuthProvider- Returns:
 - relative URL or null if not supported
 
 
- 
connectionIsHidden
public boolean connectionIsHidden(@NotNull OAuthConnectionDescriptor connection)- Overrides:
 connectionIsHiddenin classOAuthProvider
 
- 
isUniqueRedirectsSupported
public boolean isUniqueRedirectsSupported()
Description copied from class:OAuthProviderWhether this provider supports the creation of unique redirect URLs. Providers wanting to support this feature should return true here and ensure that the respective access token controllers are registered viaBaseAccessTokenController.registerController(WebControllerManager, String). Also, the two related methodsOAuthProvider.getProviderTypeForUniqueRedirect()andOAuthProvider.getFallbackRedirectPath()must be implemented.- Overrides:
 isUniqueRedirectsSupportedin classOAuthProvider- Returns:
 - false, by default
 
 
- 
getProviderTypeForUniqueRedirect
@NotNull public String getProviderTypeForUniqueRedirect()
Description copied from class:OAuthProviderReturns the provider type to be included in unique redirect URLs.- Overrides:
 getProviderTypeForUniqueRedirectin classOAuthProvider- Returns:
 - URL-compatible provider type
 - See Also:
 OAuthProvider.isUniqueRedirectsSupported()
 
- 
getFallbackRedirectPath
@Nullable public String getFallbackRedirectPath()
Description copied from class:OAuthProviderReturns the path to be included in redirect URLs. Normally this should be the access token controller path. This will be used as a fallback if this provider does not support unique redirect URLs. This will be used as a fallback if a connection does not have a redirect ID parameter.- Overrides:
 getFallbackRedirectPathin classOAuthProvider- Returns:
 - a controller path starting with a slash
 - See Also:
 OAuthProvider.isUniqueRedirectsSupported()
 
- 
getSupportedTokenIntentTypes
@NotNull public Set<TokenIntentType> getSupportedTokenIntentTypes()
Description copied from class:OAuthProviderGets the token intent types this provider fully supports. Full support means that the methodsOAuthProvider.getScopeForIntent(OAuthConnectionDescriptor, TokenIntent)andOAuthProvider.isSuitableToken(OAuthToken, TokenIntent)are implemented with sufficient logic to cater for the claimed token intent types.- Overrides:
 getSupportedTokenIntentTypesin classOAuthProvider- Returns:
 - set of supported token intent types
 
 
- 
getTokenUsageParamsForVcsRoot
@NotNull public Map<String,String> getTokenUsageParamsForVcsRoot(@NotNull OAuthConnectionDescriptor connection, @NotNull OAuthToken token)
Description copied from class:OAuthProviderReturns the necessary parameters for usage of the provided token for authentication in aSVcsRoot. By default, this provides the following values:- oauthUsername
 OauthToken#getOauthLogin- tokenType
 - refreshable (if refreshable tokens are enabled)
 
- Overrides:
 getTokenUsageParamsForVcsRootin classOAuthProvider- Parameters:
 connection- the token's connectiontoken- the token to be potentially used on a VCS root- Returns:
 - mutable map of parameters
 
 
- 
getTokenStorageParameters
@NotNull public Set<String> getTokenStorageParameters()
Description copied from class:OAuthProviderReturns the parameters used when constructing the token storage ID for connections of this provider type. Implementors must make sure this corresponds with the implementation ofOAuthProvider.getTokenStorageId(OAuthConnectionDescriptor).- Overrides:
 getTokenStorageParametersin classOAuthProvider- Returns:
 - set of parameter names
 - See Also:
 OAuthProvider.getTokenStorageId(OAuthConnectionDescriptor)
 
 - 
 
 -