Skip to content

Question: How to deal with phases/modes/roles where different clients have different mehods exposed to them? #397

@idanarye

Description

@idanarye

I want to create service that uses WebSockets, which means actual sessions. Upon connection, the client will have to do a handshake - declaring itself as either "Role A" or "Role B" by sending a login_a or login_b request (or maybe it'd be a parameter of the general login. I haven't decided yet). The login method, of course, will also send the parameters.

After which it'll be able to access the methods exposed to that role. Each role has different methods (though some can be shared, of course)

My question is about the rpc.discover method:

  • Should it always return all the methods, or should it only return the methods available to that role (and in the handshake phase - only the login methods)
  • If it's the former - how should I mark which methods are available for each role?
  • If it's the latter - what do I do with openrpc.json? Can I make several such files (openrpc-handshake.json, openrpc-role-a.json, openrpc-role-b.json)? Or should the openrpc.json just return all the methods?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions