Skip to content

Commit

Permalink
Delete SM beta enrolment endpoint (#3211)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat authored Aug 20, 2023
1 parent 1c3afcd commit f9452e7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
33 changes: 0 additions & 33 deletions src/Api/Controllers/OrganizationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -763,37 +763,4 @@ public async Task<OrganizationSsoResponseModel> 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);
}
}
}
}

This file was deleted.

0 comments on commit f9452e7

Please sign in to comment.