Skip to content
Merged
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
10 changes: 10 additions & 0 deletions src/Api/Controllers/OrganizationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,16 @@ public async Task<ApiKeyResponseModel> ApiKey(string id, [FromBody] Organization
throw new NotFoundException();
}

if (model.Type == OrganizationApiKeyType.BillingSync)
{
// Non-enterprise orgs should not be able to create or view an apikey of billing sync key type
var plan = StaticStore.GetPlan(organization.PlanType);
if (plan.Product != ProductType.Enterprise)
{
throw new NotFoundException();
}
}

var organizationApiKey = await _getOrganizationApiKeyCommand
.GetOrganizationApiKeyAsync(organization.Id, model.Type);

Expand Down