-
Notifications
You must be signed in to change notification settings - Fork 37
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
Suppoort attachments in the protocol #299
base: main
Are you sure you want to change the base?
Conversation
src/iden3comm/handlers/auth.ts
Outdated
@@ -86,6 +88,8 @@ export function createAuthorizationRequestWithMessage( | |||
created_time: getUnixTimestamp(new Date()), | |||
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined | |||
}; | |||
|
|||
opts?.attachments && (request.attachments = opts.attachments); |
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.
Looks interesting! However, since attachments are optional, it would be better to assign them directly in the request construction.
attachments: opts?.attachments
@@ -64,6 +69,7 @@ export function createProposalRequest( | |||
created_time: getUnixTimestamp(new Date()), | |||
expires_time: opts?.expires_time ? getUnixTimestamp(opts.expires_time) : undefined | |||
}; | |||
opts.attachments?.length && (request.attachments = opts.attachments); |
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.
same here, better just:
attachments: opts?.attachments
a95be40
getProtocolMessageTypeByGoalCode(m.body.goal_code) === | ||
PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE && | ||
m.to === proposalRequest.to && // issuer | ||
(!m.body.paymentReference || m.body.paymentReference === proposalRequest.from) // user |
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.
remove user
// credential not found in the wallet, prepare proposal protocol message | ||
const proposal = await this._params.proposalResolverFn(cred.context, cred.type); | ||
const proposal = await this._params.proposalResolverFn(cred.context, cred.type, { | ||
paymentInfo: paymentInfo?.body?.paymentData |
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.
paymentMessage.body.payments[]
No description provided.