mirror of
https://github.com/bitwarden/server
synced 2025-12-13 14:53:34 +00:00
refactor(IdentityTokenResponse): [Auth/PM-3537] Remove deprecated "KeyConnectorUrl" from root of IdentityTokenResponse (#6627)
* PM-3537 - Remove "KeyConnectorUrl" from root of IdentityTokenResponse * PM-3537 - CustomTokenRequestValidator.cs - update comment to be accurate
This commit is contained in:
@@ -161,16 +161,16 @@ public class CustomTokenRequestValidator : BaseRequestValidator<CustomTokenReque
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Key connector data should have already been set in the decryption options
|
// Key connector data should have already been set in the decryption options
|
||||||
// for backwards compatibility we set them this way too. We can eventually get rid of this
|
// for backwards compatibility we set them this way too. We can eventually get rid of this once we clean up
|
||||||
// when all clients don't read them from the existing locations.
|
// ResetMasterPassword
|
||||||
if (!context.Result.CustomResponse.TryGetValue("UserDecryptionOptions", out var userDecryptionOptionsObj) ||
|
if (!context.Result.CustomResponse.TryGetValue("UserDecryptionOptions", out var userDecryptionOptionsObj) ||
|
||||||
userDecryptionOptionsObj is not UserDecryptionOptions userDecryptionOptions)
|
userDecryptionOptionsObj is not UserDecryptionOptions userDecryptionOptions)
|
||||||
{
|
{
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userDecryptionOptions is { KeyConnectorOption: { } })
|
if (userDecryptionOptions is { KeyConnectorOption: { } })
|
||||||
{
|
{
|
||||||
context.Result.CustomResponse["KeyConnectorUrl"] = userDecryptionOptions.KeyConnectorOption.KeyConnectorUrl;
|
|
||||||
context.Result.CustomResponse["ResetMasterPassword"] = false;
|
context.Result.CustomResponse["ResetMasterPassword"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -520,10 +520,6 @@ public class IdentityServerSsoTests
|
|||||||
|
|
||||||
var keyConnectorUrl = AssertHelper.AssertJsonProperty(keyConnectorOption, "KeyConnectorUrl", JsonValueKind.String).GetString();
|
var keyConnectorUrl = AssertHelper.AssertJsonProperty(keyConnectorOption, "KeyConnectorUrl", JsonValueKind.String).GetString();
|
||||||
Assert.Equal("https://key_connector.com", keyConnectorUrl);
|
Assert.Equal("https://key_connector.com", keyConnectorUrl);
|
||||||
|
|
||||||
// For backwards compatibility reasons the url should also be on the root
|
|
||||||
keyConnectorUrl = AssertHelper.AssertJsonProperty(root, "KeyConnectorUrl", JsonValueKind.String).GetString();
|
|
||||||
Assert.Equal("https://key_connector.com", keyConnectorUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<JsonDocument> RunSuccessTestAsync(MemberDecryptionType memberDecryptionType)
|
private static async Task<JsonDocument> RunSuccessTestAsync(MemberDecryptionType memberDecryptionType)
|
||||||
|
|||||||
Reference in New Issue
Block a user