-
Notifications
You must be signed in to change notification settings - Fork 0
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
LIME-1273 - Adding new call to personInfo endpoint #306
Conversation
d9b5034
to
7ecc8c1
Compare
}; | ||
|
||
//axios.post to new personInfo endpoint, put licence details into req.session.shared_claims shared claims | ||
const personInfoApiResponse = await req.axios.post( |
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.
For security can we wrap this in an if statement with an env var so we can merge without triggering new code yet
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.
Yes this actually means I can remove feature toggle from corresponding API PR
} | ||
super.saveValues(req, res, next); |
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.
Is this not still needed?
@@ -6,7 +6,8 @@ module.exports = { | |||
PATHS: { | |||
SESSION: "session", | |||
CHECK: "check-driving-licence", | |||
AUTHORIZATION: "authorization" | |||
AUTHORIZATION: "authorization", | |||
PERSON_INFO: "person-info" |
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.
Is this correct its different to whats on the ticket
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.
Endpoint on ticket was taken from a similar piece of work kiwi did so an internal decision not linked to any requirement, I opted to add the hyphen to keep inline with existing convention
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.
Can we update the ticket
it("should be an instance of BaseController", () => { | ||
expect(root).to.be.an.instanceof(BaseController); | ||
}); | ||
|
||
it("should retrieve shared_claims from session and store it in the journeyModel", async () => { | ||
it("should retrieve shared_claims from session and store it in the sessionModel", async () => { |
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.
Do we have a negative check for if any of these values are absent
7ecc8c1
to
8d5ee51
Compare
req.journeyModel.set("surname", sharedClaims.names[0]?.familyName); | ||
req.journeyModel.set("givenNames", sharedClaims.names[0]?.givenNames); | ||
} | ||
let personInfoApiResponse = {}; |
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.
The should be within the if for the feature flag.
{ headers: headers } | ||
); | ||
} | ||
if (personInfoApiResponse.data.drivingPermit) { |
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 should be in the above feature flag if.
It also needs to handle a failure of personInfoApiResponse not being returned and .data.drivingPermit not being present.
class RootController extends BaseController { | ||
async saveValues(req, res, next) { | ||
const sharedClaims = req.session?.shared_claims; | ||
req.sessionModel.reset(); | ||
req.sessionModel.set("isAuthSourceRoute", false); |
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.
Do we want to be resetting the session model we run the risk here of something failing and putting the user down a different route to the first one they were on if they navigate back
session_id: req.session?.tokenId | ||
}; | ||
|
||
if (process.env.AUTH_SOURCE_ENABLED === "true") { |
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.
Should this be isAuthSourceRoute
if (process.env.AUTH_SOURCE_ENABLED && !isAuthSourceRoute)
That way we only run it once per journey
6a91151
to
186733e
Compare
personInfoApiResponse.data?.drivingPermit[0]?.expiryDate && | ||
personInfoApiResponse.data?.drivingPermit[0]?.issueDate && | ||
personInfoApiResponse.data?.drivingPermit[0]?.issuedBy && | ||
personInfoApiResponse.data?.drivingPermit[0]?.issueNumber && |
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 think this needs to be more complicated. For instance we only expect an issue number if its DVLA
} | ||
} | ||
super.saveValues(req, res, next); | ||
} | ||
|
||
async checkForValidSharedClaimsData(req, personInfoApiResponse) { |
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.
On naming can we make this return true or false and update the state in the calling method
7ef5276
to
734d630
Compare
Signed-off-by: ElliotMurphyGDS <[email protected]>
734d630
to
8646f35
Compare
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
What changed