Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added admin audit log for admin config integration setup #640

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

SagarGi
Copy link
Collaborator

@SagarGi SagarGi commented May 21, 2024

Description

This PR:

  • Adds a way to log every activities regarding the admin integration configuration to log them in audit.log file in the Nextcloud data.

Note: This PR does not implement the info warning in the UI. Since it is dependent to this bump PR: #654.

Related Issue or Workpackage

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@SagarGi SagarGi force-pushed the integration/admin_audit_log branch 2 times, most recently from 516edac to a99051f Compare May 22, 2024 04:03
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch from a99051f to b3d6c6f Compare June 4, 2024 11:10
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch 3 times, most recently from f258dbd to 34c33d8 Compare June 12, 2024 04:04
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch from 34c33d8 to c9212dc Compare June 21, 2024 04:14
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch from c9212dc to 23c7858 Compare June 21, 2024 04:23
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch from 179f9ff to 2e6fd3c Compare June 21, 2024 06:22
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch 2 times, most recently from 26cf9f5 to 290affb Compare June 23, 2024 11:03
@SagarGi SagarGi self-assigned this Jun 23, 2024
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the integration/admin_audit_log branch from 290affb to df4c298 Compare June 23, 2024 11:12
@SagarGi SagarGi marked this pull request as ready for review June 23, 2024 11:12
Copy link
Collaborator

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something we want to have in 2.6 or only in 2.7?

@SagarGi
Copy link
Collaborator Author

SagarGi commented Jun 24, 2024

is this something we want to have in 2.6 or only in 2.7?

we will be having a patch release.

tests/lib/Service/OpenProjectAPIServiceTest.php Outdated Show resolved Hide resolved
lib/Controller/OpenProjectAPIController.php Outdated Show resolved Hide resolved
lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
lib/Service/OpenProjectAPIService.php Outdated Show resolved Hide resolved
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi
Copy link
Collaborator Author

SagarGi commented Jun 26, 2024

@nabim777 can you manually test it once.

lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
lib/Controller/ConfigController.php Show resolved Hide resolved
lib/Controller/OpenProjectAPIController.php Outdated Show resolved Hide resolved
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Copy link

JS Code Coverage

Coverage after merging integration/admin_audit_log into master will be
87.30%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   adminSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   bootstrap.js0%0%0%0%1, 1–7
   dashboard.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   fileActions.js0%0%0%0%1, 1, 10–17, 2–9
   personalSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   projectTab.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–66, 7–9
   reference.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60, 7–9
   utils.js71.43%33.33%50%73.85%10–14, 17–26, 6–9
src/components
   AdminSettings.vue99.31%95.70%86.21%99.92%1, 1, 1, 1, 1
   OAuthConnectButton.vue99.21%87.50%100%100%1
   PersonalSettings.vue98.96%93.75%87.50%100%1
src/components/admin
   FieldValue.vue97.12%83.33%100%98.89%1, 23, 23
   FormHeading.vue97.66%75%100%99.36%1, 1, 34, 34
   ProjectFolderError.vue96.83%80%100%98.21%1, 1
   TermsOfServiceUnsigned.vue99.19%90%100%100%1
   TextInput.vue99.25%95%88.89%100%1
src/components/icons
   ClippyIcon.vue93.18%50%50%97.50%1, 1
   OpenProjectIcon.vue93.02%50%50%97.44%1, 1
src/components/settings
   CheckBox.vue92.45%80%66.67%97.62%1, 1
   SettingsTitle.vue97.73%80%100%98.77%1, 1
src/components/tab
   EmptyContent.vue96.09%72.73%100%99.35%1, 1, 1, 1, 1, 34, 34
   SearchInput.vue99.26%94.74%77.78%100%1
   WorkPackage.vue98.43%40%100%99.36%1, 1, 1, 43, 43
src/filesPlugin
   filesPlugin.js0%0%0%0%1, 1, 10, 100–104, 11–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99
   filesPluginLessThan28.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–78, 8–9
src/utils
   workpackageHelper.js93.39%91.11%88.89%94.15%153–154, 18–20, 49, 49–51, 94–99
src/views
   CreateWorkPackageModal.vue98.20%88.24%40%99.86%1, 1, 1, 1, 1
   Dashboard.vue98.97%71.43%100%99.65%1, 1, 1
   LinkMultipleFilesModal.vue99.67%94.12%100%100%1
   ProjectsTab.vue99.74%93.75%100%100%23
   WorkPackagePickerElement.vue0%0%0%0%1, 1, 10, 100–109, 11, 110–119, 12, 120–129, 13, 130–139, 14, 140–149, 15, 150–151, 16–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99
   WorkPackageReferenceWidget.vue0%0%0%0%1, 1, 10, 100–109, 11, 110–119, 12, 120–129, 13, 130–134, 14–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99

Copy link

PHP Code Coverage

Coverage after merging integration/admin_audit_log into master will be
59.88%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%19, 26–35
server/apps/integration_openproject/lib/AppInfo
   Application.php7.41%100%25%6%101, 103–106, 108, 110, 112, 116–119, 121–132, 134, 137, 141, 145–147, 74–76, 79–83, 85–90, 92–93, 96
server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%42, 44–46, 55–56
server/apps/integration_openproject/lib/Controller
   ConfigController.php64.76%100%50%65.37%135, 152–153, 155, 157–159, 161–164, 167–168, 170, 212, 222, 226–228, 292–296, 406–408, 410–412, 417–420, 461, 549–552, 554–555, 558, 566–570, 581, 595–598, 606–607, 611–614, 628–632, 634–635, 637–653, 670–675, 677–678, 680–682, 685, 687–703, 716–723, 725–728, 730–734, 743–748
   DirectDownloadController.php0%100%0%0%36–38, 53–55, 57–64
   DirectUploadController.php68.31%100%100%67.39%131–133, 177–179, 190, 194–197, 199, 209, 216, 232–234, 236–237, 240–245, 248, 250, 255–257, 263–265, 267–269, 271–273, 288–290, 309, 314, 320
   FilesController.php72.95%100%83.33%72.41%181–182, 244, 249–252, 254, 256–269, 272–273, 275–276, 280–283, 286, 292
   OpenProjectAPIController.php85.60%100%80%85.92%139, 180, 204, 230–233, 236–243, 245–249, 251, 263, 272, 290, 299, 367, 369, 419, 421, 441, 443, 490, 492, 518–521, 524–528, 530, 735–739, 96
server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%101, 108, 115–116, 118, 120–137, 69–73, 80, 87, 94
server/apps/integration_openproject/lib/Exception
   OpenprojectErrorException.php100%100%100%100%
   OpenprojectFileNotUploadedException.php100%100%100%100%
   OpenprojectGroupfolderSetupConflictException.php100%100%100%100%
   OpenprojectResponseException.php100%100%100%100%
   OpenprojectUnauthorizedUserException.php0%100%0%0%16
server/apps/integration_openproject/lib/Listener
   BeforeGroupDeletedListener.php0%100%0%0%48, 56–57, 60–63, 65
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%41–43, 47–50, 52, 54, 57–58, 60, 62–65, 67–70, 72–74
   BeforeUserDeletedListener.php0%100%0%0%48, 55–56, 58–61, 63
   LoadAdditionalScriptsListener.php0%100%0%0%17, 20–21, 24–26, 28
   LoadSidebarScript.php0%100%0%0%100, 102, 104–105, 107, 109, 111, 113–122, 75–91, 96–97, 99
   OpenProjectReferenceListener.php0%100%0%0%53–54, 57–58, 61–62, 64–67
   TermsOfServiceEventListener.php0%100%0%0%59–60, 65–66, 68–69, 71–73, 76–80
   UserChangedListener.php0%100%0%0%52, 59–60, 63–68, 71
server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%47, 57–65, 67–75, 77–79, 81
   Version2310Date20230116153411.php0%100%0%0%46, 49–52, 54–79, 81–82, 84
   Version2400Date20230504144300.php0%100%0%0%47, 57–60
server/apps/integration_openproject/lib/Reference
   WorkPackageReferenceProvider.php51.67%100%25%58.33%102, 108–111, 114–116, 119, 123, 157, 165–166, 174, 52, 59, 66, 73–75
server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%103–104, 107–118, 121–122, 124–125, 128–137, 139–143, 66–69, 76, 83, 91, 93, 96
   OpenProjectSearchResultEntry.php100%100%100%100%
server/apps/integration_openproject/lib/Service
   DatabaseService.php42.31%100%60%40.43%100–102, 125–129, 131, 80–93, 95–99
   DirectDownloadService.php88.46%100%100%87.50%65–66, 68
   DirectUploadService.php42.86%100%66.67%40%112, 118, 79–82, 84–92
   OauthService.php0%100%0%0%109–116, 45–47, 56–66, 68, 70–72, 74–80, 89–98
   OpenProjectAPIService.php74.93%100%75.93%74.85%1006–1008, 1010–1012, 1015–1019, 1021–1023, 1032–1035, 1038–1040, 1042, 1045–1050, 1054–1055, 1086–1089, 1108–1115, 1124–1125, 1132–1134, 1136–1139, 1143, 1152, 1170, 1172–1175, 1177–1182, 1323, 1335, 1338, 1360, 1363, 1373–1378, 1497–1499, 1501–1502, 1506–1507, 1509, 1511, 179–183, 254, 362–363, 365, 379–380, 389, 393,

Copy link
Collaborator

@nabim777 nabim777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually checked in server stable-26, 27, and 29 It works fine there

@SagarGi SagarGi merged commit 4fcd49e into master Jul 2, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants