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

Add GovukPersonalisation::Urls module #14

Merged
merged 1 commit into from
Aug 26, 2021
Merged

Add GovukPersonalisation::Urls module #14

merged 1 commit into from
Aug 26, 2021

Conversation

barrucadu
Copy link
Contributor

@barrucadu barrucadu commented Aug 26, 2021

Currently we have ad-hoc approaches to generating account URLs in our
frontend apps. Some use env vars with the full URL in. Some
construct paths based on the account-manager's URL. Some assume URLs.

It's even worse when we want to construct links which work both in
local development (where they need to link to foo.dev.gov.uk) and in
production (where they need to link to www.gov.uk).

So, let's put all of the URL generation logic in this gem, and re-use
it in different apps. For now, I've added the URLs which we use in
the account template in govuk_publishing_components. Then we can
change govuk_publishing_components to depend on this gem, update the
template, and set the URL env vars on Integration to point to Digital
Identity.

We can migrate other URLs into this gem as needed.


Trello card

Currently we have ad-hoc approaches to generating account URLs in our
frontend apps.  Some use env vars with the full URL in.  Some
construct paths based on the account-manager's URL.  Some assume URLs.

It's even worse when we want to construct links which work both in
local development (where they need to link to `foo.dev.gov.uk`) and in
production (where they need to link to `www.gov.uk`).

So, let's put all of the URL generation logic in this gem, and re-use
it in different apps.  For now, I've added the URLs which we use in
the account template in govuk_publishing_components.  Then we can
change govuk_publishing_components to depend on this gem, update the
template, and set the URL env vars on Integration to point to Digital
Identity.

We can migrate other URLs into this gem as needed.
@barrucadu barrucadu merged commit c17f75b into main Aug 26, 2021
@barrucadu barrucadu deleted the msw/urls branch August 26, 2021 16:24
barrucadu added a commit to alphagov/gds-api-adapters that referenced this pull request Aug 27, 2021
This is a new endpoint[1] to generate an appropriate sign-out URL
based on the user's session and which auth service we're using.

I decided against putting this in `GovukPersonalisation::Urls`[2]
because generating the right URL requires looking at the
`.well-known/oidc-configuration` endpoint, which so far is an
account-api concern.

[1] alphagov/account-api#190
[2] alphagov/govuk_personalisation#14
barrucadu added a commit to alphagov/gds-api-adapters that referenced this pull request Sep 2, 2021
This is a new endpoint[1] to generate an appropriate sign-out URL
based on the user's session and which auth service we're using.

I decided against putting this in `GovukPersonalisation::Urls`[2]
because generating the right URL requires looking at the
`.well-known/oidc-configuration` endpoint, which so far is an
account-api concern.

[1] alphagov/account-api#190
[2] alphagov/govuk_personalisation#14
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