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

How to generate/fetch share URL in CLI? #331

Closed
achourasia opened this Issue Jun 21, 2017 · 12 comments

Comments

Projects
None yet
2 participants
@achourasia

achourasia commented Jun 21, 2017

Is it possible to generate/fetch the share URL for an endpoint or endpoint+path in CLI?
I'd like to use these URL's and add them to the application, so when the end user can click on this link and get to the appropriate location.

@jaswilli

This comment has been minimized.

Member

jaswilli commented Jun 21, 2017

Hi @achourasia,

I'm assuming you're talking about a URL that points into the Transfer page of the Globus web app?

The CLI doesn't provide a way to generate that URL but you could do it yourself fairly easily:

The base URL should be: https://www.globus.org/app/transfer and the query string parameters are as follows:

  • origin_id (left file browser), destination_id (right file browser) contains the UUID id of the endpoint.
  • origin_path, destination_path are the URL-encoded paths that you want to browse to initially.

Hope that helps.

@jaswilli jaswilli closed this Jun 21, 2017

@achourasia

This comment has been minimized.

achourasia commented Jun 21, 2017

I just figured this out manually as well. Thanks

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

While I can create urls by concatenating the above URL parameters, one of the thing that the CLI user won't have is the add_identity parameter. Without this parameter, the new and existing user will have a trouble linking new email address to their account.
So returning the share URL in CLI response is needed, as this will make things way easier for the user.
Should I file this as separate feature request, or this will issue suffice.

Use case for URL include

  1. Generating direct links for webpages on science gateways. So the sharee(end user) can get to there data with ease, ensuring smooth transition from Gateway to Globus
  2. The sharer can send well composed emails to sharee (end user) with correct URL link. This will allow the sharee to access the shared data easily.
  3. When a new user (via email) is given permission via ACL the add_identity parameter cannot be queried via CLI currently as the account does not exist. So the share URL cannot be constructed.
@jaswilli

This comment has been minimized.

Member

jaswilli commented Jun 22, 2017

Hi,

Thanks for providing a detailed use case, it's helpful to understand what you're trying to accomplish. I'll take this request back to our team so that we can discuss if and how we might want to handle this.

That said, if you're constructing links you could also add the add_identity query string parameter yourself and it should prompt the web app to display the "hint" to the user.

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

How will I construct the specific hash for add_identity query string parameter? Thats generated by Globus, unless you share the internals which is probably a bad idea.

@jaswilli

This comment has been minimized.

Member

jaswilli commented Jun 22, 2017

The value in the add_identity query string parameter isn't a secret or hash. It's the UUID id for the identity which you'd like to suggest the user link to.

If you don't already have the identity id on hand you can get it from the CLI by using the get-identities command, e.g. globus get-identities test@globusid.org.

Does that make sense? I'm happy to provide more info if it's helpful.

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

Great that will work. I am finding that the ACL or URL are fragile. Will be submitting a support ticket on it shortly. Thanks for super quick response again!

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

Another issue here is what happens when the user(emails) does not exist. The Web App is able to handle this scenario, as it sends a URL by email and invites the new user. So we really need the CLI to provide the URL back which include appropriate UID query parameter

For example
globus get-identities tester2@mailinator.com
NO_SUCH_IDENTITY

@jaswilli

This comment has been minimized.

Member

jaswilli commented Jun 22, 2017

The CLI will soon be able to handle creating (provisioning) an identity if it doesn't already exist when creating a role or permission.

You can see the change here: #327

Basically when you run globus endpoint permission create <endpoint_id:path> --permissions <rw|r> you will be able to use --provision-identity to create that identity.

We should hopefully be releasing a new version of the CLI soon with that enhancement included.

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

This is nice and will solve my use case.
I'd assume that the system needs to create the user internally, no matter what. So as a user I think it would be better to do this automatically rather having to add more options.

@jaswilli

This comment has been minimized.

Member

jaswilli commented Jun 22, 2017

In some cases it does make sense to auto-provision the identity, which is why we've added the option to turn on that behavior.

In some situations, since the CLI is mainly intended to be an interactive tool for use by people, it can lead to a bad experience if we always auto-provision identities. Specifically the case where you inadvertently type an incorrect identity username into a command--with the auto-provisioning behavior turned on you wouldn't get any feedback that you didn't end up doing what you intended.

For users that are going to automate or script with the CLI they may decide to always use the --provision-identity option.

@achourasia

This comment has been minimized.

achourasia commented Jun 22, 2017

That makes sense. Thanks for explaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment