Skip to content

AB#117017 Sanitize session URL by removing sensitive query parameters…#21

Open
sebastianchristopher wants to merge 1 commit intomasterfrom
AB#117017
Open

AB#117017 Sanitize session URL by removing sensitive query parameters…#21
sebastianchristopher wants to merge 1 commit intomasterfrom
AB#117017

Conversation

@sebastianchristopher
Copy link
Copy Markdown
Contributor

… in login function.

This is important if we ever move to publicly hosted deployment test reports

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Playwright deployment test utilities to prevent sensitive query parameters from appearing in session URLs used during the LTI login flow, reducing the risk of leaking secrets in publicly hosted test artifacts/reports.

Changes:

  • Refactors login to use async/await instead of chained promises.
  • Parses json.session_url as a URL and attempts to remove sensitive query parameters before navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/testUtils.js
Comment on lines +29 to +36
const sessionUrl = new URL(json.session_url)

// remove anything sensitive before using it for navigation/logging
sessionUrl.searchParams.delete('session_token')
sessionUrl.searchParams.delete('token')
sessionUrl.searchParams.delete('code')

await page.goto(sessionUrl.toString())
Comment thread src/testUtils.js
Comment on lines +21 to +30
const response = await request.get(`${host}/login/session_token`, {
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
})

const json = await response.json()
const sessionUrl = new URL(json.session_url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants