-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<IDbConnectionFactory>().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 [] { "[email protected]", "[email protected]" }; | ||
|