-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pin 5687: Verify tenant certified attributes for agreement creation #1224
base: feature/incaricato
Are you sure you want to change the base?
Conversation
…7_agreementsVerify
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.
In this router the endpoints were declared always as agreementRouter.post
instead of doing only .post
like we do in other routers; so I refactored it in order to align it to the others
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 would avoid this refactor in this PR because it will conflict with every other change to this agreement router. Git sees the entire file as changed, so it will be hard to solve conflicts, and we have many parallel activities involving the agreement (capofila, the new agreement contracts, further changes in this feature, etc.).
Maybe we can track this as a small activity, to be done on develop
after merging these two big features...
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 need to implement this logic in the agreement process?
I think we have everything we need already in the BFF, the call is named /agreements/verify
but it doesn't seem to be related to agreements since an agreement does not yet exist (unless I am missing something).
I think we can do everything in the BFF, doing something similar to what @MalpenZibo did in #1218, but simpler:
- We GET the delegation
- We GET the delegator from the delegation
- We use the hasCertifiedAttributes utility (already implemented in BFF) and return true if it's true for at least one of these tenants
Let me know what you think. I would also consider renaming the call since it is not related to agreements but just to the verification of attributes given a descriptor and a delegation
@@ -13079,7 +13256,6 @@ components: | |||
- dailyCallsPerConsumer | |||
- dailyCallsTotal | |||
- agreementApprovalPolicy | |||
- hasCertifiedAttributes |
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.
Was this unused?
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.
Was this unused?
Yes, in fact it was only present in the required but not in the actual properties
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 would avoid this refactor in this PR because it will conflict with every other change to this agreement router. Git sees the entire file as changed, so it will be hard to solve conflicts, and we have many parallel activities involving the agreement (capofila, the new agreement contracts, further changes in this feature, etc.).
Maybe we can track this as a small activity, to be done on develop
after merging these two big features...
emptyErrorMapper, | ||
ctx.logger, | ||
ctx.correlationId, | ||
`Error verifying agreement` |
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.
`Error verifying agreement` | |
`Error verifying certified attributes for agreement` |
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 opted for Error verifying certified attributes
since there isn't an agreement yet
Co-authored-by: Eric Camellini <[email protected]>
As discussed in sync, it's better to keep the route implemented in the process rather than the BFF |
This reverts commit d31aafb.
Closes PIN-5607
This route will check the tenant attributes against the selected descriptor when creating an agreement for itself or for a delegator