1
0
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:
Justin Baur 2025-05-13 12:47:21 -04:00
parent 03820b4fba
commit 78a9471dac
No known key found for this signature in database
3 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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
)
{

View File

@ -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))
{