-
Notifications
You must be signed in to change notification settings - Fork 204
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
Feature/ack credential #122
Feature/ack credential #122
Conversation
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
Signed-off-by: Jakub Koci <[email protected]>
It should also fix #117 if I didn't forget something :) |
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.
Awesome! I've added a lot of comments, but most are small, nitpicks or opinionated
} | ||
|
||
export class CredentialAckMessage extends AgentMessage { | ||
public constructor(options: CredentialAckMessageOptions) { |
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 if all values are optional, options
should be optional. This way you wouldn't have to pass an empty object to the constructor.
public constructor(options: CredentialAckMessageOptions) { | |
public constructor(options?: CredentialAckMessageOptions) { |
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.
That's a good point and I agree. However, if I do that we would need to change the logic to something like this:
if (options) {
this.id = options.id ?? this.generateId();
} else {
this.id = this.generateId();
}
And I don't like that. I suggest to keep it for now and maybe change later if we see other cases like this one. Just to keep it consistent, you know.
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.
Good point. We definitely don't want that.
Ideally we should get rid of the if (options)
in all classes. There are others that have the same problem. class-transformer
calls new XXX
while it should use reflection directly. See the issue (and my comment). I'll try to take a look as it will be of huge benefit to us.
src/lib/protocols/credentials/__tests__/CredentialService.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Jakub Koci <[email protected]>
* Add ack message and decorator * Add credential ack handler * Return credential record after processing credential offer message Signed-off-by: Jakub Koci <[email protected]> Signed-off-by: Ankita Patidar <[email protected]>
This implements the ack part of the issue #64. I suggest closing that issue after the merge of this PR and eventually create other issues for the remaining functionality we would like to implement related to credential exchange.
What I see as remaining:
sender_order
andreceived_orders