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:
50
src/Core/Auth/Models/Api/Response/UserDecryptionOptions.cs
Normal file
50
src/Core/Auth/Models/Api/Response/UserDecryptionOptions.cs
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user