1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

created ciphers API controller. Moved import to ciphers controller.

This commit is contained in:
Kyle Spearrin
2016-06-07 20:05:27 -04:00
parent 585d7b4afd
commit 6861303586
5 changed files with 107 additions and 11 deletions

View File

@ -32,6 +32,5 @@
public string Username { get; set; }
public string Password { get; set; }
public string Notes { get; set; }
}
}

View File

@ -7,6 +7,6 @@ namespace Bit.Api.Models
{
public FolderRequestModel[] Folders { get; set; }
public SiteRequestModel[] Sites { get; set; }
public KeyValuePair<int, int>[] SiteRelationships { get; set; }
public KeyValuePair<int, int>[] FolderRelationships { get; set; }
}
}

View File

@ -0,0 +1,29 @@
using System;
using Bit.Core.Domains;
namespace Bit.Api.Models
{
public class CipherResponseModel : ResponseModel
{
public CipherResponseModel(Cipher cipher)
: base("cipher")
{
if(cipher == null)
{
throw new ArgumentNullException(nameof(cipher));
}
Id = cipher.Id.ToString();
FolderId = cipher.FolderId?.ToString();
Type = cipher.Type;
Data = cipher.Data;
RevisionDate = cipher.RevisionDate;
}
public string Id { get; set; }
public string FolderId { get; set; }
public Core.Enums.CipherType Type { get; set; }
public string Data { get; set; }
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
}
}