Added auth requirement on all endpoints. Added SignIn-, Access- and Refresh-Tokens based on JWT. Upgraded stored password to be based on PBKDF2. Added default password assignment. Updated logic to support auth-header and re-sign-in for tray-icon and web-ui.
22 lines
662 B
C#
22 lines
662 B
C#
using Duplicati.Library.Common.IO;
|
|
using Duplicati.WebserverCore.Abstractions;
|
|
|
|
namespace Duplicati.WebserverCore.Endpoints.V1;
|
|
|
|
public class Acknowledgements : IEndpointV1
|
|
{
|
|
public static void Map(RouteGroupBuilder group)
|
|
{
|
|
group.MapGet("/acknowledgements", () => Execute()).RequireAuthorization();
|
|
}
|
|
|
|
private static Dto.AcknowlegdementDto Execute()
|
|
{
|
|
var path = SystemIO.IO_OS.PathCombine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "acknowledgements.txt");
|
|
return new Dto.AcknowlegdementDto()
|
|
{
|
|
Acknowledgements = File.ReadAllText(path)
|
|
};
|
|
}
|
|
}
|