Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Ivy/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public Server(ServerArgs? args = null)
};

Services.AddSingleton(_args);
Services.AddSingleton(Configuration);
// capture the latest Configuration value at resolution time in case it gets replaced by UseConfiguration()
Services.AddSingleton(_ => Configuration);

AddDefaultApps();
}
Expand Down
1 change: 0 additions & 1 deletion src/auth/examples/Auth0Example/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/Auth0Example/Auth0Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Auth0Example</RootNamespace>
<UserSecretsId>ivy-auth-auth0-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 0 additions & 12 deletions src/auth/examples/Auth0Example/appsettings.example.json

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/AutheliaExample/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/AutheliaExample/AutheliaExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AutheliaExample</RootNamespace>
<UserSecretsId>ivy-auth-authelia-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/auth/examples/AutheliaExample/appsettings.example.json

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/ClerkExample/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/ClerkExample/ClerkExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>ClerkExample</RootNamespace>
<UserSecretsId>ivy-auth-clerk-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions src/auth/examples/ClerkExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Ivy;
using Microsoft.Extensions.Configuration;

var server = new Server();

Expand All @@ -15,4 +16,21 @@

server.SetMetaTitle("Clerk Example");

server.UseConfiguration(config =>
{
if (ProcessHelper.IsProduction())
{
var secretsPath = Environment.GetEnvironmentVariable("IVY_CLERK_SECRETS_PATH");
if (!string.IsNullOrEmpty(secretsPath))
{
if (!File.Exists(secretsPath))
{
throw new FileNotFoundException(
$"Clerk secrets file not found at path specified by IVY_CLERK_SECRETS_PATH: '{secretsPath}'");
}
config.AddJsonFile(secretsPath, optional: false);
}
}
});

await server.RunAsync();
5 changes: 5 additions & 0 deletions src/auth/examples/ClerkExample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Clerk Example

This example demonstrates authentication using Clerk.

If running in production mode (`IVY_ENVIRONMENT=Production`), the example will look for configuration in a JSON file at the path stored in environment variable `IVY_CLERK_SECRETS_PATH`. This enables different secrets to be used for testing the development and production modes of Clerk.
10 changes: 0 additions & 10 deletions src/auth/examples/ClerkExample/appsettings.example.json

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/GitHubExample/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/GitHubExample/GitHubExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>GitHubExample</RootNamespace>
<UserSecretsId>ivy-auth-github-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/auth/examples/GitHubExample/appsettings.example.json

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/MicrosoftEntraExample/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>MicrosoftEntraExample</RootNamespace>
<UserSecretsId>ivy-auth-microsoft-entra-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/SliplaneExample/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/SliplaneExample/SliplaneExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SliplaneExample</RootNamespace>
<UserSecretsId>ivy-auth-sliplane-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/auth/examples/SliplaneExample/appsettings.example.json

This file was deleted.

1 change: 0 additions & 1 deletion src/auth/examples/SupabaseExample/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions src/auth/examples/SupabaseExample/SupabaseExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SupabaseExample</RootNamespace>
<UserSecretsId>ivy-auth-supabase-example</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 0 additions & 10 deletions src/auth/examples/SupabaseExample/appsettings.example.json

This file was deleted.

Loading