Skip to content

Commit

Permalink
Revert swagger workarounds after service fix (#12853)
Browse files Browse the repository at this point in the history
  • Loading branch information
christothes authored and prmathur-microsoft committed Jul 8, 2020
1 parent 4395473 commit f0c446a
Show file tree
Hide file tree
Showing 15 changed files with 808 additions and 347 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public virtual Response<RoleAssignment> CreateRoleAssignment(RoleAssignmentScope
try
{
var _name = name == default ? Guid.NewGuid().ToString() : name.ToString();
return _assignmentsRestClient.Create(VaultUri.AbsoluteUri, roleScope.ToString(), _name, properties, cancellationToken);
return _assignmentsRestClient.Create(VaultUri.AbsoluteUri, roleScope.ToString(), _name, new RoleAssignmentCreateParameters(properties), cancellationToken);
}
catch (Exception ex)
{
Expand All @@ -275,7 +275,7 @@ public virtual async Task<Response<RoleAssignment>> CreateRoleAssignmentAsync(Ro
try
{
var _name = name == default ? Guid.NewGuid().ToString() : name.ToString();
return await _assignmentsRestClient.CreateAsync(VaultUri.AbsoluteUri, roleScope.ToString(), _name, properties, cancellationToken)
return await _assignmentsRestClient.CreateAsync(VaultUri.AbsoluteUri, roleScope.ToString(), _name, new RoleAssignmentCreateParameters(properties), cancellationToken)
.ConfigureAwait(false);
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.Security.KeyVault.Administration.Models
{
/// <inheritdoc />
internal partial class RoleAssignmentCreateParameters
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RoleAssignmentProperties"
"$ref": "#/definitions/RoleAssignmentCreateParameters"
},
"description": "Parameters for the role assignment."
},
Expand Down Expand Up @@ -349,7 +349,6 @@
"description": "Role assignment list operation result."
},
"RoleAssignmentProperties": {
"type":"object",
"properties": {
"roleDefinitionId": {
"type": "string",
Expand All @@ -366,6 +365,18 @@
],
"description": "Role assignment properties."
},
"RoleAssignmentCreateParameters": {
"properties": {
"properties": {
"$ref": "#/definitions/RoleAssignmentProperties",
"description": "Role assignment properties."
}
},
"required": [
"properties"
],
"description": "Role assignment create parameters."
},
"RoleDefinitionFilter": {
"properties": {
"roleName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ internal KeyVaultAccessControlClient GetClient(TestRecording recording = null)
[SetUp]
public void ClearChallengeCacheforRecord()
{
Client = GetClient();

// in record mode we reset the challenge cache before each test so that the challenge call
// is always made. This allows tests to be replayed independently and in any order
if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback)
{
Client = GetClient();

ChallengeBasedAuthenticationPolicy.AuthenticationChallenge.ClearCache();
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0c446a

Please sign in to comment.