Skip to content

Commit b2c9a70

Browse files
committed
Merge branch 'main' into auth/pm-35393/master-password-service-auth-integration
2 parents e82c1e2 + 5ae8570 commit b2c9a70

181 files changed

Lines changed: 25900 additions & 304 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ jobs:
214214
if [[ "$IMAGE_TAG" == "main" ]]; then
215215
IMAGE_TAG=dev
216216
fi
217-
217+
218218
IMAGE_TAG=${IMAGE_TAG:0:128} # Limit image tags to 128 chars
219219
echo "image_tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
220220
echo "### :mega: Docker Image Tag: $IMAGE_TAG" >> "$GITHUB_STEP_SUMMARY"
@@ -537,47 +537,14 @@ jobs:
537537
permissions:
538538
id-token: write
539539
steps:
540-
- name: Log in to Azure
541-
uses: bitwarden/gh-actions/azure-login@main
542-
with:
543-
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
544-
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
545-
client_id: ${{ secrets.AZURE_CLIENT_ID }}
546-
547-
- name: Get Azure Key Vault secrets
548-
id: get-kv-secrets
549-
uses: bitwarden/gh-actions/get-keyvault-secrets@main
550-
with:
551-
keyvault: gh-org-bitwarden
552-
secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
553-
554-
- name: Log out from Azure
555-
uses: bitwarden/gh-actions/azure-logout@main
556-
557-
- name: Generate GH App token
558-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
559-
id: app-token
540+
- name: Trigger deployment
541+
uses: bitwarden/gh-actions/trigger-actions@main
560542
with:
561-
app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
562-
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
563-
owner: ${{ github.repository_owner }}
564-
repositories: devops
565-
566-
- name: Trigger K8s deploy
567-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
568-
with:
569-
github-token: ${{ steps.app-token.outputs.token }}
570-
script: |
571-
await github.rest.actions.createWorkflowDispatch({
572-
owner: 'bitwarden',
573-
repo: 'devops',
574-
workflow_id: 'deploy-k8s.yml',
575-
ref: 'main',
576-
inputs: {
577-
environment: 'US-DEV Cloud',
578-
tag: 'main'
579-
}
580-
})
543+
azure_subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
544+
azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }}
545+
azure_client_id: ${{ secrets.AZURE_CLIENT_ID }}
546+
task: deploy-server-dev
547+
description: "Triggered by server build on main"
581548

582549
setup-ephemeral-environment:
583550
name: Setup Ephemeral Environment

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55

66
<Version>2026.4.1</Version>
77

@@ -11,6 +11,7 @@
1111
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' == 'true'">annotations</Nullable>
1212
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' != 'true'">enable</Nullable>
1313
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
14+
<NuGetAuditLevel>critical</NuGetAuditLevel>
1415
</PropertyGroup>
1516

1617
<PropertyGroup>

bitwarden_license/src/Scim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###############################################
22
# Build stage #
33
###############################################
4-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.21 AS build
4+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-alpine3.23 AS build
55

66
# Docker buildx supplies the value for this arg
77
ARG TARGETPLATFORM
@@ -37,7 +37,7 @@ RUN . /tmp/rid.txt && dotnet publish \
3737
###############################################
3838
# App stage #
3939
###############################################
40-
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.21
40+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.23
4141

4242
ARG TARGETPLATFORM
4343
LABEL com.bitwarden.product="bitwarden"

bitwarden_license/src/Scim/Models/ScimUserRequestModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// FIXME: Update this file to be null safe and then delete the line below
22
#nullable disable
33

4+
using Bit.Core.AdminConsole.Entities;
45
using Bit.Core.AdminConsole.Enums;
5-
using Bit.Core.AdminConsole.Models.Business;
66
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Models;
77
using Bit.Core.Enums;
88
using Bit.Core.Exceptions;
@@ -34,7 +34,7 @@ public OrganizationUserInvite ToOrganizationUserInvite(ScimProviderType scimProv
3434

3535
public InviteOrganizationUsersRequest ToRequest(
3636
ScimProviderType scimProvider,
37-
InviteOrganization inviteOrganization,
37+
Organization organization,
3838
DateTimeOffset performedAt)
3939
{
4040
var email = EmailForInvite(scimProvider);
@@ -52,7 +52,7 @@ public InviteOrganizationUsersRequest ToRequest(
5252
externalId: ExternalIdForInvite()
5353
)
5454
],
55-
inviteOrganization: inviteOrganization,
55+
organization: organization,
5656
performedBy: Guid.Empty, // SCIM does not have a user id
5757
performedAt: performedAt);
5858
}

bitwarden_license/src/Scim/Users/PostUserCommand.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
using Bit.Core;
44
using Bit.Core.AdminConsole.Enums;
5-
using Bit.Core.AdminConsole.Models.Business;
65
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers;
76
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Errors;
87
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.InviteUsers.Models;
98
using Bit.Core.AdminConsole.Utilities.Commands;
10-
using Bit.Core.Billing.Pricing;
119
using Bit.Core.Billing.Services;
1210
using Bit.Core.Enums;
1311
using Bit.Core.Exceptions;
@@ -29,8 +27,7 @@ public class PostUserCommand(
2927
IScimContext scimContext,
3028
IFeatureService featureService,
3129
IInviteOrganizationUsersCommand inviteOrganizationUsersCommand,
32-
TimeProvider timeProvider,
33-
IPricingClient pricingClient)
30+
TimeProvider timeProvider)
3431
: IPostUserCommand
3532
{
3633
public async Task<OrganizationUserUserDetails?> PostUserAsync(Guid organizationId, ScimUserRequestModel model)
@@ -55,15 +52,13 @@ public class PostUserCommand(
5552
throw new NotFoundException();
5653
}
5754

58-
var plan = await pricingClient.GetPlanOrThrow(organization.PlanType);
59-
6055
var request = model.ToRequest(
6156
scimProvider: scimProvider,
62-
inviteOrganization: new InviteOrganization(organization, plan),
57+
organization: organization,
6358
performedAt: timeProvider.GetUtcNow());
6459

6560
var orgUsers = await organizationUserRepository
66-
.GetManyDetailsByOrganizationAsync(request.InviteOrganization.OrganizationId);
61+
.GetManyDetailsByOrganizationAsync(request.Organization.Id);
6762

6863
if (orgUsers.Any(existingUser =>
6964
request.Invites.First().Email.Equals(existingUser.Email, StringComparison.OrdinalIgnoreCase) ||

bitwarden_license/src/Sso/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###############################################
22
# Build stage #
33
###############################################
4-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine3.21 AS build
4+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-alpine3.23 AS build
55

66
# Docker buildx supplies the value for this arg
77
ARG TARGETPLATFORM
@@ -37,7 +37,7 @@ RUN . /tmp/rid.txt && dotnet publish \
3737
###############################################
3838
# App stage #
3939
###############################################
40-
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.21
40+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.23
4141

4242
ARG TARGETPLATFORM
4343
LABEL com.bitwarden.product="bitwarden"

bitwarden_license/src/Sso/Sso.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Sso' " />
99
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Sso-SelfHost' " />
1010
<ItemGroup>
11-
<!-- This is a transitive dependency to Sustainsys.Saml2.AspNetCore2 -->
12-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
13-
1411
<PackageReference Include="Sustainsys.Saml2.AspNetCore2" Version="2.11.0" />
1512
</ItemGroup>
1613

bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ private DynamicAuthenticationScheme GetSaml2AuthenticationScheme(string name, Ss
406406
if (!string.IsNullOrWhiteSpace(config.IdpX509PublicCert))
407407
{
408408
var cert = CoreHelpers.Base64UrlDecode(config.IdpX509PublicCert);
409-
idp.SigningKeys.AddConfiguredKey(new X509Certificate2(cert));
409+
idp.SigningKeys.AddConfiguredKey(X509CertificateLoader.LoadCertificate(cert));
410410
}
411411
idp.ArtifactResolutionServiceUrls.Clear();
412412
// This must happen last since it calls Validate() internally.

bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/ServiceAccounts/ServiceAccountSecretsDetailsQueryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ public async Task GetManyByOrganizationId_CallsDifferentRepoMethods(
3838
if (includeAccessToSecrets)
3939
{
4040
await sutProvider.GetDependency<IServiceAccountRepository>().Received(1)
41-
.GetManyByOrganizationIdWithSecretsDetailsAsync(Arg.Is(AssertHelper.AssertPropertyEqual(mockSaDetails.ServiceAccount.OrganizationId)),
41+
.GetManyByOrganizationIdWithSecretsDetailsAsync(Arg.Is(AssertHelper.AssertPropertyEqual(organizationId)),
4242
Arg.Any<Guid>(), Arg.Any<AccessClientType>());
4343
}
4444
else
4545
{
4646
await sutProvider.GetDependency<IServiceAccountRepository>().Received(1)
47-
.GetManyByOrganizationIdAsync(Arg.Is(AssertHelper.AssertPropertyEqual(mockSa.OrganizationId)),
47+
.GetManyByOrganizationIdAsync(Arg.Is(AssertHelper.AssertPropertyEqual(organizationId)),
4848
Arg.Any<Guid>(), Arg.Any<AccessClientType>());
4949
Assert.Equal(0, result.First().AccessToSecrets);
5050
}

bitwarden_license/test/SSO.Test/SSO.Test.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
54
<ImplicitUsings>enable</ImplicitUsings>
65
<Nullable>enable</Nullable>
76

0 commit comments

Comments
 (0)