Skip to content
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

Upgrade panda to v4 #194

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Upgrade panda to v4 #194

merged 1 commit into from
Jul 22, 2024

Conversation

Fweddi
Copy link
Contributor

@Fweddi Fweddi commented Jul 18, 2024

This PR upgrades our pan-domain-authentication (panda) libraries to v4, which is a vital step towards our plan to improve key rotation.

How to review and test

Check if this branch is deployed to CODE. If not, deploy to CODE1.

We want to test that the Panda library can:
(1) verify valid Panda cookies
(2) issue Panda cookies through OAuth
(3) issue cookies that work 'pan domain', i.e. across tools on the same domain (in this case, dev-gutools.co.uk)

Choose another tool on the same domain to test with. For example, Composer CODE.

1. Verification

Open the other tool. If the tool asks you to login through Google Auth, log in. This will issue you a Panda cookie. If you are not directed to Google Auth, you already have a Panda cookie to test with.

Open Story Packages. You should see Story Packages as normal. Check your network tab - you should see no requests to OAuth.

This should give confidence that Panda has verified your cookie.

2. Issuing

Open Story Packages.

In the DevTools, under the Application panel, you can find the Panda cookie. It has the name gutoolsAuth-assym:
image

Delete the cookie, and refresh the page. You should see Story Packages as normal2. Check the network tab. You should see a request to OAuth.

Check the Application tab again. You should have a new gutoolsAuth-assym cookie - though it looks very similar to the old one!

This should give confidence that Panda has issued you a cookie.

3. Pan-Domain

Open the other tool.

You should see the tool as normal. Check your network tab - you should see no requests to OAuth.

This should give confidence that your new cookie (issued by Story Packages) works across the domain3.

Footnotes

  1. You can also test this locally, but you will need to test with another local tool. CODE and local are scoped to different domains (.code.dev-gutools.co.uk and .local.dev-gutools.co.uk).

  2. If you are redirected to Google Auth, then your Auth session with Google may have expired. This is fine. Log in through Google Auth and repeat the test. If it keeps directing you to Google Auth, then there may be an issue!

  3. If you check the Application tab in the other tool, you might find the cookie has changed! This is still the same cookie, but it has been slightly edited. Each tool you access with the cookie will be added to the cookie's authedIn list. The edits are hard to see as the cookie is encrypted. If you check the first tool again, you will see the cookie has stabilised.

@Fweddi Fweddi marked this pull request as ready for review July 18, 2024 11:32
Copy link
Contributor

@rhystmills rhystmills left a comment

Choose a reason for hiding this comment

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

Deployed to code and tested story-packages with a cookie from Composer, and vice versa. All seems to be working as expected.

@Fweddi Fweddi merged commit 4849ac5 into main Jul 22, 2024
3 checks passed
@prout-bot
Copy link

Seen on PROD (merged by @Fweddi 6 minutes and 21 seconds ago) Please check your changes!

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

Successfully merging this pull request may close these issues.

3 participants