Skip to content

Commit

Permalink
remove auth/token/revoke-prefix in favor of sys/revoke-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
rajanadar committed Aug 30, 2016
1 parent 4597b1b commit 450aeef
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 23 deletions.
11 changes: 0 additions & 11 deletions src/VaultSharp/IVaultClient.cs
Expand Up @@ -620,17 +620,6 @@ public interface IVaultClient
/// </returns>
Task RevokeCallingTokenAsync();

/// <summary>
/// Revokes all tokens generated at a given prefix, along with child tokens, and all secrets generated using those tokens.
/// Uses include revoking all tokens generated by a credential backend during a suspected compromise.
/// </summary>
/// <param name="prefixPath"><para>[required]</para>
/// The prefix path.</param>
/// <returns>
/// The task.
/// </returns>
Task RevokeAllTokensUnderPrefixAsync(string prefixPath);

/// <summary>
/// Renews a lease associated with the calling token.
/// This is used to prevent the expiration of a token, and the automatic revocation of it.
Expand Down
7 changes: 0 additions & 7 deletions src/VaultSharp/VaultClient.cs
Expand Up @@ -542,13 +542,6 @@ public async Task RevokeCallingTokenAsync()
await MakeVaultApiRequest("auth/token/revoke-self", HttpMethod.Post).ConfigureAwait(continueOnCapturedContext: _continueAsyncTasksOnCapturedContext);
}

public async Task RevokeAllTokensUnderPrefixAsync(string prefixPath)
{
Checker.NotNull(prefixPath, "prefixPath");

await MakeVaultApiRequest("auth/token/revoke-prefix/" + prefixPath.Trim('/'), HttpMethod.Post).ConfigureAwait(continueOnCapturedContext: _continueAsyncTasksOnCapturedContext);
}

public async Task RenewCallingTokenAsync(int? incrementSeconds = null)
{
var requestData = incrementSeconds.HasValue ? new { increment = incrementSeconds.Value } : null;
Expand Down
4 changes: 0 additions & 4 deletions test/VaultSharp.UnitTests/End2End/VaultClientEnd2EndTests.cs
Expand Up @@ -671,10 +671,6 @@ private async Task TokenTests()
await _authenticatedClient.RevokeTokenAsync(secret1.AuthorizationInfo.ClientToken, true);
await Assert.ThrowsAsync<Exception>(() => _authenticatedClient.GetTokenInfoAsync(secret1.AuthorizationInfo.ClientToken));

await _authenticatedClient.RevokeAllTokensUnderPrefixAsync("auth/token");
await Assert.ThrowsAsync<Exception>(() => _authenticatedClient.GetTokenInfoAsync(secret2.AuthorizationInfo.ClientToken));
await Assert.ThrowsAsync<Exception>(() => _authenticatedClient.GetTokenInfoAsync(secret3.AuthorizationInfo.ClientToken));

// check if renewal of same token calls renew-self.
// do it with lease id.

Expand Down
1 change: 0 additions & 1 deletion test/VaultSharp.UnitTests/VaultClientTests.cs
Expand Up @@ -84,7 +84,6 @@ public async Task NullTests()
await Assert.ThrowsAsync<ArgumentNullException>(() => client.DeleteSecretAsync(null));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetTokenInfoAsync(null));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.RevokeTokenAsync(null, true));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.RevokeAllTokensUnderPrefixAsync(null));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.RenewTokenAsync(null));
}

Expand Down

0 comments on commit 450aeef

Please sign in to comment.