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

SC-7425 Improve beneficiary identity check #109

Merged
merged 1 commit into from
Aug 5, 2022
Merged

SC-7425 Improve beneficiary identity check #109

merged 1 commit into from
Aug 5, 2022

Conversation

pdeziel
Copy link
Collaborator

@pdeziel pdeziel commented Aug 3, 2022

This fixes an rVASP -> rVASP issue concerning the SyncRequire policy.

On the originator side, the rVASP generates an identity payload with a non-nil (but empty) beneficiary identity. However, on the beneficiary side the rVASP validates that the beneficiary identity is non-nil. This was causing an issue on SendPartial -> SyncRequire because the originating rVASP is generating an empty payload but the beneficiary rVASP assumes this is valid.

To fix this, the validation check is improved to validate the actual fields within the beneficiary identity on the identity payload. The validation now uses the TRISA ivms methods to verify the LegalPerson (the beneficiary VASP) and NaturalPerson (the beneficiary account).

@pdeziel pdeziel requested a review from rebeccabilbro August 3, 2022 18:01
@@ -248,6 +246,9 @@ func (s *Server) Transfer(ctx context.Context, req *pb.TransferRequest) (reply *
}
}

// Populate the transfer response with the transaction details
reply.Transaction = xfer.Proto()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just an ordering change so that we populate the transfer response for the CLI with the correct transaction state.

@@ -420,7 +420,8 @@ func (s *TRISA) handleTransaction(ctx context.Context, peer *peers.Peer, in *pro
return nil, protocol.Errorf(protocol.InternalError, "unknown policy '%s' for wallet '%s'", policy, account.WalletAddress)
}

if transferError != nil {
// Mark transaction as failed if it was not rejected but an error occurred
if xfer.State != pb.TransactionState_REJECTED && transferError != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't impact how the rVASPs operate but it does make sure that the transaction state gets updated correctly in the database, which makes it easier to manually verify our "integration" tests.

Copy link
Collaborator

@rebeccabilbro rebeccabilbro left a comment

Choose a reason for hiding this comment

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

Excellent precision-fix here @pdeziel; this will absolutely help make the behavior of our robot vasps more consistent for our users. Great work!

@pdeziel pdeziel merged commit 6a38f44 into main Aug 5, 2022
@pdeziel pdeziel deleted the sc-7425 branch August 5, 2022 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants