1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[PM-1815] Include Member Decryption Type in Token Response (#2927)

* Include Member Decryption Type

* Make ICurrentContext protected from base class

* Return MemberDecryptionType

* Extend WebApplicationFactoryBase

- Allow for service subsitution

* Create SSO Tests

- Mock IAuthorizationCodeStore so the SSO process can be limited to Identity

* Add MemberDecryptionOptions

* Remove Unused Property Assertion

* Make MemberDecryptionOptions an Array

* Address PR Feedback

* Make HasAdminApproval Policy Aware

* Format

* Use Object Instead

* Add UserDecryptionOptions File
This commit is contained in:
Justin Baur
2023-06-19 10:16:15 -04:00
committed by GitHub
parent ca7ced4e43
commit 5a8e549194
5 changed files with 551 additions and 28 deletions

View File

@ -0,0 +1,50 @@
using System.Text.Json.Serialization;
using Bit.Core.Models.Api;
#nullable enable
namespace Bit.Core.Auth.Models.Api.Response;
public class UserDecryptionOptions : ResponseModel
{
public UserDecryptionOptions() : base("userDecryptionOptions")
{
}
/// <summary>
///
/// </summary>
public bool HasMasterPassword { get; set; }
/// <summary>
///
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TrustedDeviceUserDecryptionOption? TrustedDeviceOption { get; set; }
/// <summary>
///
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public KeyConnectorUserDecryptionOption? KeyConnectorOption { get; set; }
}
public class TrustedDeviceUserDecryptionOption
{
public bool HasAdminApproval { get; }
public TrustedDeviceUserDecryptionOption(bool hasAdminApproval)
{
HasAdminApproval = hasAdminApproval;
}
}
public class KeyConnectorUserDecryptionOption
{
public string KeyConnectorUrl { get; }
public KeyConnectorUserDecryptionOption(string keyConnectorUrl)
{
KeyConnectorUrl = keyConnectorUrl;
}
}