Skip to content

Commit 503711f

Browse files
authored
Merge branch 'main' into v1.5860.0
2 parents 80c6237 + fba0e93 commit 503711f

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
marshalUpdateAPIKeyRequest,
2424
marshalUpdateApplicationRequest,
2525
marshalUpdateGroupRequest,
26+
marshalUpdateOrganizationSecuritySettingsRequest,
2627
marshalUpdatePolicyRequest,
2728
marshalUpdateSSHKeyRequest,
2829
marshalUpdateUserPasswordRequest,
@@ -45,6 +46,7 @@ import {
4546
unmarshalListSSHKeysResponse,
4647
unmarshalListUsersResponse,
4748
unmarshalLog,
49+
unmarshalOrganizationSecuritySettings,
4850
unmarshalPolicy,
4951
unmarshalQuotum,
5052
unmarshalSSHKey,
@@ -77,6 +79,7 @@ import type {
7779
GetGroupRequest,
7880
GetJWTRequest,
7981
GetLogRequest,
82+
GetOrganizationSecuritySettingsRequest,
8083
GetPolicyRequest,
8184
GetQuotumRequest,
8285
GetSSHKeyRequest,
@@ -109,6 +112,7 @@ import type {
109112
ListUsersResponse,
110113
LockUserRequest,
111114
Log,
115+
OrganizationSecuritySettings,
112116
Policy,
113117
Quotum,
114118
RemoveGroupMemberRequest,
@@ -120,6 +124,7 @@ import type {
120124
UpdateAPIKeyRequest,
121125
UpdateApplicationRequest,
122126
UpdateGroupRequest,
127+
UpdateOrganizationSecuritySettingsRequest,
123128
UpdatePolicyRequest,
124129
UpdateSSHKeyRequest,
125130
UpdateUserPasswordRequest,
@@ -1276,4 +1281,48 @@ export class API extends ParentAPI {
12761281
},
12771282
unmarshalLog,
12781283
)
1284+
1285+
/**
1286+
* Get security settings of an Organization. Retrieve information about the
1287+
* security settings of an Organization, specified by the `organization_id`
1288+
* parameter.
1289+
*
1290+
* @param request - The request {@link GetOrganizationSecuritySettingsRequest}
1291+
* @returns A Promise of OrganizationSecuritySettings
1292+
*/
1293+
getOrganizationSecuritySettings = (
1294+
request: Readonly<GetOrganizationSecuritySettingsRequest> = {},
1295+
) =>
1296+
this.client.fetch<OrganizationSecuritySettings>(
1297+
{
1298+
method: 'GET',
1299+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`,
1300+
},
1301+
unmarshalOrganizationSecuritySettings,
1302+
)
1303+
1304+
/**
1305+
* Update the security settings of an Organization.
1306+
*
1307+
* @param request - The request
1308+
* {@link UpdateOrganizationSecuritySettingsRequest}
1309+
* @returns A Promise of OrganizationSecuritySettings
1310+
*/
1311+
updateOrganizationSecuritySettings = (
1312+
request: Readonly<UpdateOrganizationSecuritySettingsRequest> = {},
1313+
) =>
1314+
this.client.fetch<OrganizationSecuritySettings>(
1315+
{
1316+
body: JSON.stringify(
1317+
marshalUpdateOrganizationSecuritySettingsRequest(
1318+
request,
1319+
this.client.settings,
1320+
),
1321+
),
1322+
headers: jsonContentHeaders,
1323+
method: 'PATCH',
1324+
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/security-settings`,
1325+
},
1326+
unmarshalOrganizationSecuritySettings,
1327+
)
12791328
}

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import type {
3838
ListSSHKeysResponse,
3939
ListUsersResponse,
4040
Log,
41+
OrganizationSecuritySettings,
4142
PermissionSet,
4243
Policy,
4344
Quotum,
@@ -51,6 +52,7 @@ import type {
5152
UpdateAPIKeyRequest,
5253
UpdateApplicationRequest,
5354
UpdateGroupRequest,
55+
UpdateOrganizationSecuritySettingsRequest,
5456
UpdatePolicyRequest,
5557
UpdateSSHKeyRequest,
5658
UpdateUserPasswordRequest,
@@ -503,6 +505,22 @@ export const unmarshalListUsersResponse = (
503505
} as ListUsersResponse
504506
}
505507

508+
export const unmarshalOrganizationSecuritySettings = (
509+
data: unknown,
510+
): OrganizationSecuritySettings => {
511+
if (!isJSONObject(data)) {
512+
throw new TypeError(
513+
`Unmarshalling the type 'OrganizationSecuritySettings' failed as data isn't a dictionary.`,
514+
)
515+
}
516+
517+
return {
518+
enforcePasswordRenewal: data.enforce_password_renewal,
519+
gracePeriodDuration: data.grace_period_duration,
520+
loginAttemptsBeforeLocked: data.login_attempts_before_locked,
521+
} as OrganizationSecuritySettings
522+
}
523+
506524
export const unmarshalSetRulesResponse = (data: unknown): SetRulesResponse => {
507525
if (!isJSONObject(data)) {
508526
throw new TypeError(
@@ -696,6 +714,15 @@ export const marshalUpdateGroupRequest = (
696714
tags: request.tags,
697715
})
698716

717+
export const marshalUpdateOrganizationSecuritySettingsRequest = (
718+
request: UpdateOrganizationSecuritySettingsRequest,
719+
defaults: DefaultValues,
720+
): Record<string, unknown> => ({
721+
enforce_password_renewal: request.enforcePasswordRenewal,
722+
grace_period_duration: request.gracePeriodDuration,
723+
login_attempts_before_locked: request.loginAttemptsBeforeLocked,
724+
})
725+
699726
export const marshalUpdatePolicyRequest = (
700727
request: UpdatePolicyRequest,
701728
defaults: DefaultValues,

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,11 @@ export type GetLogRequest = {
671671
logId: string
672672
}
673673

674+
export type GetOrganizationSecuritySettingsRequest = {
675+
/** ID of the Organization. */
676+
organizationId?: string
677+
}
678+
674679
export type GetPolicyRequest = {
675680
/** Id of policy to search. */
676681
policyId: string
@@ -988,6 +993,15 @@ export type LockUserRequest = {
988993
userId: string
989994
}
990995

996+
export interface OrganizationSecuritySettings {
997+
/** Defines whether password renewal is enforced during first login. */
998+
enforcePasswordRenewal: boolean
999+
/** Duration of the grace period to renew password or enable MFA. */
1000+
gracePeriodDuration?: string
1001+
/** Number of login attempts before the account is locked. */
1002+
loginAttemptsBeforeLocked: number
1003+
}
1004+
9911005
export type RemoveGroupMemberRequest = {
9921006
/** ID of the group. */
9931007
groupId: string
@@ -1062,6 +1076,17 @@ export type UpdateGroupRequest = {
10621076
tags?: string[]
10631077
}
10641078

1079+
export type UpdateOrganizationSecuritySettingsRequest = {
1080+
/** ID of the Organization. */
1081+
organizationId?: string
1082+
/** Defines whether password renewal is enforced during first login. */
1083+
enforcePasswordRenewal?: boolean
1084+
/** Duration of the grace period to renew password or enable MFA. */
1085+
gracePeriodDuration?: string
1086+
/** Number of login attempts before the account is locked. */
1087+
loginAttemptsBeforeLocked?: number
1088+
}
1089+
10651090
export type UpdatePolicyRequest = {
10661091
/** Id of policy to update. */
10671092
policyId: string

0 commit comments

Comments
 (0)