Skip to content

Commit 383d22a

Browse files
Fix FieldRule (#2362)
* Fix FieldRule * `username` can also be a list, * `realm.name` is the field name, using an intermediate `realm` object does not work. * `metadata` is not a key: keys are of the form `metadata.key = value` * Apply suggestions from code review Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> * Run `make contrib` * Update RoleMappingRule.ts Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> * Address review comments --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
1 parent 6105510 commit 383d22a

File tree

3 files changed

+15
-49
lines changed

3 files changed

+15
-49
lines changed

output/schema/schema.json

Lines changed: 8 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/security/_types/RoleMappingRule.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,19 @@ import { Name, Names } from '@_types/common'
2626
export class RoleMappingRule {
2727
any?: RoleMappingRule[]
2828
all?: RoleMappingRule[]
29+
// `field` should have been defined as SingleKeyDictionary<String, ScalarValue|ScalarValue[]>
30+
// However, this was initially defined as a container with a limited number of variants,
31+
// and was later made non_exhaustive to limit breaking changes.
2932
field?: FieldRule
3033
except?: RoleMappingRule
3134
}
3235

3336
/**
3437
* @variants container
38+
* @non_exhaustive
3539
*/
3640
export class FieldRule {
37-
username?: Name
41+
username?: Names
3842
dn?: Names
3943
groups?: Names
40-
metadata?: UserDefinedValue
41-
realm?: Realm
42-
}
43-
44-
export class Realm {
45-
name: Name
4644
}

0 commit comments

Comments
 (0)