Merge branch 'master' of https://git.nejcraft.cz/Nejcraft/NejCommon.NET
This commit is contained in:
commit
fa0701f3aa
|
|
@ -64,6 +64,8 @@ public static class Responses
|
||||||
//limit the name to 31 characters
|
//limit the name to 31 characters
|
||||||
sheetName = name.Length > 31 ? name.Substring(0, 31) : name;
|
sheetName = name.Length > 31 ? name.Substring(0, 31) : name;
|
||||||
}
|
}
|
||||||
|
//make sure sheet is only alphanumeric
|
||||||
|
sheetName = new string(sheetName.Where(char.IsLetterOrDigit).ToArray());
|
||||||
|
|
||||||
var notebook = new XLWorkbook();
|
var notebook = new XLWorkbook();
|
||||||
var sheet = notebook.Worksheets.Add(sheetName);
|
var sheet = notebook.Worksheets.Add(sheetName);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace NejCommon.Models;
|
||||||
public partial class ApiKey : IApiKey
|
public partial class ApiKey : IApiKey
|
||||||
{
|
{
|
||||||
[AutoMapProperty("Response")]
|
[AutoMapProperty("Response")]
|
||||||
public string Id { get; set; } = NanoidDotNet.Nanoid.Generate(size: 64);
|
public string Id { get; set; } = Nanoid.Nanoid.Generate(size: 64);
|
||||||
[StandardText]
|
[StandardText]
|
||||||
[AutoMapProperty("Request")]
|
[AutoMapProperty("Request")]
|
||||||
public string Name { get; set; } = null!;
|
public string Name { get; set; } = null!;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using AspNetCore.Authentication.ApiKey;
|
using AspNetCore.Authentication.ApiKey;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NanoidDotNet;
|
|
||||||
using NejCommon.Models;
|
using NejCommon.Models;
|
||||||
|
|
||||||
namespace NejCommon.Services;
|
namespace NejCommon.Services;
|
||||||
|
|
@ -39,5 +38,5 @@ public partial class ApiKeyProvider : IApiKeyProvider, IScopedService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GenerateKey() => "nej-" + Nanoid.Generate(size: 256);
|
public static string GenerateKey() => "nej-" + Nanoid.Nanoid.Generate(size: 256);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user