Class AdHocTokenResolver
A "do-nothing" resolver for user-specified tokens.
Implements
Inherited Members
Namespace: Microsoft.Internal.Studios.Aruba.Infrastructure.Token
Assembly: Aruba.Infrastructure.dll
Syntax
public class AdHocTokenResolver : ITokenResolver
Fields
View SourceResolverName
The resolver name.
Declaration
public const string ResolverName = "AdHoc"
Field Value
Type | Description |
---|---|
string |
Properties
View SourceSupportedTokenDefinitions
Gets or sets the supported token definitions.
Declaration
public IReadOnlyCollection<BasicTokenDefinition> SupportedTokenDefinitions { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<BasicTokenDefinition> |
TokenDefinitionType
Gets the token definition type.
Declaration
public Type TokenDefinitionType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
View SourceBeginResolveTokensAsync(Guid, CancellationToken)
Resolve the tokens.
Declaration
public Task BeginResolveTokensAsync(Guid bugResolveId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Guid | bugResolveId | The id associated with this bug. |
CancellationToken | cancellationToken | A cancellation token for the connection task. |
Returns
Type | Description |
---|---|
Task | A task. |
CreateNewTokenDefinition()
Create a new token definition.
Declaration
public BasicTokenDefinition CreateNewTokenDefinition()
Returns
Type | Description |
---|---|
BasicTokenDefinition | A basic token definition. |
CreateUserDefinedToken()
Called by the user in the UI to create a new token definition and returns it, but does not add it to the SupportedTokenDefinitions list.
Declaration
public BasicTokenDefinition? CreateUserDefinedToken()
Returns
Type | Description |
---|---|
BasicTokenDefinition | The basic token definition, if it exists. |
EndResolveTokens()
Finish resolving the tokens.
Declaration
public void EndResolveTokens()
LoadTokenDefinitionsAsync(IDataStoreProvider, bool)
Load the token definitions from the data store provider.
Declaration
public Task<List<string>?> LoadTokenDefinitionsAsync(IDataStoreProvider storeProvider, bool createDefinitionFileIfFileNotFound)
Parameters
Type | Name | Description |
---|---|---|
IDataStoreProvider | storeProvider | The store provider. |
bool | createDefinitionFileIfFileNotFound | Whether to create file if it doesn't already exist |
Returns
Type | Description |
---|---|
Task<List<string>> | Null (instead of failed tokens), since AdHoc tokens will either exist or they won't. If they exist there isn't any additional factors that would make them fail. |
RegisterUsingDefaultName(TokenResolverRegistry)
Register with the given TokenResolverRegistry using the default name for this resolver.
Declaration
public void RegisterUsingDefaultName(TokenResolverRegistry registry)
Parameters
Type | Name | Description |
---|---|---|
TokenResolverRegistry | registry | The token resolver registry. |
ResolveTokenAsync(string, Guid, Guid)
The resolve token.
Declaration
public Task<List<object?>?> ResolveTokenAsync(string token, Guid bugResolveId, Guid resolvePassId)
Parameters
Type | Name | Description |
---|---|---|
string | token | The token string. |
Guid | bugResolveId | The id associated with this bug. |
Guid | resolvePassId | The id associated with this resolve pass. |
Returns
Type | Description |
---|---|
Task<List<object>> | The task. |
SaveTokenDefinitionsAsync(IDataStoreProvider)
Save the token definitions.
Declaration
public Task SaveTokenDefinitionsAsync(IDataStoreProvider storeProvider)
Parameters
Type | Name | Description |
---|---|---|
IDataStoreProvider | storeProvider | The data store provider. |
Returns
Type | Description |
---|---|
Task | The task. |