1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00
bitwarden-server/util/Setup/AssetLinksBuilder.cs
Matt Portune 0e76371d0d
Android FIDO2 Asset Links (#1359)
* asset links for Android FIDO2

* added release & debug fingerprints
2021-05-27 13:00:38 -04:00

36 lines
845 B
C#

using System.IO;
namespace Bit.Setup
{
public class AssetLinksBuilder
{
private readonly Context _context;
public AssetLinksBuilder(Context context)
{
_context = context;
}
public void Build()
{
var model = new TemplateModel
{
Url = _context.Config.Url
};
Helpers.WriteLine(_context, "Building Asset Links For Fido2.");
Directory.CreateDirectory("/bitwarden/web/");
var template = Helpers.ReadTemplate("AssetLinks");
using (var sw = File.CreateText("/bitwarden/web/assetlinks.json"))
{
sw.Write(template(model));
}
}
public class TemplateModel
{
public string Url { get; set; }
}
}
}