Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

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

Draft
jbottigliero wants to merge 1 commit intoglobus:mainfrom
jbottigliero:fix-incremental-data_access
Draft

fix: ensure transfers can occur between non-HA mapped collections by triggering incremental-like authorization for data_access scope.#67
jbottigliero wants to merge 1 commit intoglobus:mainfrom
jbottigliero:fix-incremental-data_access

Conversation

@jbottigliero
Copy link
Member

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.
@jbottigliero jbottigliero force-pushed the fix-incremental-data_access branch from 001e43e to 0ccba54 Compare April 27, 2022 20:31
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
Member 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 a user and kurtmckee and removed request for a user and kurtmckee 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants