From 2ce48184c93e2915a6eb0b6af58408cd0eb191a5 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Mon, 3 Jun 2024 13:44:27 +0800 Subject: [PATCH] Update Configure.ApiKeys.cs --- MyApp/Configure.ApiKeys.cs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/MyApp/Configure.ApiKeys.cs b/MyApp/Configure.ApiKeys.cs index d091cbd..69db464 100644 --- a/MyApp/Configure.ApiKeys.cs +++ b/MyApp/Configure.ApiKeys.cs @@ -14,19 +14,27 @@ public void Configure(IWebHostBuilder builder) => builder { services.AddPlugin(new ApiKeysFeature { - Features = [ - "Tracking" - ], + // Optional: Limit available Scopes Admin Users can assign to any API Keys + // Features = [ + // "Paid", + // "Tracking", + // ], + // Optional: Limit available Features Admin Users can assign to any API Keys + // Scopes = [ + // "todo:read", + // "todo:write", + // ], - // Optional: Limit scope of API Key access - UserScopes = [ - "todo:read", - "todo:write", - ], - // Optional: Tag API Keys with additional features - UserFeatures = [ - "Tracking", - ], + // Optional: Limit available Scopes Users can assign to their own API Keys + // UserScopes = [ + // "todo:read", + // "todo:write", + // ], + // Optional: Limit available Features Users can assign to their own API Keys + // UserFeatures = [ + // "Paid", + // "Tracking", + // ], }); }) .ConfigureAppHost(appHost => @@ -35,7 +43,7 @@ public void Configure(IWebHostBuilder builder) => builder using var db = appHost.Resolve().Open(); apiKeysFeature.InitSchema(db); - // Optional, create API Key for specified Users + // Optional: Create API Key for specified Users on Startup if (apiKeysFeature.ApiKeyCount(db) == 0) { var createApiKeysFor = new [] { "admin@email.com", "manager@email.com" };