Skip to content

[tests-only] test: Cleanup OTP Credentials after MFA - #12853

Merged
ishabaral merged 2 commits into
owncloud:masterfrom
kavitagautam:test/cleanup-otp-credentials-after-mfa
Sep 3, 2026
Merged

[tests-only] test: Cleanup OTP Credentials after MFA#12853
ishabaral merged 2 commits into
owncloud:masterfrom
kavitagautam:test/cleanup-otp-credentials-after-mfa

Conversation

@kavitagautam

@kavitagautam kavitagautam commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds cleanup of existing OTP/TOTP credentials for the Keycloak admin user before and after E2E tests.

  • Added beforeEach cleanup to remove existing OTP/TOTP credentials before each Keycloak test.
  • Added afterEach cleanup to remove OTP/TOTP credentials created during the test.
  • Set the Keycloak access token before performing the cleanup.
  • Updated deleteUserTotpCredentials() to resolve the Keycloak user UUID by username instead of relying on keycloakCreatedUser.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

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)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs

update-docs Bot commented Aug 27, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kw-security

kw-security commented Aug 27, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kavitagautam kavitagautam changed the title test: Cleanup OTP Credentials after MFA [tests-only] test: Cleanup OTP Credentials after MFA Aug 27, 2026
@kavitagautam
kavitagautam force-pushed the test/cleanup-otp-credentials-after-mfa branch from d0ef2b6 to 5857489 Compare August 27, 2026 11:04
@kavitagautam
kavitagautam force-pushed the test/cleanup-otp-credentials-after-mfa branch 4 times, most recently from 53796b4 to c4f4ca6 Compare September 1, 2026 10:57
@kavitagautam
kavitagautam marked this pull request as ready for review September 1, 2026 11:02
@kavitagautam
kavitagautam requested a review from a team as a code owner September 1, 2026 11:02
@kavitagautam
kavitagautam marked this pull request as draft September 1, 2026 11:02
@kavitagautam
kavitagautam marked this pull request as ready for review September 1, 2026 11:24
Comment thread web/tests/e2e/support/api/keycloak/user.ts
Comment thread web/tests/e2e/support/api/keycloak/user.ts Outdated
Comment thread web/tests/e2e/support/api/keycloak/user.ts Outdated
Comment thread web/tests/e2e/environment/test.ts Outdated
Comment thread web/tests/e2e/environment/test.ts Outdated
@kavitagautam
kavitagautam force-pushed the test/cleanup-otp-credentials-after-mfa branch from c4f4ca6 to 177fe0b Compare September 2, 2026 06:52
@kavitagautam
kavitagautam force-pushed the test/cleanup-otp-credentials-after-mfa branch from 177fe0b to e709b0f Compare September 2, 2026 06:55

@PrajwolAmatya PrajwolAmatya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, lets wait for Trivy scan to be fixed. 👍

@kavitagautam
kavitagautam force-pushed the test/cleanup-otp-credentials-after-mfa branch from e709b0f to 895d15a Compare September 2, 2026 10:56
@ishabaral
ishabaral merged commit 9dcd26a into owncloud:master Sep 3, 2026
204 of 209 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants