mirror of
https://github.com/bitwarden/server.git
synced 2025-06-13 06:20:48 -05:00
Use preferred prefix for API keys
This commit is contained in:
parent
03820b4fba
commit
78a9471dac
@ -9,6 +9,8 @@ namespace Bit.Identity.IdentityServer.ClientProviders;
|
||||
|
||||
internal class SecretsManagerApiKeyProvider : IClientProvider
|
||||
{
|
||||
public const string ApiKeyPrefix = "apikey";
|
||||
|
||||
private readonly IApiKeyRepository _apiKeyRepository;
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#nullable enable
|
||||
|
||||
using Bit.Identity.IdentityServer.ClientProviders;
|
||||
using Duende.IdentityServer.Models;
|
||||
using Duende.IdentityServer.Stores;
|
||||
|
||||
@ -18,7 +19,7 @@ internal class DynamicClientStore : IClientStore
|
||||
|
||||
public DynamicClientStore(
|
||||
IServiceProvider serviceProvider,
|
||||
[FromKeyedServices("sm-apikey")] IClientProvider apiKeyClientProvider,
|
||||
[FromKeyedServices(SecretsManagerApiKeyProvider.ApiKeyPrefix)] IClientProvider apiKeyClientProvider,
|
||||
StaticClientStore staticClientStore
|
||||
)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ public static class ServiceCollectionExtensions
|
||||
|
||||
services.AddClientProvider<UserClientProvider>("user");
|
||||
services.AddClientProvider<OrganizationClientProvider>("organization");
|
||||
services.AddClientProvider<SecretsManagerApiKeyProvider>("sm-apikey");
|
||||
services.AddClientProvider<SecretsManagerApiKeyProvider>(SecretsManagerApiKeyProvider.ApiKeyPrefix);
|
||||
|
||||
if (CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CosmosConnectionString))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user