-
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
Add trustping protocol #17
Conversation
Signed-off-by: Gaurav Narula <[email protected]>
Usually agents use a ping to establish connection Signed-off-by: Gaurav Narula <[email protected]>
…date Signed-off-by: Gaurav Narula <[email protected]>
src/lib/handlers/TrustPingHandler.ts
Outdated
default: | ||
throw new Error('Invalid message type for handler'); | ||
} | ||
} |
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 rather create a handler for each type as it is with other handlers. We can group handlers by a protocol in handlers
folder. Maybe it's not the best design, but let's keep it consistent for now. Or is there any problem with that I don't see? 🤔
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.
uhm no problem as such but I figured it's easy to see all handlers for a particular protocol at one place rather than switching b/w files.
You're right that this breaks consistency with what we have at the moment. I'll split this into two different handlers. Maybe we can have another issue that refactors the handlers and groups them by protocol type? If so, could you create one please?
import { ConnectionState } from '../connections/domain/ConnectionState'; | ||
|
||
export class TrustPingService { | ||
process_ping(inboundMessage: InboundMessage, connection: Connection) { |
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.
There is perhaps no rule about camelCase method/function naming, my fault. Could you please rename it? And if you want, ESLint rules update would be appreciated :)
I understand there will be exceptions, mainly in relation to message attributes defined by spec, but I would recommend to keep it camelCase whenever possible.
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.
aye aye!
Also changed1 method name to follow camelCase Signed-off-by: Gaurav Narula <[email protected]>
feat(core): w3cCredentialRecord and w3cCredentialRepository
The other agents (in Python and .NET) use the trustping message to acknowledge a connection. This PR adds a handler for trustping messages.