mirror of
https://github.com/bitwarden/server
synced 2025-12-15 07:43:54 +00:00
* Enable `nullable` for `ApiKey` * Switch to Using `required` * Make Scope Be Valid JSON * Update test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com> * Move Nullable Directive --------- Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com>
40 lines
1009 B
C#
40 lines
1009 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Bit.Core.SecretsManager.Entities;
|
|
|
|
namespace Bit.Core.SecretsManager.Models.Data;
|
|
|
|
public class ApiKeyDetails : ApiKey
|
|
{
|
|
protected ApiKeyDetails() { }
|
|
|
|
protected ApiKeyDetails(ApiKey apiKey)
|
|
{
|
|
Id = apiKey.Id;
|
|
ServiceAccountId = apiKey.ServiceAccountId;
|
|
Name = apiKey.Name;
|
|
ClientSecretHash = apiKey.ClientSecretHash;
|
|
Scope = apiKey.Scope;
|
|
EncryptedPayload = apiKey.EncryptedPayload;
|
|
Key = apiKey.Key;
|
|
ExpireAt = apiKey.ExpireAt;
|
|
CreationDate = apiKey.CreationDate;
|
|
RevisionDate = apiKey.RevisionDate;
|
|
}
|
|
}
|
|
|
|
public class ServiceAccountApiKeyDetails : ApiKeyDetails
|
|
{
|
|
public ServiceAccountApiKeyDetails()
|
|
{
|
|
|
|
}
|
|
|
|
[SetsRequiredMembers]
|
|
public ServiceAccountApiKeyDetails(ApiKey apiKey, Guid organizationId) : base(apiKey)
|
|
{
|
|
ServiceAccountOrganizationId = organizationId;
|
|
}
|
|
|
|
public Guid ServiceAccountOrganizationId { get; set; }
|
|
}
|