-
Notifications
You must be signed in to change notification settings - Fork 7
fix: hide new include-ims-annotation secrets #83
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,13 @@ describe('stringParameters', () => { | |||||
| expect(utils.stringParameters(params)).toEqual(expect.stringContaining('"authorization":"<hidden>"')) | ||||||
| expect(utils.stringParameters(params)).not.toEqual(expect.stringContaining('secret')) | ||||||
| }) | ||||||
| test('with ims credentials', () => { | ||||||
| const params = { | ||||||
| a: 1, b: 2, __ims_oauth_s2s: { client_id: 'fake-client-id', client_secret: 'secret', org_id: 'fake@AdobeOrg' } | ||||||
| } | ||||||
| expect(utils.stringParameters(params)).toEqual(expect.stringContaining('"client_secret":"<hidden>"')) | ||||||
| expect(utils.stringParameters(params)).not.toEqual(expect.stringContaining('secret')) | ||||||
|
||||||
| expect(utils.stringParameters(params)).not.toEqual(expect.stringContaining('secret')) | |
| expect(utils.stringParameters(params)).not.toEqual(expect.stringContaining('"client_secret":"secret"')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot and Cursor agree on the issue, but have different suggestions for how to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stringParametersnow always injects__ims_oauth_s2s: {}into the returned JSON when the inputparamshas no__ims_oauth_s2s. This changes the previous output shape and will break the existing "no auth header" test expectation (and any callers relying on the logged JSON matching the original params). Consider only adding__ims_oauth_s2sto the serialized object when it exists on the input params (or when it’s non-empty).