/
groupMapper.go
559 lines (495 loc) · 29.2 KB
/
groupMapper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ldap
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Allows for creating and managing group mappers for Keycloak users federated via LDAP.
//
// The LDAP group mapper can be used to map an LDAP user's groups from some DN to Keycloak groups. This group mapper will also
// create the groups within Keycloak if they do not already exist.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-keycloak/sdk/v4/go/keycloak"
// "github.com/pulumi/pulumi-keycloak/sdk/v4/go/keycloak/ldap"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
// Realm: pulumi.String("my-realm"),
// Enabled: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// ldapUserFederation, err := ldap.NewUserFederation(ctx, "ldapUserFederation", &ldap.UserFederationArgs{
// RealmId: realm.ID(),
// UsernameLdapAttribute: pulumi.String("cn"),
// RdnLdapAttribute: pulumi.String("cn"),
// UuidLdapAttribute: pulumi.String("entryDN"),
// UserObjectClasses: pulumi.StringArray{
// pulumi.String("simpleSecurityObject"),
// pulumi.String("organizationalRole"),
// },
// ConnectionUrl: pulumi.String("ldap://openldap"),
// UsersDn: pulumi.String("dc=example,dc=org"),
// BindDn: pulumi.String("cn=admin,dc=example,dc=org"),
// BindCredential: pulumi.String("admin"),
// })
// if err != nil {
// return err
// }
// _, err = ldap.NewGroupMapper(ctx, "ldapGroupMapper", &ldap.GroupMapperArgs{
// RealmId: realm.ID(),
// LdapUserFederationId: ldapUserFederation.ID(),
// LdapGroupsDn: pulumi.String("dc=example,dc=org"),
// GroupNameLdapAttribute: pulumi.String("cn"),
// GroupObjectClasses: pulumi.StringArray{
// pulumi.String("groupOfNames"),
// },
// MembershipAttributeType: pulumi.String("DN"),
// MembershipLdapAttribute: pulumi.String("member"),
// MembershipUserLdapAttribute: pulumi.String("cn"),
// MemberofLdapAttribute: pulumi.String("memberOf"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// LDAP mappers can be imported using the format `{{realm_id}}/{{ldap_user_federation_id}}/{{ldap_mapper_id}}`. The ID of the LDAP user federation provider and the mapper can be found within the Keycloak GUI, and they are typically GUIDs. Examplebash
//
// ```sh
// $ pulumi import keycloak:ldap/groupMapper:GroupMapper ldap_group_mapper my-realm/af2a6ca3-e4d7-49c3-b08b-1b3c70b4b860/3d923ece-1a91-4bf7-adaf-3b82f2a12b67
// ```
type GroupMapper struct {
pulumi.CustomResourceState
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
DropNonExistingGroupsDuringSync pulumi.BoolPtrOutput `pulumi:"dropNonExistingGroupsDuringSync"`
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
GroupNameLdapAttribute pulumi.StringOutput `pulumi:"groupNameLdapAttribute"`
// List of strings representing the object classes for the group. Must contain at least one.
GroupObjectClasses pulumi.StringArrayOutput `pulumi:"groupObjectClasses"`
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
GroupsLdapFilter pulumi.StringPtrOutput `pulumi:"groupsLdapFilter"`
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
GroupsPath pulumi.StringOutput `pulumi:"groupsPath"`
// When `true`, missing groups in the hierarchy will be ignored.
IgnoreMissingGroups pulumi.BoolPtrOutput `pulumi:"ignoreMissingGroups"`
// The LDAP DN where groups can be found.
LdapGroupsDn pulumi.StringOutput `pulumi:"ldapGroupsDn"`
// The ID of the LDAP user federation provider to attach this mapper to.
LdapUserFederationId pulumi.StringOutput `pulumi:"ldapUserFederationId"`
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
MappedGroupAttributes pulumi.StringArrayOutput `pulumi:"mappedGroupAttributes"`
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
MemberofLdapAttribute pulumi.StringPtrOutput `pulumi:"memberofLdapAttribute"`
// Can be one of `DN` or `UID`. Defaults to `DN`.
MembershipAttributeType pulumi.StringPtrOutput `pulumi:"membershipAttributeType"`
// The name of the LDAP attribute that is used for membership mappings.
MembershipLdapAttribute pulumi.StringOutput `pulumi:"membershipLdapAttribute"`
// The name of the LDAP attribute on a user that is used for membership mappings.
MembershipUserLdapAttribute pulumi.StringOutput `pulumi:"membershipUserLdapAttribute"`
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
Mode pulumi.StringPtrOutput `pulumi:"mode"`
// Display name of this mapper when displayed in the console.
Name pulumi.StringOutput `pulumi:"name"`
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
PreserveGroupInheritance pulumi.BoolPtrOutput `pulumi:"preserveGroupInheritance"`
// The realm that this LDAP mapper will exist in.
RealmId pulumi.StringOutput `pulumi:"realmId"`
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
UserRolesRetrieveStrategy pulumi.StringPtrOutput `pulumi:"userRolesRetrieveStrategy"`
}
// NewGroupMapper registers a new resource with the given unique name, arguments, and options.
func NewGroupMapper(ctx *pulumi.Context,
name string, args *GroupMapperArgs, opts ...pulumi.ResourceOption) (*GroupMapper, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GroupNameLdapAttribute == nil {
return nil, errors.New("invalid value for required argument 'GroupNameLdapAttribute'")
}
if args.GroupObjectClasses == nil {
return nil, errors.New("invalid value for required argument 'GroupObjectClasses'")
}
if args.LdapGroupsDn == nil {
return nil, errors.New("invalid value for required argument 'LdapGroupsDn'")
}
if args.LdapUserFederationId == nil {
return nil, errors.New("invalid value for required argument 'LdapUserFederationId'")
}
if args.MembershipLdapAttribute == nil {
return nil, errors.New("invalid value for required argument 'MembershipLdapAttribute'")
}
if args.MembershipUserLdapAttribute == nil {
return nil, errors.New("invalid value for required argument 'MembershipUserLdapAttribute'")
}
if args.RealmId == nil {
return nil, errors.New("invalid value for required argument 'RealmId'")
}
var resource GroupMapper
err := ctx.RegisterResource("keycloak:ldap/groupMapper:GroupMapper", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupMapper gets an existing GroupMapper resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGroupMapper(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupMapperState, opts ...pulumi.ResourceOption) (*GroupMapper, error) {
var resource GroupMapper
err := ctx.ReadResource("keycloak:ldap/groupMapper:GroupMapper", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupMapper resources.
type groupMapperState struct {
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
DropNonExistingGroupsDuringSync *bool `pulumi:"dropNonExistingGroupsDuringSync"`
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
GroupNameLdapAttribute *string `pulumi:"groupNameLdapAttribute"`
// List of strings representing the object classes for the group. Must contain at least one.
GroupObjectClasses []string `pulumi:"groupObjectClasses"`
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
GroupsLdapFilter *string `pulumi:"groupsLdapFilter"`
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
GroupsPath *string `pulumi:"groupsPath"`
// When `true`, missing groups in the hierarchy will be ignored.
IgnoreMissingGroups *bool `pulumi:"ignoreMissingGroups"`
// The LDAP DN where groups can be found.
LdapGroupsDn *string `pulumi:"ldapGroupsDn"`
// The ID of the LDAP user federation provider to attach this mapper to.
LdapUserFederationId *string `pulumi:"ldapUserFederationId"`
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
MappedGroupAttributes []string `pulumi:"mappedGroupAttributes"`
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
MemberofLdapAttribute *string `pulumi:"memberofLdapAttribute"`
// Can be one of `DN` or `UID`. Defaults to `DN`.
MembershipAttributeType *string `pulumi:"membershipAttributeType"`
// The name of the LDAP attribute that is used for membership mappings.
MembershipLdapAttribute *string `pulumi:"membershipLdapAttribute"`
// The name of the LDAP attribute on a user that is used for membership mappings.
MembershipUserLdapAttribute *string `pulumi:"membershipUserLdapAttribute"`
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
Mode *string `pulumi:"mode"`
// Display name of this mapper when displayed in the console.
Name *string `pulumi:"name"`
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
PreserveGroupInheritance *bool `pulumi:"preserveGroupInheritance"`
// The realm that this LDAP mapper will exist in.
RealmId *string `pulumi:"realmId"`
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
UserRolesRetrieveStrategy *string `pulumi:"userRolesRetrieveStrategy"`
}
type GroupMapperState struct {
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
DropNonExistingGroupsDuringSync pulumi.BoolPtrInput
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
GroupNameLdapAttribute pulumi.StringPtrInput
// List of strings representing the object classes for the group. Must contain at least one.
GroupObjectClasses pulumi.StringArrayInput
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
GroupsLdapFilter pulumi.StringPtrInput
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
GroupsPath pulumi.StringPtrInput
// When `true`, missing groups in the hierarchy will be ignored.
IgnoreMissingGroups pulumi.BoolPtrInput
// The LDAP DN where groups can be found.
LdapGroupsDn pulumi.StringPtrInput
// The ID of the LDAP user federation provider to attach this mapper to.
LdapUserFederationId pulumi.StringPtrInput
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
MappedGroupAttributes pulumi.StringArrayInput
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
MemberofLdapAttribute pulumi.StringPtrInput
// Can be one of `DN` or `UID`. Defaults to `DN`.
MembershipAttributeType pulumi.StringPtrInput
// The name of the LDAP attribute that is used for membership mappings.
MembershipLdapAttribute pulumi.StringPtrInput
// The name of the LDAP attribute on a user that is used for membership mappings.
MembershipUserLdapAttribute pulumi.StringPtrInput
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
Mode pulumi.StringPtrInput
// Display name of this mapper when displayed in the console.
Name pulumi.StringPtrInput
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
PreserveGroupInheritance pulumi.BoolPtrInput
// The realm that this LDAP mapper will exist in.
RealmId pulumi.StringPtrInput
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
UserRolesRetrieveStrategy pulumi.StringPtrInput
}
func (GroupMapperState) ElementType() reflect.Type {
return reflect.TypeOf((*groupMapperState)(nil)).Elem()
}
type groupMapperArgs struct {
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
DropNonExistingGroupsDuringSync *bool `pulumi:"dropNonExistingGroupsDuringSync"`
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
GroupNameLdapAttribute string `pulumi:"groupNameLdapAttribute"`
// List of strings representing the object classes for the group. Must contain at least one.
GroupObjectClasses []string `pulumi:"groupObjectClasses"`
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
GroupsLdapFilter *string `pulumi:"groupsLdapFilter"`
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
GroupsPath *string `pulumi:"groupsPath"`
// When `true`, missing groups in the hierarchy will be ignored.
IgnoreMissingGroups *bool `pulumi:"ignoreMissingGroups"`
// The LDAP DN where groups can be found.
LdapGroupsDn string `pulumi:"ldapGroupsDn"`
// The ID of the LDAP user federation provider to attach this mapper to.
LdapUserFederationId string `pulumi:"ldapUserFederationId"`
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
MappedGroupAttributes []string `pulumi:"mappedGroupAttributes"`
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
MemberofLdapAttribute *string `pulumi:"memberofLdapAttribute"`
// Can be one of `DN` or `UID`. Defaults to `DN`.
MembershipAttributeType *string `pulumi:"membershipAttributeType"`
// The name of the LDAP attribute that is used for membership mappings.
MembershipLdapAttribute string `pulumi:"membershipLdapAttribute"`
// The name of the LDAP attribute on a user that is used for membership mappings.
MembershipUserLdapAttribute string `pulumi:"membershipUserLdapAttribute"`
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
Mode *string `pulumi:"mode"`
// Display name of this mapper when displayed in the console.
Name *string `pulumi:"name"`
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
PreserveGroupInheritance *bool `pulumi:"preserveGroupInheritance"`
// The realm that this LDAP mapper will exist in.
RealmId string `pulumi:"realmId"`
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
UserRolesRetrieveStrategy *string `pulumi:"userRolesRetrieveStrategy"`
}
// The set of arguments for constructing a GroupMapper resource.
type GroupMapperArgs struct {
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
DropNonExistingGroupsDuringSync pulumi.BoolPtrInput
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
GroupNameLdapAttribute pulumi.StringInput
// List of strings representing the object classes for the group. Must contain at least one.
GroupObjectClasses pulumi.StringArrayInput
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
GroupsLdapFilter pulumi.StringPtrInput
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
GroupsPath pulumi.StringPtrInput
// When `true`, missing groups in the hierarchy will be ignored.
IgnoreMissingGroups pulumi.BoolPtrInput
// The LDAP DN where groups can be found.
LdapGroupsDn pulumi.StringInput
// The ID of the LDAP user federation provider to attach this mapper to.
LdapUserFederationId pulumi.StringInput
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
MappedGroupAttributes pulumi.StringArrayInput
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
MemberofLdapAttribute pulumi.StringPtrInput
// Can be one of `DN` or `UID`. Defaults to `DN`.
MembershipAttributeType pulumi.StringPtrInput
// The name of the LDAP attribute that is used for membership mappings.
MembershipLdapAttribute pulumi.StringInput
// The name of the LDAP attribute on a user that is used for membership mappings.
MembershipUserLdapAttribute pulumi.StringInput
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
Mode pulumi.StringPtrInput
// Display name of this mapper when displayed in the console.
Name pulumi.StringPtrInput
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
PreserveGroupInheritance pulumi.BoolPtrInput
// The realm that this LDAP mapper will exist in.
RealmId pulumi.StringInput
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
UserRolesRetrieveStrategy pulumi.StringPtrInput
}
func (GroupMapperArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupMapperArgs)(nil)).Elem()
}
type GroupMapperInput interface {
pulumi.Input
ToGroupMapperOutput() GroupMapperOutput
ToGroupMapperOutputWithContext(ctx context.Context) GroupMapperOutput
}
func (*GroupMapper) ElementType() reflect.Type {
return reflect.TypeOf((**GroupMapper)(nil)).Elem()
}
func (i *GroupMapper) ToGroupMapperOutput() GroupMapperOutput {
return i.ToGroupMapperOutputWithContext(context.Background())
}
func (i *GroupMapper) ToGroupMapperOutputWithContext(ctx context.Context) GroupMapperOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupMapperOutput)
}
// GroupMapperArrayInput is an input type that accepts GroupMapperArray and GroupMapperArrayOutput values.
// You can construct a concrete instance of `GroupMapperArrayInput` via:
//
// GroupMapperArray{ GroupMapperArgs{...} }
type GroupMapperArrayInput interface {
pulumi.Input
ToGroupMapperArrayOutput() GroupMapperArrayOutput
ToGroupMapperArrayOutputWithContext(context.Context) GroupMapperArrayOutput
}
type GroupMapperArray []GroupMapperInput
func (GroupMapperArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupMapper)(nil)).Elem()
}
func (i GroupMapperArray) ToGroupMapperArrayOutput() GroupMapperArrayOutput {
return i.ToGroupMapperArrayOutputWithContext(context.Background())
}
func (i GroupMapperArray) ToGroupMapperArrayOutputWithContext(ctx context.Context) GroupMapperArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupMapperArrayOutput)
}
// GroupMapperMapInput is an input type that accepts GroupMapperMap and GroupMapperMapOutput values.
// You can construct a concrete instance of `GroupMapperMapInput` via:
//
// GroupMapperMap{ "key": GroupMapperArgs{...} }
type GroupMapperMapInput interface {
pulumi.Input
ToGroupMapperMapOutput() GroupMapperMapOutput
ToGroupMapperMapOutputWithContext(context.Context) GroupMapperMapOutput
}
type GroupMapperMap map[string]GroupMapperInput
func (GroupMapperMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupMapper)(nil)).Elem()
}
func (i GroupMapperMap) ToGroupMapperMapOutput() GroupMapperMapOutput {
return i.ToGroupMapperMapOutputWithContext(context.Background())
}
func (i GroupMapperMap) ToGroupMapperMapOutputWithContext(ctx context.Context) GroupMapperMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupMapperMapOutput)
}
type GroupMapperOutput struct{ *pulumi.OutputState }
func (GroupMapperOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GroupMapper)(nil)).Elem()
}
func (o GroupMapperOutput) ToGroupMapperOutput() GroupMapperOutput {
return o
}
func (o GroupMapperOutput) ToGroupMapperOutputWithContext(ctx context.Context) GroupMapperOutput {
return o
}
// When `true`, groups that no longer exist within LDAP will be dropped in Keycloak during sync. Defaults to `false`.
func (o GroupMapperOutput) DropNonExistingGroupsDuringSync() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.BoolPtrOutput { return v.DropNonExistingGroupsDuringSync }).(pulumi.BoolPtrOutput)
}
// The name of the LDAP attribute that is used in group objects for the name and RDN of the group. Typically `cn`.
func (o GroupMapperOutput) GroupNameLdapAttribute() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.GroupNameLdapAttribute }).(pulumi.StringOutput)
}
// List of strings representing the object classes for the group. Must contain at least one.
func (o GroupMapperOutput) GroupObjectClasses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringArrayOutput { return v.GroupObjectClasses }).(pulumi.StringArrayOutput)
}
// When specified, adds an additional custom filter to be used when querying for groups. Must start with `(` and end with `)`.
func (o GroupMapperOutput) GroupsLdapFilter() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringPtrOutput { return v.GroupsLdapFilter }).(pulumi.StringPtrOutput)
}
// Keycloak group path the LDAP groups are added to. For example if value `/Applications/App1` is used, then LDAP groups will be available in Keycloak under group `App1`, which is the child of top level group `Applications`. The configured group path must already exist in Keycloak when creating this mapper.
func (o GroupMapperOutput) GroupsPath() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.GroupsPath }).(pulumi.StringOutput)
}
// When `true`, missing groups in the hierarchy will be ignored.
func (o GroupMapperOutput) IgnoreMissingGroups() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.BoolPtrOutput { return v.IgnoreMissingGroups }).(pulumi.BoolPtrOutput)
}
// The LDAP DN where groups can be found.
func (o GroupMapperOutput) LdapGroupsDn() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.LdapGroupsDn }).(pulumi.StringOutput)
}
// The ID of the LDAP user federation provider to attach this mapper to.
func (o GroupMapperOutput) LdapUserFederationId() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.LdapUserFederationId }).(pulumi.StringOutput)
}
// Array of strings representing attributes on the LDAP group which will be mapped to attributes on the Keycloak group.
func (o GroupMapperOutput) MappedGroupAttributes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringArrayOutput { return v.MappedGroupAttributes }).(pulumi.StringArrayOutput)
}
// Specifies the name of the LDAP attribute on the LDAP user that contains the groups the user is a member of. Defaults to `memberOf`.
func (o GroupMapperOutput) MemberofLdapAttribute() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringPtrOutput { return v.MemberofLdapAttribute }).(pulumi.StringPtrOutput)
}
// Can be one of `DN` or `UID`. Defaults to `DN`.
func (o GroupMapperOutput) MembershipAttributeType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringPtrOutput { return v.MembershipAttributeType }).(pulumi.StringPtrOutput)
}
// The name of the LDAP attribute that is used for membership mappings.
func (o GroupMapperOutput) MembershipLdapAttribute() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.MembershipLdapAttribute }).(pulumi.StringOutput)
}
// The name of the LDAP attribute on a user that is used for membership mappings.
func (o GroupMapperOutput) MembershipUserLdapAttribute() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.MembershipUserLdapAttribute }).(pulumi.StringOutput)
}
// Can be one of `READ_ONLY`, `LDAP_ONLY` or `IMPORT`. Defaults to `READ_ONLY`.
func (o GroupMapperOutput) Mode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringPtrOutput { return v.Mode }).(pulumi.StringPtrOutput)
}
// Display name of this mapper when displayed in the console.
func (o GroupMapperOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// When `true`, group inheritance will be propagated from LDAP to Keycloak. When `false`, all LDAP groups will be propagated as top level groups within Keycloak.
func (o GroupMapperOutput) PreserveGroupInheritance() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.BoolPtrOutput { return v.PreserveGroupInheritance }).(pulumi.BoolPtrOutput)
}
// The realm that this LDAP mapper will exist in.
func (o GroupMapperOutput) RealmId() pulumi.StringOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringOutput { return v.RealmId }).(pulumi.StringOutput)
}
// Can be one of `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`, `GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE`, or `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE_RECURSIVELY`. Defaults to `LOAD_GROUPS_BY_MEMBER_ATTRIBUTE`.
func (o GroupMapperOutput) UserRolesRetrieveStrategy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupMapper) pulumi.StringPtrOutput { return v.UserRolesRetrieveStrategy }).(pulumi.StringPtrOutput)
}
type GroupMapperArrayOutput struct{ *pulumi.OutputState }
func (GroupMapperArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupMapper)(nil)).Elem()
}
func (o GroupMapperArrayOutput) ToGroupMapperArrayOutput() GroupMapperArrayOutput {
return o
}
func (o GroupMapperArrayOutput) ToGroupMapperArrayOutputWithContext(ctx context.Context) GroupMapperArrayOutput {
return o
}
func (o GroupMapperArrayOutput) Index(i pulumi.IntInput) GroupMapperOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GroupMapper {
return vs[0].([]*GroupMapper)[vs[1].(int)]
}).(GroupMapperOutput)
}
type GroupMapperMapOutput struct{ *pulumi.OutputState }
func (GroupMapperMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupMapper)(nil)).Elem()
}
func (o GroupMapperMapOutput) ToGroupMapperMapOutput() GroupMapperMapOutput {
return o
}
func (o GroupMapperMapOutput) ToGroupMapperMapOutputWithContext(ctx context.Context) GroupMapperMapOutput {
return o
}
func (o GroupMapperMapOutput) MapIndex(k pulumi.StringInput) GroupMapperOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GroupMapper {
return vs[0].(map[string]*GroupMapper)[vs[1].(string)]
}).(GroupMapperOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GroupMapperInput)(nil)).Elem(), &GroupMapper{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupMapperArrayInput)(nil)).Elem(), GroupMapperArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupMapperMapInput)(nil)).Elem(), GroupMapperMap{})
pulumi.RegisterOutputType(GroupMapperOutput{})
pulumi.RegisterOutputType(GroupMapperArrayOutput{})
pulumi.RegisterOutputType(GroupMapperMapOutput{})
}