Skip to content

Commit

Permalink
Fix FieldRule (#2362)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Run `make contrib`

* Update RoleMappingRule.ts

Co-authored-by: Laurent Saint-Félix <[email protected]>

* Address review comments

---------

Co-authored-by: Laurent Saint-Félix <[email protected]>
(cherry picked from commit 383d22a)
  • Loading branch information
pquentin authored and github-actions[bot] committed Jan 15, 2024
1 parent 6e51d84 commit e87d5e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 49 deletions.
43 changes: 8 additions & 35 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions specification/security/_types/RoleMappingRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@ import { Name, Names } from '@_types/common'
export class RoleMappingRule {
any?: RoleMappingRule[]
all?: RoleMappingRule[]
// `field` should have been defined as SingleKeyDictionary<String, ScalarValue|ScalarValue[]>
// However, this was initially defined as a container with a limited number of variants,
// and was later made non_exhaustive to limit breaking changes.
field?: FieldRule
except?: RoleMappingRule
}

/**
* @variants container
* @non_exhaustive
*/
export class FieldRule {
username?: Name
username?: Names
dn?: Names
groups?: Names
metadata?: UserDefinedValue
realm?: Realm
}

export class Realm {
name: Name
}

0 comments on commit e87d5e6

Please sign in to comment.