songkick / oauth2-provider

Simple OAuth 2.0 provider toolkit
MIT License
529 stars 148 forks source link

issues with grant_access with scopes #24

Closed DzmitryNikitsin closed 12 years ago

DzmitryNikitsin commented 12 years ago

When you do grant_access! with scopes we always add new scope to old ones, it will cause very long string of equal scopes as a result. Instead of add replace scope each time.

jcoglan commented 12 years ago

I think this is a better solution, since it uses a data structure that prevents dupes without clobbering values already in the database:

https://github.com/songkick/oauth2-provider/commit/df7b275a680005158029c7acb87262e82d699640

This pull request completely overwrites the stored set of scopes with another one, which is not what we want. The effect of #grant_access should be additive, so it's easy to provide additional permissions to a client rather than presenting all the permissions a user has already granted.

jcoglan commented 12 years ago

Closing this since we've fixed the long-string problem while preserving existing semantics.