Skip to content

Commit

Permalink
fix type on security config
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Apr 17, 2020
1 parent 3c28c21 commit 58e2756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/server/http/router/validator/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { ValidationError, Type, schema, ObjectType } from '@kbn/config-schema';
import { ValidationError, Type, schema, ObjectType, TypeOf } from '@kbn/config-schema';
import { Stream } from 'stream';
import { RouteValidationError } from './validator_error';

Expand Down Expand Up @@ -85,7 +85,7 @@ type RouteValidationResultType<T extends RouteValidationSpec<any> | undefined> =
T extends RouteValidationFunction<any>
? ReturnType<T>['value']
: T extends Type<any>
? ReturnType<T['validate']>
? TypeOf<T>
: undefined
>;

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/security/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const providersConfigSchema = schema.object(
{
validate(config) {
const checks = { sameOrder: new Map<number, string>(), sameName: new Map<string, string>() };
for (const [providerType, providerGroup] of Object.entries(config)) {
for (const [providerName, { enabled, order }] of Object.entries(providerGroup ?? {})) {
for (const [providerType, providerGroup] of Object.entries<any>(config)) {
for (const [providerName, { enabled, order }] of Object.entries<any>(providerGroup ?? {})) {
if (!enabled) {
continue;
}
Expand Down

0 comments on commit 58e2756

Please sign in to comment.