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

Add CLI commands for OCM invitation workflow #1149

Closed
ishank011 opened this issue Sep 8, 2020 · 7 comments · Fixed by #1558
Closed

Add CLI commands for OCM invitation workflow #1149

ishank011 opened this issue Sep 8, 2020 · 7 comments · Fixed by #1558
Labels

Comments

@ishank011
Copy link
Contributor

No description provided.

@ishank011 ishank011 added the junior-job Easy issues label Sep 8, 2020
@ishank011 ishank011 changed the title Add commands for OCM invitation workflow Add CLI commands for OCM invitation workflow Sep 8, 2020
@jimil749
Copy link
Contributor

Hi @ishank011! I thought of giving this a shot. So just to summarize, we are required to add an ocm-invite command with that fetches the invite token and then forwards that token to another user, right? This could be done through the GenerateInviteToken and the ForwardInvite APIs. Is this the correct method to move forward?

@ishank011
Copy link
Contributor Author

Hey @jimil749. Yep, that is the plan. We'll need separate commands for generating the token and forwarding the invite though, since they're expected to be executed on different mesh providers, by the originator and recipient, respectively

https://reva.link/docs/tutorials/share-tutorial/ should give you a good idea of the workflow but it might be a bit dated, so feel free to reach out if you face any issues.

@jimil749
Copy link
Contributor

@ishank011, I have got a question. I implemented the token generation command which generates an invite token.

Now, for the next task which is to forward the token, which should be a different command (executed by the recipient) we require the generated token. In the doc provided, since the token generation and forwarding happens manually, we can just copy and paste the token. But I am not so sure how the recipient will get that token to make the request.

Can there be a flag (maybe -token) which can pass the token?

@jimil749
Copy link
Contributor

Just a correction, passing just the token won't suffice. Since the ForwardInviteRequest requires the inviteToken object, which consists of the token, user_id, expiration and description fields. (expiration and description are optional)

@ishank011
Copy link
Contributor Author

The /invites/forward endpoint requires two arguments, the token (just the string) and the token creator's mesh provider. You can add flags for both of these. Refer https://github.com/cs3org/reva/blob/master/internal/http/services/ocmd/invites.go#L128

@jimil749
Copy link
Contributor

Ahh ok! I was looking at the gRPC endpoint! Thanks for clearing. :)

@ishank011
Copy link
Contributor Author

ishank011 commented Mar 16, 2021

No, you still need to call the GRPC endpoint, but the implementation should be similar to the reference which I sent. In the inviteToken object, you can leave the rest of the fields empty as the backend only needs the UUID. Owing to the zero values in Go, we don’t have to explicitly specify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants