Skip to content

Commit 41402f1

Browse files
committed
Add OpenAPI spec for IP whitelisting.
1 parent a06f7e6 commit 41402f1

4 files changed

Lines changed: 75 additions & 0 deletions

File tree

packages/marble-api/openapis/marblecore-api.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ paths:
273273
$ref: ./marblecore-api/admin.yml#/~1organizations
274274
/organizations/{organizationId}:
275275
$ref: ./marblecore-api/admin.yml#/~1organizations~1{organizationId}
276+
/organizations/{organizationId}/subnets:
277+
$ref: ./marblecore-api/admin.yml#/~1organizations~1{organizationId}~1subnets
276278
/organizations/{organizationId}/users:
277279
$ref: ./marblecore-api/admin.yml#/~1organizations~1{organizationId}~1users
278280
/editor/{scenarioId}/identifiers:

packages/marble-api/openapis/marblecore-api/_schemas.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ CreateOrganizationBodyDto:
348348
$ref: admin.yml#/components/schemas/CreateOrganizationBodyDto
349349
UpdateOrganizationBodyDto:
350350
$ref: admin.yml#/components/schemas/UpdateOrganizationBodyDto
351+
OrganizationSubnetsDto:
352+
$ref: admin.yml#/components/schemas/OrganizationSubnetsDto
351353
UserDto:
352354
$ref: admin.yml#/components/schemas/UserDto
353355
CreateUser:

packages/marble-api/openapis/marblecore-api/admin.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,41 @@
405405
$ref: 'components.yml#/responses/403'
406406
'404':
407407
$ref: 'components.yml#/responses/404'
408+
/organizations/{organizationId}/subnets:
409+
put:
410+
tags:
411+
- Admin
412+
- Organizations
413+
summary: Update organization subnets
414+
operationId: updateOrganizationSubnets
415+
security:
416+
- bearerAuth: []
417+
parameters:
418+
- name: organizationId
419+
description: ID of the organization
420+
in: path
421+
required: true
422+
schema:
423+
type: string
424+
format: uuid
425+
requestBody:
426+
description: Object containing the list of subnets to allow
427+
content:
428+
application/json:
429+
schema:
430+
$ref: '#/components/schemas/OrganizationSubnetsDto'
431+
required: true
432+
responses:
433+
'200':
434+
description: The list of users of the organization
435+
content:
436+
application/json:
437+
schema:
438+
$ref: '#/components/schemas/OrganizationSubnetsDto'
439+
'400':
440+
$ref: 'components.yml#/responses/400'
441+
'422':
442+
$ref: 'components.yml#/responses/422'
408443
/organizations/{organizationId}/users:
409444
get:
410445
tags:
@@ -452,6 +487,7 @@ components:
452487
- name
453488
- sanction_threshold
454489
- sanction_limit
490+
- allowed_networks
455491
properties:
456492
id:
457493
type: string
@@ -471,6 +507,9 @@ components:
471507
auto_assign_queue_limit:
472508
type: number
473509
description: Maximum number of assignable cases for a user
510+
allowed_networks:
511+
type: array
512+
format: string
474513
CreateOrganizationBodyDto:
475514
type: object
476515
required:
@@ -489,6 +528,14 @@ components:
489528
type: number
490529
auto_assign_queue_limit:
491530
type: number
531+
OrganizationSubnetsDto:
532+
type: object
533+
properties:
534+
subnets:
535+
description: List of CIDR subnets (x.x.x.x/yy)
536+
type: array
537+
items:
538+
type: string
492539
UserDto:
493540
type: object
494541
required:

packages/marble-api/src/generated/marblecore-api.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ export type OrganizationDto = {
11431143
sanctions_limit?: number;
11441144
/** Maximum number of assignable cases for a user */
11451145
auto_assign_queue_limit?: number;
1146+
allowed_networks: any;
11461147
};
11471148
export type CreateOrganizationBodyDto = {
11481149
name: string;
@@ -1153,6 +1154,10 @@ export type UpdateOrganizationBodyDto = {
11531154
sanctions_limit?: number;
11541155
auto_assign_queue_limit?: number;
11551156
};
1157+
export type OrganizationSubnetsDto = {
1158+
/** List of CIDR subnets (x.x.x.x/yy) */
1159+
subnets?: string[];
1160+
};
11561161
export type InboxUserDto = {
11571162
id: string;
11581163
inbox_id: string;
@@ -3873,6 +3878,25 @@ export function deleteOrganization(organizationId: string, opts?: Oazapfts.Reque
38733878
method: "DELETE"
38743879
}));
38753880
}
3881+
/**
3882+
* Update organization subnets
3883+
*/
3884+
export function updateOrganizationSubnets(organizationId: string, organizationSubnetsDto: OrganizationSubnetsDto, opts?: Oazapfts.RequestOpts) {
3885+
return oazapfts.ok(oazapfts.fetchJson<{
3886+
status: 200;
3887+
data: OrganizationSubnetsDto;
3888+
} | {
3889+
status: 400;
3890+
data: string;
3891+
} | {
3892+
status: 422;
3893+
data: object;
3894+
}>(`/organizations/${encodeURIComponent(organizationId)}/subnets`, oazapfts.json({
3895+
...opts,
3896+
method: "PUT",
3897+
body: organizationSubnetsDto
3898+
})));
3899+
}
38763900
/**
38773901
* List all users of an organization
38783902
*/

0 commit comments

Comments
 (0)