-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update Azure DI Config With Default Values #141
Update Azure DI Config With Default Values #141
Conversation
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/4653/analyses/12606 This comment was posted by FlintCI. It can be disabled in the repository settings. |
6b9c3e4
to
a4deee6
Compare
->end() | ||
->scalarNode('resource') | ||
->info('Oauth resource field') | ||
->defaultValue('') |
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.
Is this required? I mean, is empty quotes different than allowing this just to be null?
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.
I'm just following what the Provider has set as their defaults:
class Azure extends AbstractProvider
{
use BearerAuthorizationTrait;
public $urlLogin = 'https://login.microsoftonline.com/';
public $pathAuthorize = '/oauth2/authorize';
public $pathToken = '/oauth2/token';
public $scope = [];
public $scopeSeparator = ' ';
public $tenant = 'common';
public $urlAPI = 'https://graph.windows.net/';
public $resource = '';
public $API_VERSION = '1.6';
public $authWithResource = true;
...
}
I gave TheNetworg devs the benefit of the doubt. I figured they know what they're doing, so there may be a reason it needs to be an empty string as opposed to a null value.
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.
I can confirm that null
value for resource works (I just went into my project and modified the config and the defaults in the class and authentication still works. I will update this to default to null
.
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.
I updated the 'resource'
node with ->defaultNull()
->end() | ||
->scalarNode('api_version') | ||
->example("api_version: '1.6'") | ||
->info('The API version to run against') | ||
->defaultValue('1.6') |
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.
I think we should avoid this. The problem is that setting a default API version means we may need to "bump" it up in the future. Also, making the user choose is a good idea - then they will go find the correct version of the docs for that version.
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.
I concur, with reference to "we may need to "bump" it up". I wouldn't want to be responsible for watching the provider to see if they change their default API version.
That being said, we could run into the same issue with any of these configuration options. I mean, the odds of Microsoft making significant changes to its default paths, login url, graph url, etc are very slim. I doubt they want to break BC that bad, but it could happen and provider would end up needing updated leading us to have to update it here.
API version I can see being a problem; However, the initial commit was November 16, 2015 and it was 1.6 then as well, so idk. I might push back a bit on the resource
empty string one above, but this one -- just tell me what to do and I'll do it.
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.
I updated the 'api_version'
node to remove the default value altogether
The update to add all of the Azure-specific configuration variables into the tree builder did not set any defaults, so you have to configure each and every option in the yaml file. This updates knpuniversity#131 to include the proper default values as defined in the TheNetworg/oauth2-azure Provider class. This way configuration can be as minimal as possible, allowing you to simply overwrite default values instead of defining each and every one.
a4deee6
to
ef8909d
Compare
@weaverryan what are your thoughts on this? |
Thanks for the ping! Merged and v1.25.0 tagged. |
Thank you, kindly, sir. |
The update to add all of the Azure-specific configuration variables into
the tree builder did not set any defaults, so you have to configure each
and every option in the yaml file.
This updates #131 to include the proper default values as defined in the
TheNetworg/oauth2-azure Provider class. This way configuration can be as
minimal as possible, allowing you to simply overwrite default values
instead of defining each and every one.