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

Invitation workflow for OCM #41

Conversation

LovisaLugnegard
Copy link
Contributor

@LovisaLugnegard LovisaLugnegard commented Apr 1, 2020

This PR contains an invitation workflow for OCM to discover users in remote system while preserving privacy.

@LovisaLugnegard LovisaLugnegard force-pushed the add-endpoint-to-accept-invite branch from e6bc7e6 to dcdc02e Compare April 2, 2020 06:50
@labkode labkode changed the title Add endpoint for accept invite Invitation for OCM Apr 14, 2020
@labkode labkode changed the title Invitation for OCM Invitation workflow for OCM Apr 14, 2020
@LovisaLugnegard
Copy link
Contributor Author

@ishank011 and @labkode Do you see a reason for using both "invite" and "invitation" in the API description? If we use both I think we should be clear that they either mean the same (no need to use both in that case), or what the difference is.

Copy link
Contributor

@ishank011 ishank011 left a comment

Choose a reason for hiding this comment

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

Hi Lovisa. Looks good - just a couple of comments.

spec.yaml Outdated Show resolved Hide resolved
spec.yaml Outdated Show resolved Hide resolved
spec.yaml Outdated Show resolved Hide resolved
LovisaLugnegard pushed a commit to LovisaLugnegard/OCM-API that referenced this pull request Apr 20, 2020
* add more services to gateway

* fix ocm

* clean

* add expose field to InititiateFileUpload/Download

* extend download/upload responses for metadata gateway

* add user provider service

* fix userprovier api

* fix format

* fix types

* fix is in logic for userprovider

* add userprovider to the gatewayg

* add userId to GenerateAcccessTokenResponse

* add authregistry and authprovider

* move user type to user manager package

* fix user namespace
@labkode labkode changed the title Invitation workflow for OCM [WIP] Invitation workflow for OCM May 11, 2020
spec.yaml Outdated
/invites/forward:
post:
summary: Forward an invitation to start sharing
description: Forwards an invitation received by an out-of-band channel, email for example.
Copy link

@pferreir pferreir Jun 23, 2020

Choose a reason for hiding this comment

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

Maybe "through an out-of-band channel", or "via" would be easier to understand?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a nice improvement, I'll update.

@labkode labkode changed the title [WIP] Invitation workflow for OCM Invitation workflow for OCM Jun 15, 2021
@labkode labkode marked this pull request as ready for review June 15, 2021 21:26
@@ -355,6 +355,47 @@ paths:
type: string
schema:
$ref: "#/definitions/Error"
/invites/forward:
Copy link
Contributor

Choose a reason for hiding this comment

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

Who forwards the invitation when this end-point is called, and from where to where?

Copy link
Contributor

@michielbdejong michielbdejong Aug 6, 2021

Choose a reason for hiding this comment

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

IIUC from https://www.youtube.com/watch?v=TnlUOG3lOu4, the flow would be as follows, if Alice at server A invites Bob at server B:

  • Alice instructs A to send an invite to "Bob@B"
    • A changes state, "invite sent from Alice to Bob@B"
    • A calls B/invites/forward
    • B changes state, "invite received from Alice@A to Bob"
  • B notifies Bob (this is the "forwarding", right?)
  • Bob instructs B to accept the invitation
    • B changes state, "invite from Alice@A to Bob accepted"
    • B calls A/invites/accept
    • A changes state, "invite from Alice to Bob@B accepted"

If this is correct, then I think the summary and description should reflect that it is B who forwards the invite from A (or effectively from Alice@A) to Bob?

Copy link
Contributor

@michielbdejong michielbdejong Aug 6, 2021

Choose a reason for hiding this comment

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

The summary "Forward an invitation to start sharing" suggests that the agent doing the forwarding (B) is also the agent who starts sharing, but I think it's more accurate to say Alice@A starts sharing.

Also, since B forwards from the inner network to the last mile end-point, "deliver" might have been a better verb than "forward".

The delivery of the notification is not the main functionality exposed by this API endpoint; rather, if and how B notifies Bob is not even the concern of A or of Alice@A. So given that there is also a state change in B, maybe "create" (as in "create an entry in your list of received invites") would have been even better than "forward" or "deliver".

The description "Forwards an invitation received through an out-of-band channel, email for example." describes how the invitation was received, but I think the intention was to describe how the invitation gets forwarded.
So maybe "Forwards a received invitation through an out-of-band channel, email for example." is clearer?

Copy link
Contributor

Choose a reason for hiding this comment

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

And for the summary I would suggest "Notify the recipient of a new invite"

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah wait, I ran through https://reva.link/docs/tutorials/share-tutorial/#4-2-accept-the-token again and this actually looks like accepting the invite is not a server-to-server interaction, but a client-to-server one?
Should the OCM API not only define those, or leave that to each implementer?
In the end it doesn't matter to Alice or to A how Bob and B communicate with each other, right?

@michielbdejong
Copy link
Contributor

What is the difference between ForwardInvite and AcceptInvite?

@michielbdejong
Copy link
Contributor

michielbdejong commented Oct 21, 2021

I think we should only add /invites/accept to the OCM API, and there is no need to define an /invites/forward endpoint.

Looking at the reva code there is a ForwardInvite function which does a http call to
acceptInviteEndpoint "/invites/accept".

But the AcceptInvite function does not do any http calls (it's the function that gets called when a http request comes in over the server's OCM API.

@michielbdejong
Copy link
Contributor

I'll see if I can create a PR to supersede this one (which is now 18 months old and hasn't been getting much movement recently).

@michielbdejong
Copy link
Contributor

I think we should also define this end point as application/json (like the other ones), not as application/x-www-form-urlencoded which is currently the only format supported by reva.

@michielbdejong
Copy link
Contributor

I see revad additionally has a http endpoint where an authenticated user can cause an invite to be generated and emailed out.
There also is a forwardInvite handler which takes an invite token and an origin providerDomain and converts those into a grpc request for ForwardInvite. It is unclear to me why a reva user would use this http method instead of just using the equivalent grpc method directly?

@glpatcern
Copy link
Member

Superseded by #54, please let's resume the discussion there.

@glpatcern glpatcern closed this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants