mirror of
https://github.com/bitwarden/server
synced 2025-12-27 05:33:17 +00:00
[SM-460] Isolate SecretsManager files (#2616)
Move SecretsManager files to directories called SecretsManager and add CodeOwners
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.SecretsManager.Entities;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Api.SecretsManager.Models.Request;
|
||||
|
||||
public class AccessTokenCreateRequestModel
|
||||
{
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(200)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
[EncryptedStringLength(4000)]
|
||||
public string EncryptedPayload { get; set; }
|
||||
|
||||
[Required]
|
||||
[EncryptedString]
|
||||
public string Key { get; set; }
|
||||
|
||||
public DateTime? ExpireAt { get; set; }
|
||||
|
||||
public ApiKey ToApiKey(Guid serviceAccountId)
|
||||
{
|
||||
return new ApiKey()
|
||||
{
|
||||
ServiceAccountId = serviceAccountId,
|
||||
Name = Name,
|
||||
Key = Key,
|
||||
ExpireAt = ExpireAt,
|
||||
Scope = "[\"api.secrets\"]",
|
||||
EncryptedPayload = EncryptedPayload,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user