Merge pull request #2054 from automatisch/aut-1224

Split UpsertSamlAuthProvider mutation into two endpoints
This commit is contained in:
Ali BARIN
2024-09-03 11:42:05 +02:00
committed by GitHub
13 changed files with 400 additions and 111 deletions

View File

@@ -2,6 +2,8 @@ import { Router } from 'express';
import { authenticateUser } from '../../../../helpers/authentication.js';
import { authorizeAdmin } from '../../../../helpers/authorization.js';
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
import createSamlAuthProviderAction from '../../../../controllers/api/v1/admin/saml-auth-providers/create-saml-auth-provider.ee.js';
import updateSamlAuthProviderAction from '../../../../controllers/api/v1/admin/saml-auth-providers/update-saml-auth-provider.ee.js';
import getSamlAuthProvidersAction from '../../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-providers.ee.js';
import getSamlAuthProviderAction from '../../../../controllers/api/v1/admin/saml-auth-providers/get-saml-auth-provider.ee.js';
import getRoleMappingsAction from '../../../../controllers/api/v1/admin/saml-auth-providers/get-role-mappings.ee.js';
@@ -16,6 +18,14 @@ router.get(
getSamlAuthProvidersAction
);
router.post(
'/',
authenticateUser,
authorizeAdmin,
checkIsEnterprise,
createSamlAuthProviderAction
);
router.get(
'/:samlAuthProviderId',
authenticateUser,
@@ -32,4 +42,12 @@ router.get(
getRoleMappingsAction
);
router.patch(
'/:samlAuthProviderId',
authenticateUser,
authorizeAdmin,
checkIsEnterprise,
updateSamlAuthProviderAction
);
export default router;