Skip to content

[PM-19332] Create InitPendingOrganizationCommand #5584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking โ€œSign up for GitHubโ€, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@
private readonly IPricingClient _pricingClient;
private readonly IConfirmOrganizationUserCommand _confirmOrganizationUserCommand;
private readonly IRestoreOrganizationUserCommand _restoreOrganizationUserCommand;
private readonly IInitPendingOrganizationCommand _initPendingOrganizationCommand;

public OrganizationUsersController(
IOrganizationRepository organizationRepository,
@@ -89,7 +90,8 @@
IFeatureService featureService,
IPricingClient pricingClient,
IConfirmOrganizationUserCommand confirmOrganizationUserCommand,
IRestoreOrganizationUserCommand restoreOrganizationUserCommand)
IRestoreOrganizationUserCommand restoreOrganizationUserCommand,
IInitPendingOrganizationCommand initPendingOrganizationCommand)
{
_organizationRepository = organizationRepository;
_organizationUserRepository = organizationUserRepository;
@@ -116,6 +118,7 @@
_pricingClient = pricingClient;
_confirmOrganizationUserCommand = confirmOrganizationUserCommand;
_restoreOrganizationUserCommand = restoreOrganizationUserCommand;
_initPendingOrganizationCommand = initPendingOrganizationCommand;
}

[HttpGet("{id}")]
@@ -313,7 +316,7 @@
throw new UnauthorizedAccessException();
}

await _organizationService.InitPendingOrganization(user, orgId, organizationUserId, model.Keys.PublicKey, model.Keys.EncryptedPrivateKey, model.CollectionName, model.Token);
await _initPendingOrganizationCommand.InitPendingOrganizationAsync(user, orgId, organizationUserId, model.Keys.PublicKey, model.Keys.EncryptedPrivateKey, model.CollectionName, model.Token);

Check warning on line 319 in src/Api/AdminConsole/Controllers/OrganizationUsersController.cs

Codecov / codecov/patch

src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L319

Added line #L319 was not covered by tests
await _acceptOrgUserCommand.AcceptOrgUserByEmailTokenAsync(organizationUserId, user, model.Token, _userService);
await _confirmOrganizationUserCommand.ConfirmUserAsync(orgId, organizationUserId, model.Key, user.Id);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
๏ปฟusing Bit.Core.AdminConsole.Enums;
using Bit.Core.AdminConsole.Services;
using Bit.Core.Auth.Models.Business.Tokenables;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Data;
using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Tokens;
using Microsoft.AspNetCore.DataProtection;

namespace Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers;

public class InitPendingOrganizationCommand : IInitPendingOrganizationCommand
{

private readonly IOrganizationService _organizationService;
private readonly ICollectionRepository _collectionRepository;
private readonly IOrganizationRepository _organizationRepository;
private readonly IDataProtectorTokenFactory<OrgUserInviteTokenable> _orgUserInviteTokenDataFactory;
private readonly IDataProtector _dataProtector;
private readonly IGlobalSettings _globalSettings;
private readonly IPolicyService _policyService;
private readonly IOrganizationUserRepository _organizationUserRepository;

public InitPendingOrganizationCommand(
IOrganizationService organizationService,
ICollectionRepository collectionRepository,
IOrganizationRepository organizationRepository,
IDataProtectorTokenFactory<OrgUserInviteTokenable> orgUserInviteTokenDataFactory,
IDataProtectionProvider dataProtectionProvider,
IGlobalSettings globalSettings,
IPolicyService policyService,
IOrganizationUserRepository organizationUserRepository
)
{
_organizationService = organizationService;
_collectionRepository = collectionRepository;
_organizationRepository = organizationRepository;
_orgUserInviteTokenDataFactory = orgUserInviteTokenDataFactory;
_dataProtector = dataProtectionProvider.CreateProtector(OrgUserInviteTokenable.DataProtectorPurpose);
_globalSettings = globalSettings;
_policyService = policyService;
_organizationUserRepository = organizationUserRepository;
}

public async Task InitPendingOrganizationAsync(User user, Guid organizationId, Guid organizationUserId, string publicKey, string privateKey, string collectionName, string emailToken)
{
await ValidateSignUpPoliciesAsync(user.Id);

var orgUser = await _organizationUserRepository.GetByIdAsync(organizationUserId);
if (orgUser == null)
{
throw new BadRequestException("User invalid.");

Check warning on line 57 in src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs

Codecov / codecov/patch

src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs#L56-L57

Added lines #L56 - L57 were not covered by tests
}

var tokenValid = ValidateInviteToken(orgUser, user, emailToken);

if (!tokenValid)
{
throw new BadRequestException("Invalid token");

Check warning on line 64 in src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs

Codecov / codecov/patch

src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs#L63-L64

Added lines #L63 - L64 were not covered by tests
}

var org = await _organizationRepository.GetByIdAsync(organizationId);

if (org.Enabled)
{
throw new BadRequestException("Organization is already enabled.");
}

if (org.Status != OrganizationStatusType.Pending)
{
throw new BadRequestException("Organization is not on a Pending status.");
}

if (!string.IsNullOrEmpty(org.PublicKey))
{
throw new BadRequestException("Organization already has a Public Key.");
}

if (!string.IsNullOrEmpty(org.PrivateKey))
{
throw new BadRequestException("Organization already has a Private Key.");
}

org.Enabled = true;
org.Status = OrganizationStatusType.Created;
org.PublicKey = publicKey;
org.PrivateKey = privateKey;

await _organizationService.UpdateAsync(org);

if (!string.IsNullOrWhiteSpace(collectionName))
{
// give the owner Can Manage access over the default collection
List<CollectionAccessSelection> defaultOwnerAccess =
[new CollectionAccessSelection { Id = orgUser.Id, HidePasswords = false, ReadOnly = false, Manage = true }];

var defaultCollection = new Collection
{
Name = collectionName,
OrganizationId = org.Id
};
await _collectionRepository.CreateAsync(defaultCollection, null, defaultOwnerAccess);
}
}

private async Task ValidateSignUpPoliciesAsync(Guid ownerId)
{
var anySingleOrgPolicies = await _policyService.AnyPoliciesApplicableToUserAsync(ownerId, PolicyType.SingleOrg);
if (anySingleOrgPolicies)
{
throw new BadRequestException("You may not create an organization. You belong to an organization " +
"which has a policy that prohibits you from being a member of any other organization.");

Check warning on line 117 in src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs

Codecov / codecov/patch

src/Core/AdminConsole/OrganizationFeatures/Organizations/InitPendingOrganizationCommand.cs#L115-L117

Added lines #L115 - L117 were not covered by tests
}
}

private bool ValidateInviteToken(OrganizationUser orgUser, User user, string emailToken)
{
var tokenValid = OrgUserInviteTokenable.ValidateOrgUserInviteStringToken(
_orgUserInviteTokenDataFactory, emailToken, orgUser);

return tokenValid;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
๏ปฟusing Bit.Core.Entities;
namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces;

public interface IInitPendingOrganizationCommand
{
/// <summary>
/// Accept an invitation to initialize and join an organization created via the Admin Portal
/// </summary>
Task InitPendingOrganizationAsync(User user, Guid organizationId, Guid organizationUserId, string publicKey, string privateKey, string collectionName, string emailToken);
}
1 change: 0 additions & 1 deletion src/Core/AdminConsole/Services/IOrganizationService.cs
Original file line number Diff line number Diff line change
@@ -54,7 +54,6 @@ Task<List<Tuple<OrganizationUser, string>>> RevokeUsersAsync(Guid organizationId
/// <remarks>
/// This method must target a disabled Organization that has null keys and status as 'Pending'.
/// </remarks>
Task InitPendingOrganization(User user, Guid organizationId, Guid organizationUserId, string publicKey, string privateKey, string collectionName, string emailToken);
Task ReplaceAndUpdateCacheAsync(Organization org, EventType? orgEvent = null);

void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade);
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@
using Bit.Core.AdminConsole.Repositories;
using Bit.Core.AdminConsole.Services;
using Bit.Core.Auth.Enums;
using Bit.Core.Auth.Models.Business.Tokenables;
using Bit.Core.Auth.Repositories;
using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces;
using Bit.Core.Billing.Constants;
@@ -31,12 +30,10 @@
using Bit.Core.Platform.Push;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Tokens;
using Bit.Core.Tools.Enums;
using Bit.Core.Tools.Models.Business;
using Bit.Core.Tools.Services;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Extensions.Logging;
using Stripe;
using OrganizationUserInvite = Bit.Core.Models.Business.OrganizationUserInvite;
@@ -77,8 +74,6 @@ public class OrganizationService : IOrganizationService
private readonly IPricingClient _pricingClient;
private readonly IPolicyRequirementQuery _policyRequirementQuery;
private readonly ISendOrganizationInvitesCommand _sendOrganizationInvitesCommand;
private readonly IDataProtectorTokenFactory<OrgUserInviteTokenable> _orgUserInviteTokenDataFactory;
private readonly IDataProtector _dataProtector;

public OrganizationService(
IOrganizationRepository organizationRepository,
@@ -112,9 +107,7 @@ public OrganizationService(
IHasConfirmedOwnersExceptQuery hasConfirmedOwnersExceptQuery,
IPricingClient pricingClient,
IPolicyRequirementQuery policyRequirementQuery,
ISendOrganizationInvitesCommand sendOrganizationInvitesCommand,
IDataProtectorTokenFactory<OrgUserInviteTokenable> orgUserInviteTokenDataFactory,
IDataProtectionProvider dataProtectionProvider
ISendOrganizationInvitesCommand sendOrganizationInvitesCommand
)
{
_organizationRepository = organizationRepository;
@@ -149,8 +142,6 @@ IDataProtectionProvider dataProtectionProvider
_pricingClient = pricingClient;
_policyRequirementQuery = policyRequirementQuery;
_sendOrganizationInvitesCommand = sendOrganizationInvitesCommand;
_orgUserInviteTokenDataFactory = orgUserInviteTokenDataFactory;
_dataProtector = dataProtectionProvider.CreateProtector(OrgUserInviteTokenable.DataProtectorPurpose);
}

public async Task ReplacePaymentMethodAsync(Guid organizationId, string paymentToken,
@@ -1921,71 +1912,4 @@ await _referenceEventService.RaiseEventAsync(new ReferenceEvent(ReferenceEventTy
SalesAssistedTrialStarted = salesAssistedTrialStarted,
});
}

public async Task InitPendingOrganization(User user, Guid organizationId, Guid organizationUserId, string publicKey, string privateKey, string collectionName, string emailToken)
{
await ValidateSignUpPoliciesAsync(user.Id);

var orgUser = await _organizationUserRepository.GetByIdAsync(organizationUserId);
if (orgUser == null)
{
throw new BadRequestException("User invalid.");
}

// TODO: PM-4142 - remove old token validation logic once 3 releases of backwards compatibility are complete
var newTokenValid = OrgUserInviteTokenable.ValidateOrgUserInviteStringToken(
_orgUserInviteTokenDataFactory, emailToken, orgUser);

var tokenValid = newTokenValid ||
CoreHelpers.UserInviteTokenIsValid(_dataProtector, emailToken, user.Email, orgUser.Id,
_globalSettings);

if (!tokenValid)
{
throw new BadRequestException("Invalid token.");
}

var org = await GetOrgById(organizationId);

if (org.Enabled)
{
throw new BadRequestException("Organization is already enabled.");
}

if (org.Status != OrganizationStatusType.Pending)
{
throw new BadRequestException("Organization is not on a Pending status.");
}

if (!string.IsNullOrEmpty(org.PublicKey))
{
throw new BadRequestException("Organization already has a Public Key.");
}

if (!string.IsNullOrEmpty(org.PrivateKey))
{
throw new BadRequestException("Organization already has a Private Key.");
}

org.Enabled = true;
org.Status = OrganizationStatusType.Created;
org.PublicKey = publicKey;
org.PrivateKey = privateKey;

await UpdateAsync(org);

if (!string.IsNullOrWhiteSpace(collectionName))
{
// give the owner Can Manage access over the default collection
List<CollectionAccessSelection> defaultOwnerAccess =
[new CollectionAccessSelection { Id = organizationUserId, HidePasswords = false, ReadOnly = false, Manage = true }];

var defaultCollection = new Collection
{
Name = collectionName,
OrganizationId = org.Id
};
await _collectionRepository.CreateAsync(defaultCollection, null, defaultOwnerAccess);
}
}
}
Original file line number Diff line number Diff line change
@@ -193,6 +193,7 @@ private static void AddOrganizationUserCommandsQueries(this IServiceCollection s
services.AddScoped<IInviteUsersOrganizationValidator, InviteUsersOrganizationValidator>();
services.AddScoped<IInviteUsersPasswordManagerValidator, InviteUsersPasswordManagerValidator>();
services.AddScoped<IInviteUsersEnvironmentValidator, InviteUsersEnvironmentValidator>();
services.AddScoped<IInitPendingOrganizationCommand, InitPendingOrganizationCommand>();
}

// TODO: move to OrganizationSubscriptionServiceCollectionExtensions when OrganizationUser methods are moved out of
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
๏ปฟusing Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers;
using Bit.Core.Auth.Models.Business.Tokenables;
using Bit.Core.Entities;
using Bit.Core.Exceptions;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Tokens;
using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes;
using Bit.Test.Common.Fakes;
using NSubstitute;
using Xunit;

namespace Bit.Core.Test.AdminConsole.OrganizationFeatures.Organizations;

[SutProviderCustomize]
public class InitPendingOrganizationCommandTests
{

private readonly IOrgUserInviteTokenableFactory _orgUserInviteTokenableFactory = Substitute.For<IOrgUserInviteTokenableFactory>();
private readonly IDataProtectorTokenFactory<OrgUserInviteTokenable> _orgUserInviteTokenDataFactory = new FakeDataProtectorTokenFactory<OrgUserInviteTokenable>();

[Theory, BitAutoData]
public async Task Init_Organization_Success(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, OrganizationUser orgUser)
{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

org.PrivateKey = null;
org.PublicKey = null;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var organizationServcie = sutProvider.GetDependency<IOrganizationService>();
var collectionRepository = sutProvider.GetDependency<ICollectionRepository>();

await sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, "", token);

await organizationRepository.Received().GetByIdAsync(orgId);
await organizationServcie.Received().UpdateAsync(org);
await collectionRepository.DidNotReceiveWithAnyArgs().CreateAsync(default);

}

[Theory, BitAutoData]
public async Task Init_Organization_With_CollectionName_Success(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, string collectionName, OrganizationUser orgUser)
{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);
org.PrivateKey = null;
org.PublicKey = null;
org.Id = orgId;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var organizationServcie = sutProvider.GetDependency<IOrganizationService>();
var collectionRepository = sutProvider.GetDependency<ICollectionRepository>();

await sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, collectionName, token);

await organizationRepository.Received().GetByIdAsync(orgId);
await organizationServcie.Received().UpdateAsync(org);

await collectionRepository.Received().CreateAsync(
Arg.Any<Collection>(),
Arg.Is<List<CollectionAccessSelection>>(l => l == null),
Arg.Is<List<CollectionAccessSelection>>(l => l.Any(i => i.Manage == true)));

}

[Theory, BitAutoData]
public async Task Init_Organization_When_Organization_Is_Enabled(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, OrganizationUser orgUser)

{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

org.Enabled = true;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, "", token));

Assert.Equal("Organization is already enabled.", exception.Message);

}

[Theory, BitAutoData]
public async Task Init_Organization_When_Organization_Is_Not_Pending(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, OrganizationUser orgUser)

{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

org.Status = Enums.OrganizationStatusType.Created;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, "", token));

Assert.Equal("Organization is not on a Pending status.", exception.Message);

}

[Theory, BitAutoData]
public async Task Init_Organization_When_Organization_Has_Public_Key(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, OrganizationUser orgUser)

{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

org.PublicKey = publicKey;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, "", token));

Assert.Equal("Organization already has a Public Key.", exception.Message);

}

[Theory, BitAutoData]
public async Task Init_Organization_When_Organization_Has_Private_Key(User user, Guid orgId, Guid orgUserId, string publicKey,
string privateKey, SutProvider<InitPendingOrganizationCommand> sutProvider, Organization org, OrganizationUser orgUser)

{
sutProvider.SetDependency(_orgUserInviteTokenDataFactory, "orgUserInviteTokenDataFactory");
sutProvider.Create();

_orgUserInviteTokenableFactory.CreateToken(orgUser).Returns(new OrgUserInviteTokenable(orgUser)
{
ExpirationDate = DateTime.UtcNow.Add(TimeSpan.FromDays(5))
});

var token = CreateToken(orgUser);
sutProvider.GetDependency<IOrganizationUserRepository>().GetByIdAsync(orgUserId).Returns(orgUser);

org.PublicKey = null;
org.PrivateKey = privateKey;
org.Enabled = false;

var organizationRepository = sutProvider.GetDependency<IOrganizationRepository>();
organizationRepository.GetByIdAsync(orgId).Returns(org);

var exception = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.InitPendingOrganizationAsync(user, orgId, orgUserId, publicKey, privateKey, "", token));

Assert.Equal("Organization already has a Private Key.", exception.Message);

}

public string CreateToken(OrganizationUser orgUser)
{
var orgUserInviteTokenable = _orgUserInviteTokenableFactory.CreateToken(orgUser);
var protectedToken = _orgUserInviteTokenDataFactory.Protect(orgUserInviteTokenable);

return protectedToken;
}
}

Unchanged files with check annotations Beta

/// occurring between IUserService, which extends the UserManager<User>, and the usage of the
/// UserManager<User> within this class. Trying to resolve the IUserService using the DI pipeline
/// will not allow the server to start and it will hang and give no helpful indication as to the problem.
/// </summary>

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Quality scan

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Run tests

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'

Check warning on line 23 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Upload

XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'User'.'
private readonly IServiceProvider _serviceProvider = serviceProvider;

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Quality scan

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Quality scan

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Run tests

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Run tests

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Upload

XML comment has badly formed XML -- 'Expected an end tag for element 'User'.'

Check warning on line 24 in src/Core/Auth/Identity/TokenProviders/DuoUniversalTokenProvider.cs

GitHub Actions / Upload

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'
private readonly IDataProtectorTokenFactory<DuoUserStateTokenable> _tokenDataFactory = tokenDataFactory;
private readonly IDuoUniversalTokenService _duoUniversalTokenService = duoUniversalTokenService;
public class PaymentHistoryService(
IStripeAdapter stripeAdapter,
ITransactionRepository transactionRepository,
ILogger<PaymentHistoryService> logger) : IPaymentHistoryService

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Setup, ./util)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Billing, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Notifications, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Api, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Events, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Icons, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Identity, ./src)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Quality scan

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Run tests

Parameter 'logger' is unread.

Check warning on line 15 in src/Core/Billing/Services/Implementations/PaymentHistoryService.cs

GitHub Actions / Upload

Parameter 'logger' is unread.
{
public async Task<IEnumerable<BillingHistoryInfo.BillingInvoice>> GetInvoiceHistoryAsync(
ISubscriber subscriber,
return false;
}
private async Task<bool> CanAccessUnassignedCiphersAsync(CurrentContextOrganization org)

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Setup, ./util)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Billing, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Notifications, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Api, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Events, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Icons, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Identity, ./src)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Quality scan

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Run tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 86 in src/Core/Vault/Queries/GetCipherPermissionsForUserQuery.cs

GitHub Actions / Upload

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
if (org is
{ Type: OrganizationUserType.Owner or OrganizationUserType.Admin } or
/// <param name="key">The encrypted organization key for the user.</param>
/// <param name="confirmingUserId">The ID of the user performing the confirmation.</param>
/// <returns>The confirmed organization user.</returns>
/// <exception cref="BadRequestException">Thrown when the user is not valid or cannot be confirmed.</exception>

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Quality scan

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Run tests

XML comment has cref attribute 'BadRequestException' that could not be resolved

Check warning on line 18 in src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/Interfaces/IConfirmOrganizationUserCommand.cs

GitHub Actions / Upload

XML comment has cref attribute 'BadRequestException' that could not be resolved
Task<OrganizationUser> ConfirmUserAsync(Guid organizationId, Guid organizationUserId, string key, Guid confirmingUserId);
/// <summary>
int seatAdjustment);
/// <summary>
/// Determines whether the provided <paramref name="seatAdjustment"/> will result in a purchase for the <paramref name="provider"/>'s <see cref="planType"/>.

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Quality scan

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Run tests

XML comment has cref attribute 'planType' that could not be resolved

Check warning on line 62 in src/Core/Billing/Services/IProviderBillingService.cs

GitHub Actions / Upload

XML comment has cref attribute 'planType' that could not be resolved
/// Seat adjustments that result in purchases include:
/// <list type="bullet">
/// <item>The <paramref name="provider"/> going from below the seat minimum to above the seat minimum for the provided <paramref name="planType"/></item>
/// organization role, any collection management settings on the organization, or special unassigned cipher
/// permissions.
///
/// Recommended to use <see cref="IGetCipherPermissionsForUserQuery"/> instead to handle those cases.

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build MSSQL migrator utility (win-x64)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (MsSqlMigratorUtility, ./util, true)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build MSSQL migrator utility (osx-x64)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Setup, ./util)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build MSSQL migrator utility (linux-x64)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Billing, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Notifications, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Api, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Events, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Icons, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Identity, ./src)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Quality scan

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Run tests

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved

Check warning on line 48 in src/Core/Vault/Repositories/ICipherRepository.cs

GitHub Actions / Upload

XML comment has cref attribute 'IGetCipherPermissionsForUserQuery' that could not be resolved
/// </summary>
Task<ICollection<OrganizationCipherPermission>> GetCipherPermissionsForOrganizationAsync(Guid organizationId,
Guid userId);
_globalSettings = globalSettings;
}
public DeviceRepository(string connectionString, string readOnlyConnectionString)

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Billing, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Notifications, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Api, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Events, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Icons, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Identity, ./src)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Quality scan

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Run tests

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in src/Infrastructure.Dapper/Repositories/DeviceRepository.cs

GitHub Actions / Upload

Non-nullable field '_globalSettings' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
: base(connectionString, readOnlyConnectionString)
{ }
// Shadow property - to be introduced by https://bitwarden.atlassian.net/browse/PM-11129
// This isn't a value or entity used by self hosted servers, but it's
// being added for synchronicity between database provider options.
public DateTime? LastActivityDate { get; set; }

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Billing, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Notifications, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Api, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Scim, ./bitwarden_license/src, true)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Events, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (EventsProcessor, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Icons, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Sso, ./bitwarden_license/src, true)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Identity, ./src)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Quality scan

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Build artifacts (Admin, ./src, true)

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Run tests

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.

Check warning on line 11 in src/Infrastructure.EntityFramework/Platform/Installations/Models/Installation.cs

GitHub Actions / Upload

'Installation.LastActivityDate' hides inherited member 'Installation.LastActivityDate'. Use the new keyword if hiding was intended.
}
public class InstallationMapperProfile : Profile