Skip to content

Commit cdd7e7a

Browse files
committed
Move ValidateToken to IIdentityProvider since it's documented at OpenStack
1 parent 9fbe302 commit cdd7e7a

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/corelib/Core/Providers/IIdentityProvider.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ public interface IIdentityProvider
2626
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_authenticate_v2.0_tokens_.html">Authenticate (OpenStack Identity Service API v2.0 Reference)</seealso>
2727
UserAccess Authenticate(CloudIdentity identity = null);
2828

29+
/// <summary>
30+
/// Validates a given token.
31+
/// </summary>
32+
/// <param name="token">The token to be validated.</param>
33+
/// <param name="tenantId">If specified, the validation ensures that the specified tenant is in scope. This is obtained from <see cref="Tenant.Id"/>.</param>
34+
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
35+
/// <returns>A <see cref="UserAccess"/> object containing the authentication token and user data. The <see cref="UserAccess.ServiceCatalog"/> property of the result may be <c>null</c>.</returns>
36+
/// <exception cref="ArgumentNullException">If <paramref name="token"/> is <c>null</c>.</exception>
37+
/// <exception cref="ArgumentException">If <paramref name="token"/> is empty.</exception>
38+
/// <exception cref="NotSupportedException">If the provider does not support the given <paramref name="identity"/> type.</exception>
39+
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
40+
/// <exception cref="ItemNotFoundException">If <paramref name="tenantId"/> is specified and the token is not valid within the specified tenant.</exception>
41+
/// <exception cref="ResponseException">If the authentication request failed or the token does not exist.</exception>
42+
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_validateToken_v2.0_tokens__tokenId__Token_Operations.html">Validate Token (OpenStack Identity Service API v2.0 Reference)</seealso>
43+
UserAccess ValidateToken(string token, string tenantId = null, CloudIdentity identity = null);
44+
2945
/// <summary>
3046
/// Gets the authentication token for the specified identity. If necessary, the identity is authenticated
3147
/// on the server to obtain a token.

src/corelib/Providers/Rackspace/IExtendedCloudIdentityProvider.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -349,21 +349,5 @@ public interface IExtendedCloudIdentityProvider : IIdentityProvider
349349
/// <exception cref="ResponseException">If the REST API request failed.</exception>
350350
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_updateUserCredential_v2.0_users__userId__OS-KSADM_credentials__credential-type__.html">Update User Credentials (OpenStack Identity Service API v2.0 Reference)</seealso>
351351
UserCredential UpdateUserCredentials(string userId, string username, string apiKey, CloudIdentity identity = null);
352-
353-
/// <summary>
354-
/// Validates a given token.
355-
/// </summary>
356-
/// <param name="token">The token to be authenticated.</param>
357-
/// <param name="tenantId">If specified, the validation ensures that the specified tenant is in scope. This is obtained from <see cref="Tenant.Id"/>.</param>
358-
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
359-
/// <returns>A <see cref="UserAccess"/> object containing the authentication token and user data. The <see cref="UserAccess.ServiceCatalog"/> property of the result may be <c>null</c>.</returns>
360-
/// <exception cref="ArgumentNullException">If <paramref name="token"/> is <c>null</c>.</exception>
361-
/// <exception cref="ArgumentException">If <paramref name="token"/> is empty.</exception>
362-
/// <exception cref="NotSupportedException">If the provider does not support the given <paramref name="identity"/> type.</exception>
363-
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
364-
/// <exception cref="ItemNotFoundException">If <paramref name="tenantId"/> is specified and the token is not valid within the specified tenant.</exception>
365-
/// <exception cref="ResponseException">If the authentication request failed or the token does not exist.</exception>
366-
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_validateToken_v2.0_tokens__tokenId__Token_Operations.html">Validate Token (OpenStack Identity Service API v2.0 Reference)</seealso>
367-
UserAccess ValidateToken(string token, string tenantId = null, CloudIdentity identity = null);
368352
}
369353
}

src/testing/integration/Providers/Rackspace/UserIdentityTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public void TestAuthenticate()
6969
}
7070

7171
/// <summary>
72-
/// This method tests the basic functionality of the <see cref="IExtendedCloudIdentityProvider.ValidateToken"/>
72+
/// This method tests the basic functionality of the <see cref="IIdentityProvider.ValidateToken"/>
7373
/// method for a validated token.
7474
/// </summary>
7575
[TestMethod]
7676
[TestCategory(TestCategories.User)]
7777
[TestCategory(TestCategories.Identity)]
7878
public void TestValidateToken()
7979
{
80-
IExtendedCloudIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
80+
IIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
8181
UserAccess userAccess = provider.Authenticate();
8282

8383
Assert.IsNotNull(userAccess);

0 commit comments

Comments
 (0)