Use provider specific settings#1
Merged
jkakavas merged 8 commits intojkakavas:oidc-auth-provider2from May 21, 2019
Merged
Conversation
Owner
|
Thanks @kobelb ! LGTM, but I'll give Larry the chance to go through it too before applying |
legrego
approved these changes
May 21, 2019
| throw new Error('Realm name must be specified'); | ||
| } | ||
|
|
||
| if (type(oidcOptions.realm) !== 'string') { |
There was a problem hiding this comment.
Not a criticism, just a question: what does this give us over the built in typeof operator?
Author
There was a problem hiding this comment.
For string type checking, we could just use typeof directly, it mainly comes in handy for those “gotcha types”.
jkakavas
pushed a commit
that referenced
this pull request
May 29, 2019
* Introduce new convention for config definition. We need to define a way to acquire configuration schema as a part of plugin definition. Having schema we can split steps of config validation and plugin instantiation. * Discover plugins, read their schema and validate the config. Config validation finished before core services and plugins read from it. That allows us to fail fast and have predictable validation results. * Instantiate plugins using DiscoveredPluginsDefinitions. * Update tests for new API. * test server is not created if config validation fails * move plugin discovery to plugin service pre-setup stage. Set validation schemes in ConfigService.preSetup stage. * fix eslint problem * generate docs * address Rudolfs comments * separate core services and plugins validation * rename files for consistency * address comments for root.js * address comments #1 * useSchema everywhere for consistency. get rid of validateAll * plugin system runs plugin config validation * rename configDefinition * move plugin schema registration in plugins plugins service plugins system is not setup when kibana is run in optimizer mode, so config keys aren't marked as applied. * cleanup * update docs * address comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The approach which we originally implemented where we extended from
AuthenticationProviderOptionswasn't playing nicely with TypeScript. Long-term, we should allow auth providers to specify their config schema and ideally use something like kbn-config-schema to generate types from these. However, we're not quite there yet, so we're stuck withtype AuthenticationProviderSpecificOptions = Record<string, unknown>for the time being and doing the type checking in the auth provider constructor itself (even though the schema itself should prevent this from ever being needed).I also made some changes to make the
xpack.security.authc.oidc.realmrequired usingJoiwhenxpack.security.authProviderscontains'oidc'.