ROX-33599: Migrate sensitive Cypress.env() to cy.env()#19965
Draft
ROX-33599: Migrate sensitive Cypress.env() to cy.env()#19965
Conversation
Cypress 15.10.0 deprecated Cypress.env() for sensitive values in favor of cy.env(), which avoids hydrating secrets into the browser context. Migrate all ROX_AUTH_TOKEN and OCP credential reads to the async cy.env() API. Restructure basicAuth.js to read the token inside beforeEach instead of at describe-level scope. Delete unused tryDeleteIntegration helper. Non-sensitive values remain on Cypress.env() for ROX-33598. Partially generated by AI. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
|
Skipping CI for Draft Pull Request. |
Contributor
🚀 Build Images ReadyImages are ready for commit 08711da. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-636-g08711da9b0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19965 +/- ##
=======================================
Coverage 49.56% 49.56%
=======================================
Files 2764 2764
Lines 208357 208422 +65
=======================================
+ Hits 103276 103310 +34
- Misses 97430 97457 +27
- Partials 7651 7655 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace `res: any` with `Cypress.Response<{ items: ClusterRegistrationSecret[] }>`
using the existing type from ClustersService, restoring type safety for
downstream destructured variables.
Note: partially generated by AI
Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Suppress password input from Cypress command log, screenshots,
and video recordings by passing `{ log: false }` to `.type()`.
Note: this change was partially generated by AI.
Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Without this, a missing token causes the beforeEach hook to silently skip auth setup, leading to confusing "unauthorized" test failures that don't point to the actual root cause. Note: this change was partially generated by AI. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Jira: ROX-33599
Cypress 15.10.0 deprecated
Cypress.env()for sensitive values in favor ofcy.env(), which avoids hydrating secrets into the browser context. This PR migrates all sensitiveCypress.env()calls (auth tokens, OCP credentials) to the new asynccy.env()API.ROX_AUTH_TOKENreads insidecy.env().then()across 8 helper filesOCP_BRIDGE_AUTH_DISABLED,OPENSHIFT_CONSOLE_USERNAME,OPENSHIFT_CONSOLE_PASSWORD) into a singlecy.env()call inocpAuth.tsbasicAuth.jsto always registerbeforeEach(no-op when token is absent)tryDeleteIntegrationfunction fromintegrations.helpers.jsanylog: false)cy.logwarning inbasicAuthwhenROX_AUTH_TOKENis absentNon-sensitive values (
ORCHESTRATOR_FLAVOR, feature flags,AXE_CORE_PATH) remain onCypress.env()and will be migrated toCypress.expose()in ROX-33598.User-facing documentation
Testing and quality
Automated testing
How I validated my change
Cypress.env('ROX_AUTH_TOKEN')and OCP credential calls remainCypress.env()calls are only non-sensitive values (out of scope, ROX-33598)