Skip to content

Commit

Permalink
Add JWT configuration to Argon API project
Browse files Browse the repository at this point in the history
  • Loading branch information
urumo committed Oct 21, 2024
1 parent 3ccb4f6 commit 77bf7e4
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var username = builder.AddParameter("username", true);
var password = builder.AddParameter("password", true);
var sfuUrl = builder.AddParameter("sfu-url", true);
var sfuClientId = builder.AddParameter("sfu-client-id", true);
var sfuClientSecret = builder.AddParameter("sfu-client-secret", true);
var jwtKey = builder.AddParameter("jwt-key", true);

var cache = builder.AddRedis("cache", 6379);
var rmq = builder.AddRabbitMQ("rmq", port: 5672, userName: username, password: password)
Expand All @@ -15,13 +18,17 @@

var apiDb = db.AddDatabase("apiDb");

// var api = builder.AddProject<Argon_Api>("argon-api")
// .WithReference(apiDb, "DefaultConnection")
// .WithReference(cache)
// .WithReference(rmq)
// .WithEnvironment("sfu__url", sfuUrl)
// .WithEnvironment("sfu__clientId", sfuClientId)
// .WithEnvironment("sfu__clientSecret", sfuClientSecret)
// .WithExternalHttpEndpoints();
var api = builder.AddProject<Argon_Api>("argon-api")
.WithReference(apiDb, "DefaultConnection")
.WithReference(cache)
.WithReference(rmq)
.WithEnvironment("sfu__url", sfuUrl)
.WithEnvironment("sfu__clientId", sfuClientId)
.WithEnvironment("sfu__clientSecret", sfuClientSecret)
.WithEnvironment("Jwt__Issuer", "Arhon")
.WithEnvironment("Jwt__Audience", "Arhon")
.WithEnvironment("Jwt__Key", jwtKey)
.WithEnvironment("Jwt__Expire", "228")
.WithExternalHttpEndpoints();

builder.Build().Run();

0 comments on commit 77bf7e4

Please sign in to comment.