Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

FSPT-189: Working lift & shift of Authenticator #19

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

MarcUsher
Copy link
Contributor

@MarcUsher MarcUsher commented Dec 12, 2024

Change description

Lift & shift of authenticator into pre-award-frontend and updates to consolidate shared modules (config, copilot, github etc.) and make the applications work as a single application with authenticator specific code in its own module.

All existing authenticator tests pass.

  • Unit tests and other appropriate tests added or updated
  • README and other documentation has been updated / added (if needed)
  • Commit messages are meaningful and follow good commit message guidelines (e.g. "FS-XXXX: Add margin to nav items preventing overlapping of logo")

How to test

  • Pull this branch
  • Pull feature/FSPT-189-authenticator-into-pre-award-frontend on docker-runner
  • Bring down containers, rebuild pre-award-frontend and make up containers
  • Local setup should work without a hitch

@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from fdea304 to b4bf074 Compare December 12, 2024 10:56
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from b4bf074 to e8c3ae1 Compare December 12, 2024 10:58
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from 41424c5 to 5c2427a Compare December 12, 2024 11:33
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from 3a203b2 to 71e65d9 Compare December 12, 2024 14:18
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from 71e65d9 to 2f2e620 Compare December 16, 2024 10:38
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from 361592a to c2cdce1 Compare December 16, 2024 15:14
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from c2cdce1 to d72c771 Compare December 16, 2024 16:05
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from a9f100b to 14846d2 Compare December 16, 2024 17:09
MarcUsher and others added 4 commits December 20, 2024 11:49
This commit is the bulk of the work to make the pre-award-frontend app
now include the old `authenticator` service and make it work for
`frontend`, `assess` and `authenticator`.
Our Authenticator and Assess Test Clients implement their own version
of the set_cookie method so that we don't have to explicitly pass the
domain every time we want to set the cookie in a test or request.

However the default implementation of this method (see
https://werkzeug.palletsprojects.com/en/stable/test/#werkzeug.test.Client.set_cookie)
sets `origin_only` to True, meaning the domain must be an exact match to
the request in order for a cookie to be set on the test request. This
doesn't work with our implementation as we want a cookie to be set
across the services.

This commit switches our implementation of `set_cookie` to default
`origin_only` to False.
CSRF has never been enabled on authenticator correctly, so this
maintains existing behaviour. We should fix this...

Exempt authenticator SSO endpoint from CSRF
Authenticator used a session cookie with Lax rather than Strict for the
`session_cookie_samesite` in Talisman so that it could send people to
Microsoft logins. Assess had it set to Strict for this same setting.

Now that we've brought the frontends together this needs to be set to
Lax otherwise you can't log into Find or Submit.
@MarcUsher MarcUsher force-pushed the feature/FSPT-189-authenticator-working-lift-shift branch from dcd029b to 23493a5 Compare December 20, 2024 11:53
@MarcUsher MarcUsher marked this pull request as ready for review December 20, 2024 11:55
Copy link
Contributor

@samuelhwilliams samuelhwilliams left a comment

Choose a reason for hiding this comment

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

We finally got there 🙌

@MarcUsher MarcUsher merged commit cb18cdc into main Dec 20, 2024
15 checks passed
@MarcUsher MarcUsher deleted the feature/FSPT-189-authenticator-working-lift-shift branch December 20, 2024 12:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants