Skip to content

Commit 176ba72

Browse files
authored
feat(iam): add tags on applications, groups, users and policies (#1013)
1 parent 76a7755 commit 176ba72

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

packages/clients/src/api/iam/v1alpha1/api.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ export class API extends ParentAPI {
250250
'page_size',
251251
request.pageSize ?? this.client.settings.defaultPageSize,
252252
],
253+
['tag', request.tag],
253254
['user_ids', request.userIds],
254255
),
255256
},
@@ -349,6 +350,7 @@ export class API extends ParentAPI {
349350
'page_size',
350351
request.pageSize ?? this.client.settings.defaultPageSize,
351352
],
353+
['tag', request.tag],
352354
),
353355
},
354356
unmarshalListApplicationsResponse,
@@ -469,6 +471,7 @@ export class API extends ParentAPI {
469471
'page_size',
470472
request.pageSize ?? this.client.settings.defaultPageSize,
471473
],
474+
['tag', request.tag],
472475
['user_ids', request.userIds],
473476
),
474477
},
@@ -694,6 +697,7 @@ export class API extends ParentAPI {
694697
request.pageSize ?? this.client.settings.defaultPageSize,
695698
],
696699
['policy_name', request.policyName],
700+
['tag', request.tag],
697701
['user_ids', request.userIds],
698702
),
699703
},

packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const unmarshalApplication = (data: unknown): Application => {
107107
name: data.name,
108108
nbApiKeys: data.nb_api_keys,
109109
organizationId: data.organization_id,
110+
tags: data.tags,
110111
updatedAt: unmarshalDate(data.updated_at),
111112
} as Application
112113
}
@@ -125,6 +126,7 @@ export const unmarshalGroup = (data: unknown): Group => {
125126
id: data.id,
126127
name: data.name,
127128
organizationId: data.organization_id,
129+
tags: data.tags,
128130
updatedAt: unmarshalDate(data.updated_at),
129131
userIds: data.user_ids,
130132
} as Group
@@ -170,6 +172,7 @@ export const unmarshalPolicy = (data: unknown): Policy => {
170172
nbScopes: data.nb_scopes,
171173
noPrincipal: data.no_principal,
172174
organizationId: data.organization_id,
175+
tags: data.tags,
173176
updatedAt: unmarshalDate(data.updated_at),
174177
userId: data.user_id,
175178
} as Policy
@@ -226,6 +229,7 @@ export const unmarshalUser = (data: unknown): User => {
226229
mfa: data.mfa,
227230
organizationId: data.organization_id,
228231
status: data.status,
232+
tags: data.tags,
229233
twoFactorEnabled: data.two_factor_enabled,
230234
type: data.type,
231235
updatedAt: unmarshalDate(data.updated_at),
@@ -482,6 +486,7 @@ export const marshalCreateApplicationRequest = (
482486
description: request.description,
483487
name: request.name || randomName('app'),
484488
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
489+
tags: request.tags,
485490
})
486491

487492
export const marshalCreateGroupRequest = (
@@ -491,6 +496,7 @@ export const marshalCreateGroupRequest = (
491496
description: request.description,
492497
name: request.name || randomName('grp'),
493498
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
499+
tags: request.tags,
494500
})
495501

496502
const marshalRuleSpecs = (
@@ -515,6 +521,7 @@ export const marshalCreatePolicyRequest = (
515521
request.rules !== undefined
516522
? request.rules.map(elt => marshalRuleSpecs(elt, defaults))
517523
: undefined,
524+
tags: request.tags,
518525
...resolveOneOf<string | boolean>([
519526
{ param: 'user_id', value: request.userId },
520527
{ param: 'group_id', value: request.groupId },
@@ -538,6 +545,7 @@ export const marshalCreateUserRequest = (
538545
): Record<string, unknown> => ({
539546
email: request.email,
540547
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
548+
tags: request.tags,
541549
})
542550

543551
export const marshalRemoveGroupMemberRequest = (
@@ -580,6 +588,7 @@ export const marshalUpdateApplicationRequest = (
580588
): Record<string, unknown> => ({
581589
description: request.description,
582590
name: request.name,
591+
tags: request.tags,
583592
})
584593

585594
export const marshalUpdateGroupRequest = (
@@ -588,6 +597,7 @@ export const marshalUpdateGroupRequest = (
588597
): Record<string, unknown> => ({
589598
description: request.description,
590599
name: request.name,
600+
tags: request.tags,
591601
})
592602

593603
export const marshalUpdatePolicyRequest = (
@@ -596,6 +606,7 @@ export const marshalUpdatePolicyRequest = (
596606
): Record<string, unknown> => ({
597607
description: request.description,
598608
name: request.name,
609+
tags: request.tags,
599610
...resolveOneOf<string | boolean>([
600611
{ param: 'user_id', value: request.userId },
601612
{ param: 'group_id', value: request.groupId },

packages/clients/src/api/iam/v1alpha1/types.gen.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ export interface Application {
177177
editable: boolean
178178
/** Number of API keys attributed to the application. */
179179
nbApiKeys: number
180+
/** Tags associated with the user. */
181+
tags: string[]
180182
}
181183

182184
export interface Group {
@@ -196,6 +198,8 @@ export interface Group {
196198
userIds: string[]
197199
/** IDs of applications attached to this group. */
198200
applicationIds: string[]
201+
/** Tags associated to the group. */
202+
tags: string[]
199203
}
200204

201205
export interface Log {
@@ -253,6 +257,8 @@ export interface Policy {
253257
nbScopes: number
254258
/** Number of permission sets of the policy. */
255259
nbPermissionSets: number
260+
/** Tags associated with the policy. */
261+
tags: string[]
256262
/**
257263
* ID of the user attributed to the policy.
258264
*
@@ -376,6 +382,8 @@ export interface User {
376382
mfa: boolean
377383
/** ID of the account root user associated with the user. */
378384
accountRootUserId: string
385+
/** Tags associated with the user. */
386+
tags: string[]
379387
}
380388

381389
export type AddGroupMemberRequest = {
@@ -436,6 +444,8 @@ export type CreateApplicationRequest = {
436444
organizationId?: string
437445
/** Description of the application (max length is 200 characters). */
438446
description: string
447+
/** Tags associated with the application (maximum of 10 tags). */
448+
tags?: string[]
439449
}
440450

441451
export type CreateGroupRequest = {
@@ -448,6 +458,8 @@ export type CreateGroupRequest = {
448458
name?: string
449459
/** Description of the group to create (max length is 200 chars). */
450460
description: string
461+
/** Tags associated with the group (maximum of 10 tags). */
462+
tags?: string[]
451463
}
452464

453465
export type CreatePolicyRequest = {
@@ -459,6 +471,8 @@ export type CreatePolicyRequest = {
459471
organizationId?: string
460472
/** Rules of the policy to create. */
461473
rules?: RuleSpecs[]
474+
/** Tags associated with the policy (maximum of 10 tags). */
475+
tags?: string[]
462476
/**
463477
* ID of user attributed to the policy.
464478
*
@@ -506,6 +520,8 @@ export type CreateUserRequest = {
506520
organizationId?: string
507521
/** Email of the user. */
508522
email: string
523+
/** Tags associated with the user. */
524+
tags?: string[]
509525
}
510526

511527
export type DeleteAPIKeyRequest = {
@@ -646,6 +662,8 @@ export type ListApplicationsRequest = {
646662
editable?: boolean
647663
/** Filter by list of IDs. */
648664
applicationIds?: string[]
665+
/** Filter by tags containing a given string. */
666+
tag?: string
649667
}
650668

651669
export interface ListApplicationsResponse {
@@ -672,6 +690,8 @@ export type ListGroupsRequest = {
672690
userIds?: string[]
673691
/** Filter by a list of group IDs. */
674692
groupIds?: string[]
693+
/** Filter by tags containing a given string. */
694+
tag?: string
675695
}
676696

677697
export interface ListGroupsResponse {
@@ -766,6 +786,8 @@ export type ListPoliciesRequest = {
766786
noPrincipal?: boolean
767787
/** Name of the policy to fetch. */
768788
policyName?: string
789+
/** Filter by tags containing a given string. */
790+
tag?: string
769791
}
770792

771793
export interface ListPoliciesResponse {
@@ -846,6 +868,8 @@ export type ListUsersRequest = {
846868
userIds?: string[]
847869
/** Filter by MFA status. */
848870
mfa?: boolean
871+
/** Filter by tags containing a given string. */
872+
tag?: string
849873
}
850874

851875
export interface ListUsersResponse {
@@ -906,6 +930,8 @@ export type UpdateApplicationRequest = {
906930
name?: string
907931
/** New description for the application (max length is 200 chars). */
908932
description?: string
933+
/** New tags for the application (maximum of 10 tags). */
934+
tags?: string[]
909935
}
910936

911937
export type UpdateGroupRequest = {
@@ -918,6 +944,8 @@ export type UpdateGroupRequest = {
918944
name?: string
919945
/** New description for the group (max length is 200 chars). */
920946
description?: string
947+
/** New tags for the group (maximum of 10 tags). */
948+
tags?: string[]
921949
}
922950

923951
export type UpdatePolicyRequest = {
@@ -927,6 +955,8 @@ export type UpdatePolicyRequest = {
927955
name?: string
928956
/** New description of policy (max length is 200 characters). */
929957
description?: string
958+
/** New tags for the policy (maximum of 10 tags). */
959+
tags?: string[]
930960
/**
931961
* New ID of user attributed to the policy.
932962
*

0 commit comments

Comments
 (0)