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

DFPL 2499 #5578

Closed
wants to merge 14 commits into from
Closed

DFPL 2499 #5578

wants to merge 14 commits into from

Conversation

chak-shing-lo-justice
Copy link
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/DFPL-2499

Change description

We are going to set up a system user for Cafcass with the right set of roles to access our new Cafcass APIs.

This PR: update the validation of the access token. add Cafcass system user configurartion

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

@chak-shing-lo-justice chak-shing-lo-justice requested a review from a team as a code owner September 6, 2024 11:52
@github-actions github-actions bot added the ccd configuration Pull request that updates CCD definition configuration label Sep 6, 2024
@chak-shing-lo-justice chak-shing-lo-justice changed the base branch from master to cafcass-api September 6, 2024 11:53
@hmcts-jenkins-d-to-i hmcts-jenkins-d-to-i bot requested a deployment to preview September 6, 2024 12:09 Abandoned
@hmcts-jenkins-d-to-i hmcts-jenkins-d-to-i bot requested a deployment to preview September 6, 2024 12:35 Abandoned
@@ -1,7 +1,7 @@
name: fpl-case-service
apiVersion: v2
home: https://github.com/hmcts/fpl-ccd-configuration
version: 1.12.79
version: 1.12.80
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? Doesn't look like anything's changed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The bot updated the version automatically. Wonder if the bot is triggered because I added two new secrets to charts/fpl-case-service/values.yaml Should I revert the version?


public byte[] downloadDocumentByDocumentId(String documentId) throws IllegalArgumentException, EmptyFileException {
return secureDocStoreService.downloadDocument(documentId);
return secureDocStoreService.downloadDocument(documentId, cafcassSystemUserService.getUserToken());
Copy link
Contributor

@DanCatchpole DanCatchpole Sep 16, 2024

Choose a reason for hiding this comment

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

Can we not use the calling user's token here like we normally do when calling the docstore (on requestData)? That should be the cafcass system user, saves logging in again/if ever an accidental bug allows the non-docstore user to login.

Not sure we should ever be logging in and doing actions on their behalf, but use their request token to do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IDAM /userinfo endpoint will only return user name but not the other details (e.g. user roles) if the token is generated via password grant.
CCD / CDAM will throw exception if they can't grab the user role with the tokens.

That's why we need to get the token via login, such that IDAM will return a full userinfo

auto-merge was automatically disabled September 16, 2024 10:15

Pull request was closed

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