-
Notifications
You must be signed in to change notification settings - Fork 452
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
Allow array in supported_scopes option #552
Allow array in supported_scopes option #552
Conversation
fad0aec
to
49fe499
Compare
49fe499
to
cb759b4
Compare
@@ -249,7 +249,7 @@ protected function getRedirectionUrl(UserInterface $user) | |||
} | |||
|
|||
/** | |||
* @return ClientInterface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marked as error by php-cs-fixed ¯_(ツ)_/¯
I don't like this approach. I'd rather we switch to an array in the config (deprecating the string first, of course). |
@dkarlovi : I made the move to an array definition. I had to change About the string deprecation vs array: it does now works with both, and I think it's a good idea to allow string if you only have quite a few scopes. |
@jdeniau you're right, looking at this, there's no need to deprecate the string notation, array notation is just a DX improvement. This looks good to me as is. 👍 Can you just add a blurb to the docs about this option, please? |
@dkarlovi of course 🤦♂️ ! It's done |
LGTM, but I just remembered (sorry to be a nag): do you think we should check for a space in individual array items? So, for example scopes:
- foo bar
- bar will become |
Hmmm... sorry I don't think I understand: The only manipulation is an - foo
- bar
- bar foo bar bar or - foo bar
- bar the output will still be: |
That "could" be interesting by the way if you want to do something like: scopes:
- foo:write foo:read
- bar:write bar:read
- baz:write baz:read But it's an edge case due to the implementation, we might not document that as it might change if the implementation change |
That's the problem, I feel. We probably shouldn't allow a space in array items at all since it's a separator. The user might expect it to behave differently than it in the end will. |
In that case I can throw a Symfony Config InvalidConfigurationException if one of the item contains a space or a tab |
We should do that and, other than that, I see no reason not to merge here. 👍 |
@dkarlovi done |
91e23cc
to
14b5096
Compare
14b5096
to
6dbd657
Compare
@jdeniau awesome work, TYVM! \o/ |
Currently, if you have an important number of scopes, you must set them into a one-line config option, which come to be really hard to read:
This PR allow using an array:
It still works with a string if you have a small number of scopes