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

Replace app requirement exploration method #1042

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

derek-globus
Copy link
Contributor

@derek-globus derek-globus commented Sep 5, 2024

What?

Replace app.get_scope_requirements(resource_server: str) -> tuple[Scope] with the @Property method app.scope_requirements which will create and return a deep copy of the internal scope requirements.

Why?

app.get_scope_requirements(...) was added to give developers a lens into the aggregate requirements registered on a GlobusApp. By making resource_server a required parameter however, we mandated that a developer have foreknowledge of the scopes they are exploring which, at least in part, defeats the purpose of supporting exploration.

This new approach allows for iteration over all resource servers and leverages deepcopy to ensure that users don't retrieve and modify their scope requirements outside of the App defined interfaces (app.add_scope_requirements(...))


📚 Documentation preview 📚: https://globus-sdk-python--1042.org.readthedocs.build/en/1042/

Copy link
Member

@sirosen sirosen left a comment

Choose a reason for hiding this comment

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

As we discussed, this seems like the right way to take the feedback we got.

I wish we didn't need deepcopy, but it feels like the right choice right now.

@derek-globus derek-globus merged commit 898bd79 into globus:main Sep 5, 2024
15 checks passed
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.

2 participants