mirror of
https://github.com/bitwarden/server.git
synced 2025-06-14 15:00:49 -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
|
internal class SecretsManagerApiKeyProvider : IClientProvider
|
||||||
{
|
{
|
||||||
|
public const string ApiKeyPrefix = "apikey";
|
||||||
|
|
||||||
private readonly IApiKeyRepository _apiKeyRepository;
|
private readonly IApiKeyRepository _apiKeyRepository;
|
||||||
private readonly IOrganizationRepository _organizationRepository;
|
private readonly IOrganizationRepository _organizationRepository;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
|
using Bit.Identity.IdentityServer.ClientProviders;
|
||||||
using Duende.IdentityServer.Models;
|
using Duende.IdentityServer.Models;
|
||||||
using Duende.IdentityServer.Stores;
|
using Duende.IdentityServer.Stores;
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ internal class DynamicClientStore : IClientStore
|
|||||||
|
|
||||||
public DynamicClientStore(
|
public DynamicClientStore(
|
||||||
IServiceProvider serviceProvider,
|
IServiceProvider serviceProvider,
|
||||||
[FromKeyedServices("sm-apikey")] IClientProvider apiKeyClientProvider,
|
[FromKeyedServices(SecretsManagerApiKeyProvider.ApiKeyPrefix)] IClientProvider apiKeyClientProvider,
|
||||||
StaticClientStore staticClientStore
|
StaticClientStore staticClientStore
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ public static class ServiceCollectionExtensions
|
|||||||
|
|
||||||
services.AddClientProvider<UserClientProvider>("user");
|
services.AddClientProvider<UserClientProvider>("user");
|
||||||
services.AddClientProvider<OrganizationClientProvider>("organization");
|
services.AddClientProvider<OrganizationClientProvider>("organization");
|
||||||
services.AddClientProvider<SecretsManagerApiKeyProvider>("sm-apikey");
|
services.AddClientProvider<SecretsManagerApiKeyProvider>(SecretsManagerApiKeyProvider.ApiKeyPrefix);
|
||||||
|
|
||||||
if (CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CosmosConnectionString))
|
if (CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CosmosConnectionString))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user