mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
apikey apis for orgs
This commit is contained in:
10
src/Core/Models/Api/Request/ApiKeyRequestModel.cs
Normal file
10
src/Core/Models/Api/Request/ApiKeyRequestModel.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class ApiKeyRequestModel
|
||||
{
|
||||
[Required]
|
||||
public string MasterPasswordHash { get; set; }
|
||||
}
|
||||
}
|
20
src/Core/Models/Api/Response/ApiKeyResponseModel.cs
Normal file
20
src/Core/Models/Api/Response/ApiKeyResponseModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class ApiKeyResponseModel : ResponseModel
|
||||
{
|
||||
public ApiKeyResponseModel(Organization organization, string obj = "apiKey")
|
||||
: base(obj)
|
||||
{
|
||||
if(organization == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(organization));
|
||||
}
|
||||
ApiKey = organization.ApiKey;
|
||||
}
|
||||
|
||||
public string ApiKey { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user