1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Remove Business Portal (#1614)

This commit is contained in:
Oscar Hinton
2021-10-06 10:39:13 +02:00
committed by GitHub
parent fccfce1048
commit 79447b6671
107 changed files with 188 additions and 7196 deletions

View File

@ -684,25 +684,6 @@ namespace Bit.Api.Controllers
await _userService.ReinstatePremiumAsync(user);
}
[HttpGet("enterprise-portal-signin-token")]
[Authorize("Web")]
public async Task<string> GetEnterprisePortalSignInToken()
{
var user = await _userService.GetUserByPrincipalAsync(User);
if (user == null)
{
throw new UnauthorizedAccessException();
}
var token = await _userService.GenerateEnterprisePortalSignInTokenAsync(user);
if (token == null)
{
throw new BadRequestException("Cannot generate sign in token.");
}
return token;
}
[HttpGet("tax")]
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<TaxInfoResponseModel> GetTaxInfo()

View File

@ -30,6 +30,8 @@ namespace Bit.Api.Controllers
private readonly IUserService _userService;
private readonly IPaymentService _paymentService;
private readonly ICurrentContext _currentContext;
private readonly ISsoConfigRepository _ssoConfigRepository;
private readonly ISsoConfigService _ssoConfigService;
private readonly GlobalSettings _globalSettings;
public OrganizationsController(
@ -40,6 +42,8 @@ namespace Bit.Api.Controllers
IUserService userService,
IPaymentService paymentService,
ICurrentContext currentContext,
ISsoConfigRepository ssoConfigRepository,
ISsoConfigService ssoConfigService,
GlobalSettings globalSettings)
{
_organizationRepository = organizationRepository;
@ -49,6 +53,8 @@ namespace Bit.Api.Controllers
_userService = userService;
_paymentService = paymentService;
_currentContext = currentContext;
_ssoConfigRepository = ssoConfigRepository;
_ssoConfigService = ssoConfigService;
_globalSettings = globalSettings;
}
@ -599,5 +605,53 @@ namespace Bit.Api.Controllers
var org = await _organizationService.UpdateOrganizationKeysAsync(new Guid(id), model.PublicKey, model.EncryptedPrivateKey);
return new OrganizationKeysResponseModel(org);
}
[HttpGet("{id:guid}/sso")]
public async Task<OrganizationSsoResponseModel> GetSso(Guid id)
{
if (!await _currentContext.ManageSso(id))
{
throw new NotFoundException();
}
var organization = await _organizationRepository.GetByIdAsync(id);
if (organization == null)
{
throw new NotFoundException();
}
var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(id);
return new OrganizationSsoResponseModel(organization, _globalSettings, ssoConfig);
}
[HttpPost("{id:guid}/sso")]
public async Task<OrganizationSsoResponseModel> PostSso(Guid id, [FromBody]OrganizationSsoRequestModel model)
{
if (!await _currentContext.ManageSso(id))
{
throw new NotFoundException();
}
var organization = await _organizationRepository.GetByIdAsync(id);
if (organization == null)
{
throw new NotFoundException();
}
var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(id);
if (ssoConfig == null)
{
ssoConfig = model.ToSsoConfig(id);
}
else
{
ssoConfig = model.ToSsoConfig(ssoConfig);
}
await _ssoConfigService.SaveAsync(ssoConfig);
return new OrganizationSsoResponseModel(organization, _globalSettings, ssoConfig);
}
}
}

View File

@ -7,14 +7,12 @@
"admin": "http://localhost:62911",
"notifications": "http://localhost:61840",
"sso": "http://localhost:51822",
"portal": "http://localhost:52313",
"internalNotifications": "http://localhost:61840",
"internalAdmin": "http://localhost:62911",
"internalIdentity": "http://localhost:33656",
"internalApi": "http://localhost:4000",
"internalVault": "http://localhost:4001",
"internalSso": "http://localhost:51822",
"internalPortal": "http://localhost:52313"
"internalSso": "http://localhost:51822"
},
"attachment": {
"connectionString": "SECRET",

View File

@ -7,14 +7,12 @@
"admin": "https://admin.bitwarden.com",
"notifications": "https://notifications.bitwarden.com",
"sso": "https://sso.bitwarden.com",
"portal": "http://portal.bitwarden.com",
"internalNotifications": "https://notifications.bitwarden.com",
"internalAdmin": "https://admin.bitwarden.com",
"internalIdentity": "https://identity.bitwarden.com",
"internalApi": "https://api.bitwarden.com",
"internalVault": "https://vault.bitwarden.com",
"internalSso": "https://sso.bitwarden.com",
"internalPortal": "https://portal.bitwarden.com"
"internalSso": "https://sso.bitwarden.com"
},
"braintree": {
"production": true

View File

@ -7,14 +7,12 @@
"admin": "https://admin.qa.bitwarden.pw",
"notifications": "https://notifications.qa.bitwarden.pw",
"sso": "https://sso.qa.bitwarden.pw",
"portal": "http://portal.qa.bitwarden.pw",
"internalNotifications": "https://notifications.qa.bitwarden.pw",
"internalAdmin": "https://admin.qa.bitwarden.pw",
"internalIdentity": "https://identity.qa.bitwarden.pw",
"internalApi": "https://api.qa.bitwarden.pw",
"internalVault": "https://vault.qa.bitwarden.pw",
"internalSso": "https://sso.qa.bitwarden.pw",
"internalPortal": "https://portal.qa.bitwarden.pw"
"internalSso": "https://sso.qa.bitwarden.pw"
},
"braintree": {
"production": false

View File

@ -7,14 +7,12 @@
"admin": null,
"notifications": null,
"sso": null,
"portal": null,
"internalNotifications": null,
"internalAdmin": null,
"internalIdentity": null,
"internalApi": null,
"internalVault": null,
"internalSso": null,
"internalPortal": null
"internalSso": null
}
}
}