Update Azure BlobStorage appsettings.

This commit is contained in:
2025-04-09 20:37:53 -04:00
parent 46b1dae2ad
commit ef9ff2b90f
5 changed files with 75 additions and 21 deletions

View File

@@ -48,7 +48,7 @@ public sealed class CreateCreatorHandler(
.Slugs
.SingleAsync(s => s.Id == req.SlugReservationId, ct);
if (slug.Active == true
if (slug.Active
|| slug.ReservedUntil < DateTimeOffset.UtcNow
|| slug.CreatedBy != User.GetUserId())
{

View File

@@ -0,0 +1,66 @@
using Hutopy.Web.Common.Security;
using Hutopy.Web.Features.Contents.Data;
namespace Hutopy.Web.Features.Contents.Handlers;
[PublicAPI]
public record RemoveCreatorRequest(
Guid CreatorId);
[UsedImplicitly]
public sealed class RemoveCreatorRequestValidator : Validator<RemoveCreatorRequest>
{
public RemoveCreatorRequestValidator()
{
RuleFor(r => r.CreatorId)
.NotNull()
.NotEmpty()
.WithMessage("You should specify a valid CreatorId");
}
}
[PublicAPI]
public sealed class RemoveCreatorHandler(
ContentDbContext context)
: Endpoint<RemoveCreatorRequest>
{
public override void Configure()
{
Delete("/api/creators");
Options(o => o.WithTags("Creators"));
}
public override async Task HandleAsync(
RemoveCreatorRequest req,
CancellationToken ct)
{
await using var transaction = await context.Database.BeginTransactionAsync(ct);
try
{
var creator = await context
.Creators
.Include(c => c.Slugs)
.Where(c => c.Id == req.CreatorId)
.SingleOrDefaultAsync(cancellationToken: ct);
if (creator is null)
{
await SendNotFoundAsync(ct);
return;
}
creator.Slugs.Active = false;
await context.SaveChangesAsync(ct);
await transaction.CommitAsync(ct);
await SendOkAsync(ct);
}
catch (Exception e)
{
await transaction.RollbackAsync(ct);
}
}
}

View File

@@ -1,15 +1,6 @@
{
"ConnectionStrings": {
"AzureBlob": "DefaultEndpointsProtocol=https;AccountName=hutopyblob;AccountKey=AjK9vQMCIAG280PFIAWDjTtiFc/fIj/fb1NA9xtC7SLm6ZMZa/Agg0JFGYcHuJEaoZKDme7mNx/U+AStt9o7LQ==;EndpointSuffix=core.windows.net",
"PostgresConnection": "Server=localhost,5432;Database=Hutopy;Uid=sa;Pwd=P@ssword123!;",
},
"Authentication": {
"Jwt": {
"Lifetime": "1.00:00:00",
"Audience": "hutopy",
"Issuer": "https://auth.hutopy.com",
"Key": "b2df428b9929d3ace7c598bbf4e496b2f0b71ab3cd4f94540356cfc35b000000"
}
"PostgresConnection": "Server=localhost,5432;Database=Hutopy;Uid=sa;Pwd=P@ssword123!;"
},
"Stripe": {
"SecretKey": "sk_test_51OoveVDrRyqXtNdBaOs1DFFja0XhrQtJoAo83uSySMuqw4Wyt9NsuugrIHRqet9a50cr5GvolpTP8EZuTSttcgYx00gOUPNDoI",

View File

@@ -1,16 +1,7 @@
{
"ConnectionStrings": {
"AzureBlob": "DefaultEndpointsProtocol=https;AccountName=hutopyblob;AccountKey=AjK9vQMCIAG280PFIAWDjTtiFc/fIj/fb1NA9xtC7SLm6ZMZa/Agg0JFGYcHuJEaoZKDme7mNx/U+AStt9o7LQ==;EndpointSuffix=core.windows.net",
"PostgresConnection": "Server=hutopypostgress.postgres.database.azure.com,5432;Database=hutopy;User Id=hutopy;Password=General2024!;Ssl Mode=Require;"
},
"Authentication": {
"Jwt": {
"Lifetime": "1.00:00:00",
"Audience": "hutopy",
"Issuer": "https://auth.hutopy.com",
"Key": "b2df428b9929d3ace7c598bbf4e496b2f0b71ab3cd4f94540356cfc35b000000"
}
},
"Stripe": {
"SecretKey": "sk_test_51OoveVDrRyqXtNdBaOs1DFFja0XhrQtJoAo83uSySMuqw4Wyt9NsuugrIHRqet9a50cr5GvolpTP8EZuTSttcgYx00gOUPNDoI",
"WebhookSecret": "whsec_cee07ef14cf784850cab63567048b5326fec7fd29c03f4659476524f8299aff1",

View File

@@ -8,9 +8,15 @@
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"AzureBlob": "DefaultEndpointsProtocol=https;AccountName=hutopystorage;AccountKey=+3LZ3fgVvsOtaM9iYcsUhSyT2GZT4I6AQegE1FyIqr8NMv5Qa4Fm8GspckP/DCFN3jbFI8TnTLXY+AStWjvCkg==;EndpointSuffix=core.windows.net"
},
"Authentication": {
"Jwt": {
"Lifetime": "00:30:00"
"Lifetime": "00:30:00",
"Audience": "hutopy",
"Issuer": "https://auth.hutopy.com",
"Key": "b2df428b9929d3ace7c598bbf4e496b2f0b71ab3cd4f94540356cfc35b000000"
}
},
"Contents": {