-
Notifications
You must be signed in to change notification settings - Fork 230
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
Replace references of uuid with crypto.randomUUID #12361
base: latest
Are you sure you want to change the base?
Conversation
cookieSetterSpy.mockClear(); | ||
const atUserId = getAtUserId(); | ||
it('should return the AT user id', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); |
Check warning
Code scanning / CodeQL
Clear text transmission of sensitive cookie Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 days ago
To fix the problem, we need to ensure that the secure
attribute is set when creating the cookie. This will ensure that the cookie is only transmitted over secure HTTPS connections. We can achieve this by modifying the Cookie.set
calls to include the secure
attribute in the options object.
-
Copy modified line R497 -
Copy modified line R505
@@ -496,3 +496,3 @@ | ||
it('should return the AT user id', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }', { secure: true }); | ||
cookieSetterSpy.mockClear(); | ||
@@ -504,3 +504,3 @@ | ||
it('should store the existing AT user id as a stringified JSON value in cookies again so that we update the cookie expiration date', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }', { secure: true }); | ||
cookieSetterSpy.mockClear(); |
const [[cookieName, cookieValue, cookieOptions]] = | ||
cookieSetterSpy.mock.calls; | ||
it('should store the existing AT user id as a stringified JSON value in cookies again so that we update the cookie expiration date', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); |
Check warning
Code scanning / CodeQL
Clear text transmission of sensitive cookie Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 days ago
To fix the problem, we need to ensure that the secure
attribute is set when the cookie is created. This will enforce that the cookie is only transmitted over secure (HTTPS) connections. We can achieve this by modifying the Cookie.set
calls to include the secure
attribute in the options object.
-
Copy modified line R497 -
Copy modified line R505
@@ -496,3 +496,3 @@ | ||
it('should return the AT user id', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }', { secure: true }); | ||
cookieSetterSpy.mockClear(); | ||
@@ -504,3 +504,3 @@ | ||
it('should store the existing AT user id as a stringified JSON value in cookies again so that we update the cookie expiration date', () => { | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }'); | ||
Cookie.set('atuserid', '{ "val": "some-random-uuid" }', { secure: true }); | ||
cookieSetterSpy.mockClear(); |
Resolves JIRA [number]
Overall changes
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
Testing
Helpful Links
Add Links to useful resources related to this PR if applicable.
Coding Standards
Repository use guidelines