1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-25 05:21:03 -05:00

Formatting

This commit is contained in:
Justin Baur 2025-04-18 13:25:36 -04:00
parent 7002e6138d
commit 1a15e7a51d
No known key found for this signature in database
8 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
using Bit.Core.IdentityServer; using Bit.Core.IdentityServer;
using Bit.Core.Platform.Installations; using Bit.Core.Platform.Installations;
using Duende.IdentityModel; using Duende.IdentityModel;
using Duende.IdentityServer.Models; using Duende.IdentityServer.Models;

View File

@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System.Diagnostics; using System.Diagnostics;
using Bit.Core.IdentityServer; using Bit.Core.IdentityServer;

View File

@ -1,4 +1,4 @@
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Identity; using Bit.Core.Identity;
using Bit.Core.IdentityServer; using Bit.Core.IdentityServer;
using Bit.Core.Repositories; using Bit.Core.Repositories;
@ -44,7 +44,7 @@ internal class OrganizationClientProvider : IClientProvider
ClientId = $"organization.{organization.Id}", ClientId = $"organization.{organization.Id}",
RequireClientSecret = true, RequireClientSecret = true,
ClientSecrets = [new Secret(orgApiKey.ApiKey.Sha256())], ClientSecrets = [new Secret(orgApiKey.ApiKey.Sha256())],
AllowedScopes = [ ApiScopes.ApiOrganization ], AllowedScopes = [ApiScopes.ApiOrganization],
AllowedGrantTypes = GrantTypes.ClientCredentials, AllowedGrantTypes = GrantTypes.ClientCredentials,
AccessTokenLifetime = 3600 * 1, AccessTokenLifetime = 3600 * 1,
Enabled = organization.Enabled && organization.UseApi, Enabled = organization.Enabled && organization.UseApi,

View File

@ -1,4 +1,4 @@
using Bit.Core.Identity; using Bit.Core.Identity;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.SecretsManager.Models.Data; using Bit.Core.SecretsManager.Models.Data;
using Bit.Core.SecretsManager.Repositories; using Bit.Core.SecretsManager.Repositories;
@ -34,13 +34,13 @@ internal class SecretsManagerApiKeyProvider : IClientProvider
switch (apiKey) switch (apiKey)
{ {
case ServiceAccountApiKeyDetails key: case ServiceAccountApiKeyDetails key:
var org = await _organizationRepository.GetByIdAsync(key.ServiceAccountOrganizationId); var org = await _organizationRepository.GetByIdAsync(key.ServiceAccountOrganizationId);
if (!org.UseSecretsManager || !org.Enabled) if (!org.UseSecretsManager || !org.Enabled)
{ {
return null; return null;
} }
break; break;
} }
var client = new Client var client = new Client

View File

@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Security.Claims; using System.Security.Claims;

View File

@ -1,4 +1,4 @@
#nullable enable #nullable enable
using Duende.IdentityServer.Models; using Duende.IdentityServer.Models;
using Duende.IdentityServer.Stores; using Duende.IdentityServer.Stores;

View File

@ -1,4 +1,4 @@
using Bit.Identity.IdentityServer; using Bit.Identity.IdentityServer;
namespace Microsoft.Extensions.DependencyInjection; namespace Microsoft.Extensions.DependencyInjection;

View File

@ -9,7 +9,6 @@ using Bit.Core.Enums;
using Bit.Core.Platform.Installations; using Bit.Core.Platform.Installations;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Test.Auth.AutoFixture; using Bit.Core.Test.Auth.AutoFixture;
using Bit.Identity.IdentityServer;
using Bit.IntegrationTestCommon.Factories; using Bit.IntegrationTestCommon.Factories;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using Bit.Test.Common.Helpers; using Bit.Test.Common.Helpers;