-
Notifications
You must be signed in to change notification settings - Fork 1
PAE-379: poc server side authorisation #171
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?
Conversation
| throw Boom.unauthorized() | ||
| } | ||
|
|
||
| if (data.action === 'link-organisations') { |
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.
This allows us to catch responses which have been "intercepted" by the API so that we can present an "Auth Wall" or "Takeover UI" whereby the user must confirm the link between the Defra ID Organisation in their token and an pEPR Organisation
src/server/logout/controller.js
Outdated
| config.get('appBaseUrl') | ||
| ) | ||
| // const referrer = request.info.referrer | ||
| const referrer = 'http://localhost:3000/' |
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.
Ensure the user is always redirected to the home page
| ({ defraIdOrgName, defraIdRelationshipId }) => [ | ||
| { text: defraIdOrgName }, | ||
| { | ||
| html: `<a href="http://localhost:3200/cdp-defra-id-stub/register/${defraId.userId}/relationship/${defraIdRelationshipId}/current">Switch</a>` |
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.
We would obviously retrieve protocol, hostname, port from config in the controller so that it works for all environments
| organisations: organisations.map(({ name, orgId, id }) => [ | ||
| { text: name ?? 'data missing' }, | ||
| { text: orgId ?? 'data missing' }, | ||
| { text: id ?? 'data missing' }, |
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.
I don't think this defensive coding approach is necessary as I've never seen any of these fields actually missing values
| id: userId, | ||
| name: displayName | ||
| } | ||
| } |
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.
There are likely better ways to share this data between handlers and views in Hapi
| - cdp-tenant | ||
|
|
||
| defra-id-stub: | ||
| profiles: ['all'] |
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.
These have been added to make it simpler to share the same docker compose command between repos, not necessary for the PoC
|
|
||
| # queues | ||
| aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name cdp-clamav-results | ||
| aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name cdp-uploader-download-requests |
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.
I couldn't start the stack without this, not sure why it wan't already in the repo
| heading: statusCode, | ||
| message: errorMessage | ||
| message: errorMessage, | ||
| defraId: request.server.app.defraId |
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.
It would be nice if we could add the defraId data globally to all views
d4ad6e3 to
8051876
Compare
| border-right: none; | ||
| } | ||
| } | ||
| } |
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.
Temporary styles
8051876 to
bfe335c
Compare
bfe335c to
a0fd39c
Compare
Ticket: PAE-379
Description
PoC for authorising Defra ID users to access pEPR Organisation data
Please see the Pull Requests standards.