Bläddra i källkod

add saml auth update activity

keigo-h 3 år sedan
förälder
incheckning
ee2bd02536

+ 3 - 0
packages/app/src/interfaces/activity.ts

@@ -50,6 +50,7 @@ const ACTION_ADMIN_REJECT_SHARE_LINK = 'ADMIN_REJECT_SHARE_LINK';
 const ACTION_ADMIN_DELETE_ALL_SHARE_LINK = 'ADMIN_DELETE_ALL_SHARE_LINK';
 const ACTION_ADMIN_AUTH_ID_PASS_UPDATE = 'ADMIN_AUTH_ID_PASS_UPDATE';
 const ACTION_ADMIN_AUTH_LDAP_UPDATE = 'ADMIN_AUTH_LDAP_UPDATE';
+const ACTION_ADMIN_AUTH_SAML_UPDATE = 'ADMIN_AUTH_SAML_UPDATE';
 const ACTION_ADMIN_LINE_BREAK_UPDATE = 'ADMIN_LINE_BREAK_UPDATE';
 const ACTION_ADMIN_LAYOUT_UPDATE = 'ADMIN_LAYOUT_UPDATE';
 const ACTION_ADMIN_ARCHIVE_DATA_UPLOAD = 'ADMIN_ARCHIVE_DATA_UPLOAD';
@@ -118,6 +119,7 @@ export const SupportedAction = {
   ACTION_ADMIN_DELETE_ALL_SHARE_LINK,
   ACTION_ADMIN_AUTH_ID_PASS_UPDATE,
   ACTION_ADMIN_AUTH_LDAP_UPDATE,
+  ACTION_ADMIN_AUTH_SAML_UPDATE,
   ACTION_ADMIN_LINE_BREAK_UPDATE,
   ACTION_ADMIN_LAYOUT_UPDATE,
   ACTION_ADMIN_ARCHIVE_DATA_UPLOAD,
@@ -206,6 +208,7 @@ export const LargeActionGroup = {
   ACTION_ADMIN_DELETE_ALL_SHARE_LINK,
   ACTION_ADMIN_AUTH_ID_PASS_UPDATE,
   ACTION_ADMIN_AUTH_LDAP_UPDATE,
+  ACTION_ADMIN_AUTH_SAML_UPDATE,
   ACTION_ADMIN_LINE_BREAK_UPDATE,
   ACTION_ADMIN_LAYOUT_UPDATE,
   ACTION_ADMIN_ARCHIVE_DATA_UPLOAD,

+ 3 - 1
packages/app/src/server/routes/apiv3/security-setting.js

@@ -891,7 +891,7 @@ module.exports = (crowi) => {
    *                schema:
    *                  $ref: '#/components/schemas/SamlAuthSetting'
    */
-  router.put('/saml', loginRequiredStrictly, adminRequired, csrf, validator.samlAuth, apiV3FormValidator, async(req, res) => {
+  router.put('/saml', loginRequiredStrictly, adminRequired, csrf, addActivity, validator.samlAuth, apiV3FormValidator, async(req, res) => {
 
     //  For the value of each mandatory items,
     //  check whether it from the environment variables is empty and form value to update it is empty
@@ -952,6 +952,8 @@ module.exports = (crowi) => {
         isSameEmailTreatedAsIdenticalUser: await crowi.configManager.getConfig('crowi', 'security:passport-saml:isSameEmailTreatedAsIdenticalUser'),
         samlABLCRule: await crowi.configManager.getConfig('crowi', 'security:passport-saml:ABLCRule'),
       };
+      const parameters = { action: SupportedAction.ACTION_ADMIN_AUTH_SAML_UPDATE };
+      activityEvent.emit('update', res.locals.activity._id, parameters);
       return res.apiv3({ securitySettingParams });
     }
     catch (err) {