Skip to content

Commit 1ecbf2a

Browse files
authored
Fix security get role mapping (#740)
1 parent 65b9ce5 commit 1ecbf2a

File tree

5 files changed

+191
-13
lines changed

5 files changed

+191
-13
lines changed

output/schema/schema.json

Lines changed: 141 additions & 4 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: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/security/_types/RoleMapping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
import { RoleTemplate } from '@security/get_role/types'
2121
import { Metadata } from '@_types/common'
22-
import { RoleMappingRuleBase } from './RoleMappingRuleBase'
22+
import { RoleMappingRule } from './RoleMappingRule'
2323

2424
export class RoleMapping {
2525
enabled: boolean
2626
metadata: Metadata
2727
roles: string[]
28-
rules: RoleMappingRuleBase
28+
rules: RoleMappingRule
2929
role_templates?: RoleTemplate[]
3030
}

specification/security/_types/RoleMappingRuleBase.ts renamed to specification/security/_types/RoleMappingRule.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,30 @@
1717
* under the License.
1818
*/
1919

20-
export class RoleMappingRuleBase {}
20+
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
21+
import { Name, Names } from '@_types/common'
22+
23+
/**
24+
* @variants container
25+
*/
26+
export class RoleMappingRule {
27+
any?: RoleMappingRule[]
28+
all?: RoleMappingRule[]
29+
field?: FieldRule
30+
except?: RoleMappingRule
31+
}
32+
33+
/**
34+
* @variants container
35+
*/
36+
export class FieldRule {
37+
username?: Name
38+
dn?: Names
39+
groups?: Names
40+
metadata?: UserDefinedValue
41+
realm?: Realm
42+
}
43+
44+
export class Realm {
45+
name: Name
46+
}

specification/security/put_role_mapping/SecurityPutRoleMappingRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import { RoleMappingRuleBase } from '@security/_types/RoleMappingRuleBase'
20+
import { RoleMappingRule } from '@security/_types/RoleMappingRule'
2121
import { RequestBase } from '@_types/Base'
2222
import { Metadata, Name, Refresh } from '@_types/common'
2323

@@ -37,7 +37,7 @@ export interface Request extends RequestBase {
3737
enabled?: boolean
3838
metadata?: Metadata
3939
roles?: string[]
40-
rules?: RoleMappingRuleBase
40+
rules?: RoleMappingRule
4141
run_as?: string[]
4242
}
4343
}

0 commit comments

Comments
 (0)