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

Programmatic way of determining needed scopes #180

Closed
felix-hilden opened this issue May 10, 2020 · 1 comment
Closed

Programmatic way of determining needed scopes #180

felix-hilden opened this issue May 10, 2020 · 1 comment
Labels
consideration Future decision to be discussed enhancement New feature or improvement

Comments

@felix-hilden
Copy link
Owner

It could be neat to provide a way of determining the necessary scopes to execute a given call. The use case would be applications that gradually expand access rights. They could then gather all the necessary scopes based on calls made or when encountering an error.

It could be implemented as a function that inspects an attribute set by a decorator. The function itself could return two values, one for required scopes, and the other for extra scopes e.g. in the playlist case access to private playlists. Or we could have two functions.

Another wild idea, we could have the necessary scopes attached to the error object.

@felix-hilden felix-hilden added enhancement New feature or improvement consideration Future decision to be discussed labels May 10, 2020
@felix-hilden
Copy link
Owner Author

felix-hilden commented May 31, 2020

Providing missing scopes on errors would require catching the error an re-raising it. I think we'll not do that at least yet to keep things a bit lighter. And I think an attribute is enough.

These scope attributes have another benefit though: we can use them to automatically build documentation, so that's nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consideration Future decision to be discussed enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

1 participant