diff --git a/src/Api/Controllers/OrganizationsController.cs b/src/Api/Controllers/OrganizationsController.cs index e1301e3f2513..3c8e938eb47d 100644 --- a/src/Api/Controllers/OrganizationsController.cs +++ b/src/Api/Controllers/OrganizationsController.cs @@ -763,37 +763,4 @@ public async Task PostSso(Guid id, [FromBody] Orga return new OrganizationSsoResponseModel(organization, _globalSettings, ssoConfig); } - - // This is a temporary endpoint to self-enroll in secrets manager - [SelfHosted(NotSelfHostedOnly = true)] - [HttpPost("{id}/enroll-secrets-manager")] - public async Task EnrollSecretsManager(Guid id, [FromBody] OrganizationEnrollSecretsManagerRequestModel model) - { - var userId = _userService.GetProperUserId(User).Value; - if (!await _currentContext.OrganizationAdmin(id)) - { - throw new NotFoundException(); - } - - var organization = await _organizationRepository.GetByIdAsync(id); - if (organization == null) - { - throw new NotFoundException(); - } - - organization.UseSecretsManager = model.Enabled; - organization.SecretsManagerBeta = model.Enabled; - await _organizationService.UpdateAsync(organization); - - // Turn on Secrets Manager for the user - if (model.Enabled) - { - var orgUser = await _organizationUserRepository.GetByOrganizationAsync(id, userId); - if (orgUser != null) - { - orgUser.AccessSecretsManager = true; - await _organizationUserRepository.ReplaceAsync(orgUser); - } - } - } } diff --git a/src/Api/Models/Request/Organizations/OrganizationEnrollSecretsManagerRequestModel.cs b/src/Api/Models/Request/Organizations/OrganizationEnrollSecretsManagerRequestModel.cs deleted file mode 100644 index 7befaa25c664..000000000000 --- a/src/Api/Models/Request/Organizations/OrganizationEnrollSecretsManagerRequestModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Bit.Api.Models.Request.Organizations; - -public class OrganizationEnrollSecretsManagerRequestModel -{ - public bool Enabled { get; set; } -}