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

fix: ensure transfers can occur between non-HA mapped collections by triggering incremental-like authorization for data_access scope. #67

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbottigliero
Copy link
Contributor

Non-HA, Mapped Collections will require an additional data_access scope before a transfer can be successfully be initiated. This code change will trigger a redirect to Globus Auth for the additional required scope (on it's own, and as a dependent of the portal scope) and retry the transfer when a user selects a Non-HA, Mapped Collection on the Globus Helper page.

…triggering incremental-like authorization for data_access scope.
Copy link

@jakeglobus jakeglobus left a comment

Choose a reason for hiding this comment

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

Overall I think this is an okay approach. Might ask Kurt or Josh though if you want an expert's view

) and not destination['non_functional'] and not is_share

if is_non_ha_mapped:
data_access_scope = "https://auth.globus.org/scopes/" + destination["id"] + "/data_access"

Choose a reason for hiding this comment

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

A lot of this string concatenation stuff can be cleaned up using python f-strings

Comment on lines +330 to +332
def retry_transfer():
transfer_data = session['_inflight_transfer']
return transfer_datasets(transfer_data)

Choose a reason for hiding this comment

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

Is this actually retrying or is this to handle the redirect back from auth after doing the consent flow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably less of a retry and more of a first attempt after realizing we need an authorization hop... maybe process_inflight_transfer() is more explicit?

Choose a reason for hiding this comment

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

Yeah I think that name is a better description of the function

@jbottigliero jbottigliero requested review from joshbryan-globus and kurtmckee and removed request for kurtmckee and joshbryan-globus April 27, 2022 21:10
@jbottigliero jbottigliero marked this pull request as draft April 27, 2022 21:25
lgarrison added a commit to abacusorg/abacussummit-data-portal that referenced this pull request Dec 8, 2023
lgarrison added a commit to abacusorg/abacussummit-data-portal that referenced this pull request Dec 8, 2023
@lgarrison
Copy link

Thanks for this! I was able to get my portal working with v5 endpoints using this. Would love to see this merged, maybe with a migration/update guide in the readme for those of us who have only been following the v5 changes from a distance.

I did have to add _scheme=app.config.get("AUTHCALLBACK_SCHEME") to redirect_uri = url_for('authcallback', _external=True) to ensure that the redirect URI was using HTTPS.

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.

3 participants