Skip to content

Commit

Permalink
fix ObjectTypeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Apr 17, 2020
1 parent 58e2756 commit 996cd13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions packages/kbn-config-schema/src/types/object_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ interface UnknownOptions {
unknowns?: 'allow' | 'ignore' | 'forbid';
}

export type ObjectTypeOptions<P extends Props = any> = TypeOptions<
{ [K in keyof OptionalProperties<P>]?: TypeOf<P[K]> } &
{ [K in keyof RequiredProperties<P>]: TypeOf<P[K]> }
> &
export type ObjectTypeOptions<P extends Props = any> = TypeOptions<ObjectResultType<P>> &
UnknownOptions;

export class ObjectType<P extends Props = any> extends Type<ObjectResultType<P>> {
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<any>(config)) {
for (const [providerName, { enabled, order }] of Object.entries<any>(providerGroup ?? {})) {
for (const [providerType, providerGroup] of Object.entries(config)) {
for (const [providerName, { enabled, order }] of Object.entries(providerGroup ?? {})) {
if (!enabled) {
continue;
}
Expand Down

0 comments on commit 996cd13

Please sign in to comment.