Replace app requirement exploration method #1042
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Replace
app.get_scope_requirements(resource_server: str) -> tuple[Scope]
with the @Property methodapp.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/