@cubist-labs/cubesigner-sdk 0.4.236 → 0.4.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/src/bucket.d.ts +19 -0
- package/dist/src/bucket.d.ts.map +1 -0
- package/dist/src/bucket.js +17 -0
- package/dist/src/client/api_client.d.ts +25 -2
- package/dist/src/client/api_client.d.ts.map +1 -1
- package/dist/src/client/api_client.js +49 -8
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/policy.d.ts +5 -3
- package/dist/src/policy.d.ts.map +1 -1
- package/dist/src/policy.js +2 -2
- package/dist/src/schema.d.ts +248 -11
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/schema.js +1 -1
- package/dist/src/schema_types.d.ts +10 -0
- package/dist/src/schema_types.d.ts.map +1 -1
- package/dist/src/schema_types.js +11 -1
- package/dist/src/scopes.d.ts.map +1 -1
- package/dist/src/scopes.js +8 -1
- package/package.json +1 -1
- package/src/bucket.ts +30 -0
- package/src/client/api_client.ts +69 -12
- package/src/index.ts +2 -0
- package/src/policy.ts +8 -5
- package/src/schema.ts +265 -6
- package/src/schema_types.ts +15 -1
- package/src/scopes.ts +7 -0
package/src/client/api_client.ts
CHANGED
|
@@ -54,7 +54,6 @@ import type {
|
|
|
54
54
|
UpdatePolicyRequest,
|
|
55
55
|
ListPoliciesResponse,
|
|
56
56
|
PolicyType,
|
|
57
|
-
PolicyInfo,
|
|
58
57
|
DiffieHellmanRequest,
|
|
59
58
|
DiffieHellmanResponse,
|
|
60
59
|
KeyInfoJwt,
|
|
@@ -67,6 +66,9 @@ import type {
|
|
|
67
66
|
KeyAttestationQuery,
|
|
68
67
|
RoleAttestationQuery,
|
|
69
68
|
ErrorResponse,
|
|
69
|
+
ListBucketsResponse,
|
|
70
|
+
UpdateBucketRequest,
|
|
71
|
+
PolicyInfo,
|
|
70
72
|
} from "../schema_types";
|
|
71
73
|
import { encodeToBase64 } from "../util";
|
|
72
74
|
import {
|
|
@@ -152,6 +154,9 @@ import {
|
|
|
152
154
|
type GetUserByOidcResponse,
|
|
153
155
|
type EmailTemplatePurpose,
|
|
154
156
|
ErrResponse,
|
|
157
|
+
coerceBucketInfo,
|
|
158
|
+
coercePolicyInfo,
|
|
159
|
+
type BucketInfo,
|
|
155
160
|
} from "../index";
|
|
156
161
|
import { assertOk, op, type Op, type Operation, apiFetch } from "../fetch";
|
|
157
162
|
import { BaseClient, type ClientConfig, signerSessionFromSessionInfo } from "./base_client";
|
|
@@ -1525,14 +1530,14 @@ export class ApiClient extends BaseClient {
|
|
|
1525
1530
|
acl?: JsonValue[],
|
|
1526
1531
|
): Promise<PolicyInfo> {
|
|
1527
1532
|
const o = op("/v0/org/{org_id}/policies", "post");
|
|
1528
|
-
return
|
|
1533
|
+
return await this.exec(o, {
|
|
1529
1534
|
body: {
|
|
1530
1535
|
name,
|
|
1531
1536
|
policy_type: type,
|
|
1532
1537
|
rules,
|
|
1533
1538
|
acl,
|
|
1534
1539
|
},
|
|
1535
|
-
}))
|
|
1540
|
+
}).then(coercePolicyInfo);
|
|
1536
1541
|
}
|
|
1537
1542
|
|
|
1538
1543
|
/**
|
|
@@ -1544,9 +1549,9 @@ export class ApiClient extends BaseClient {
|
|
|
1544
1549
|
*/
|
|
1545
1550
|
async policyGet(policyId: string, version: policy.Version): Promise<PolicyInfo> {
|
|
1546
1551
|
const o = op("/v0/org/{org_id}/policies/{policy_id}/{version}", "get");
|
|
1547
|
-
return
|
|
1552
|
+
return await this.exec(o, {
|
|
1548
1553
|
params: { path: { policy_id: policyId, version } },
|
|
1549
|
-
}))
|
|
1554
|
+
}).then(coercePolicyInfo);
|
|
1550
1555
|
}
|
|
1551
1556
|
|
|
1552
1557
|
/**
|
|
@@ -1583,17 +1588,13 @@ export class ApiClient extends BaseClient {
|
|
|
1583
1588
|
mfaReceipt?: MfaReceipts,
|
|
1584
1589
|
): Promise<CubeSignerResponse<PolicyInfo>> {
|
|
1585
1590
|
const o = op("/v0/org/{org_id}/policies/{policy_id}", "patch");
|
|
1586
|
-
const
|
|
1591
|
+
const reqFn = async (headers?: HeadersInit) =>
|
|
1587
1592
|
this.exec(o, {
|
|
1588
1593
|
params: { path: { policy_id: policyId } },
|
|
1589
1594
|
body: request,
|
|
1590
1595
|
headers,
|
|
1591
|
-
});
|
|
1592
|
-
return
|
|
1593
|
-
this.env,
|
|
1594
|
-
signFn,
|
|
1595
|
-
mfaReceipt,
|
|
1596
|
-
)) as CubeSignerResponse<PolicyInfo>;
|
|
1596
|
+
}).then((resp) => mapResponse(resp, coercePolicyInfo));
|
|
1597
|
+
return await CubeSignerResponse.create(this.env, reqFn, mfaReceipt);
|
|
1597
1598
|
}
|
|
1598
1599
|
|
|
1599
1600
|
/**
|
|
@@ -1638,6 +1639,62 @@ export class ApiClient extends BaseClient {
|
|
|
1638
1639
|
|
|
1639
1640
|
// #endregion
|
|
1640
1641
|
|
|
1642
|
+
// #region BUCKET: bucket(Get|List|Update)
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* List available meta information about all policy buckets in the org.
|
|
1646
|
+
*
|
|
1647
|
+
* @param page Pagination options. Defaults to fetching the entire result set.
|
|
1648
|
+
* @returns Paginator for iterating over policy buckets.
|
|
1649
|
+
*/
|
|
1650
|
+
bucketsList(page?: PageOpts): Paginator<ListBucketsResponse, BucketInfo[]> {
|
|
1651
|
+
const o = op("/v0/org/{org_id}/policy/buckets", "get");
|
|
1652
|
+
return Paginator.items(
|
|
1653
|
+
page ?? Page.default(),
|
|
1654
|
+
(pageQuery) => this.exec(o, { params: { query: { ...pageQuery } } }),
|
|
1655
|
+
(r) => r.buckets,
|
|
1656
|
+
(r) => r.last_evaluated_key,
|
|
1657
|
+
) as Paginator<ListBucketsResponse, BucketInfo[]>;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* Get the meta information of a policy KV store bucket.
|
|
1662
|
+
*
|
|
1663
|
+
* @param bucketName The name of the bucket to get
|
|
1664
|
+
* @returns The bucket information
|
|
1665
|
+
*/
|
|
1666
|
+
async bucketGet(bucketName: string): Promise<BucketInfo> {
|
|
1667
|
+
const o = op("/v0/org/{org_id}/policy/buckets/{bucket_name}", "get");
|
|
1668
|
+
return await this.exec(o, {
|
|
1669
|
+
params: { path: { bucket_name: bucketName } },
|
|
1670
|
+
}).then(coerceBucketInfo);
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* Set or update meta information for a policy KV store bucket.
|
|
1675
|
+
*
|
|
1676
|
+
* @param bucketName The name of the bucket to update.
|
|
1677
|
+
* @param request The update request
|
|
1678
|
+
* @param mfaReceipt Option MFA receipt(s)
|
|
1679
|
+
* @returns The updated bucket information
|
|
1680
|
+
*/
|
|
1681
|
+
async bucketUpdate(
|
|
1682
|
+
bucketName: string,
|
|
1683
|
+
request: UpdateBucketRequest,
|
|
1684
|
+
mfaReceipt?: MfaReceipts,
|
|
1685
|
+
): Promise<CubeSignerResponse<BucketInfo>> {
|
|
1686
|
+
const o = op("/v0/org/{org_id}/policy/buckets/{bucket_name}", "patch");
|
|
1687
|
+
const reqFn = async (headers?: HeadersInit) =>
|
|
1688
|
+
this.exec(o, {
|
|
1689
|
+
params: { path: { bucket_name: bucketName } },
|
|
1690
|
+
body: request,
|
|
1691
|
+
headers,
|
|
1692
|
+
}).then((resp) => mapResponse(resp, coerceBucketInfo));
|
|
1693
|
+
return await CubeSignerResponse.create(this.env, reqFn, mfaReceipt);
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
// #endregion
|
|
1697
|
+
|
|
1641
1698
|
// #region WASM: wasm(PolicyUpload)
|
|
1642
1699
|
|
|
1643
1700
|
/**
|
package/src/index.ts
CHANGED
package/src/policy.ts
CHANGED
|
@@ -10,15 +10,15 @@ import type {
|
|
|
10
10
|
KeyPolicyRule,
|
|
11
11
|
MfaReceipts,
|
|
12
12
|
PolicyAttachedToId,
|
|
13
|
-
PolicyInfo,
|
|
14
13
|
PolicyType,
|
|
15
14
|
RolePolicy,
|
|
16
15
|
RolePolicyRule,
|
|
17
16
|
UpdatePolicyRequest,
|
|
18
17
|
WasmRule,
|
|
19
|
-
Acl,
|
|
20
18
|
AceAttribute,
|
|
21
19
|
PolicyAction,
|
|
20
|
+
Ace,
|
|
21
|
+
PolicyInfo,
|
|
22
22
|
} from ".";
|
|
23
23
|
|
|
24
24
|
import { loadSubtleCrypto } from ".";
|
|
@@ -32,7 +32,7 @@ export type PolicyRule = KeyPolicyRule | RolePolicyRule | WasmRule;
|
|
|
32
32
|
* A helper type for {@link PolicyInfo} with a more detailed `acl` type.
|
|
33
33
|
*/
|
|
34
34
|
type NamedPolicyInfo = PolicyInfo & {
|
|
35
|
-
acl?:
|
|
35
|
+
acl?: PolicyAcl;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -67,7 +67,10 @@ export type C2FInfo = WasmPolicyInfo;
|
|
|
67
67
|
export type Version = `v${number}` | `latest`;
|
|
68
68
|
|
|
69
69
|
/** A policy access control entry. */
|
|
70
|
-
export type
|
|
70
|
+
export type PolicyAce = Ace<PolicyAction, PolicyCtx>;
|
|
71
|
+
|
|
72
|
+
/** A policy access control list. */
|
|
73
|
+
export type PolicyAcl = PolicyAce[];
|
|
71
74
|
|
|
72
75
|
/** Additional contexts when using policies. */
|
|
73
76
|
export type PolicyCtx = {
|
|
@@ -476,7 +479,7 @@ export class C2FFunction extends NamedPolicy {
|
|
|
476
479
|
// upload the policy object
|
|
477
480
|
const hash = await uploadWasmFunction(this.apiClient, policy);
|
|
478
481
|
|
|
479
|
-
// update this policy with the new policy
|
|
482
|
+
// update this policy with the new policy version.
|
|
480
483
|
const body: UpdatePolicyRequest = { rules: [{ hash }] };
|
|
481
484
|
this.data = (await this.update(body, mfaReceipt)) as C2FInfo;
|
|
482
485
|
}
|
package/src/schema.ts
CHANGED
|
@@ -1035,6 +1035,31 @@ export interface paths {
|
|
|
1035
1035
|
*/
|
|
1036
1036
|
post: operations["invokePolicy"];
|
|
1037
1037
|
};
|
|
1038
|
+
"/v0/org/{org_id}/policy/buckets": {
|
|
1039
|
+
/**
|
|
1040
|
+
* List Buckets
|
|
1041
|
+
* @description List Buckets
|
|
1042
|
+
*
|
|
1043
|
+
* List available meta information about all policy KV store buckets in the org.
|
|
1044
|
+
*/
|
|
1045
|
+
get: operations["listPolicyBuckets"];
|
|
1046
|
+
};
|
|
1047
|
+
"/v0/org/{org_id}/policy/buckets/{bucket_name}": {
|
|
1048
|
+
/**
|
|
1049
|
+
* Get Bucket
|
|
1050
|
+
* @description Get Bucket
|
|
1051
|
+
*
|
|
1052
|
+
* Returns the meta information of a policy KV store bucket.
|
|
1053
|
+
*/
|
|
1054
|
+
get: operations["getPolicyBucket"];
|
|
1055
|
+
/**
|
|
1056
|
+
* Update Bucket
|
|
1057
|
+
* @description Update Bucket
|
|
1058
|
+
*
|
|
1059
|
+
* Updates meta information for an existing policy KV store bucket.
|
|
1060
|
+
*/
|
|
1061
|
+
patch: operations["updatePolicyBucket"];
|
|
1062
|
+
};
|
|
1038
1063
|
"/v0/org/{org_id}/policy/import_key": {
|
|
1039
1064
|
/**
|
|
1040
1065
|
* Create Policy Import Key
|
|
@@ -1050,7 +1075,7 @@ export interface paths {
|
|
|
1050
1075
|
* Get the org-wide policy secrets.
|
|
1051
1076
|
* @description Get the org-wide policy secrets.
|
|
1052
1077
|
*
|
|
1053
|
-
* Note that this only returns the keys for the secrets,
|
|
1078
|
+
* Note that this only returns the keys for the secrets, omitting the values.
|
|
1054
1079
|
* The values are secret and are not accessible outside Wasm policy execution.
|
|
1055
1080
|
*/
|
|
1056
1081
|
get: operations["getPolicySecrets"];
|
|
@@ -1859,8 +1884,7 @@ export interface components {
|
|
|
1859
1884
|
*/
|
|
1860
1885
|
Aud: string | string[];
|
|
1861
1886
|
AuditLogEntry: {
|
|
1862
|
-
|
|
1863
|
-
event: string;
|
|
1887
|
+
event: components["schemas"]["OrgEventDiscriminants"];
|
|
1864
1888
|
/** @description UUID of the event. Unique across all events. */
|
|
1865
1889
|
event_id: string;
|
|
1866
1890
|
org_id: components["schemas"]["Id"];
|
|
@@ -2997,6 +3021,9 @@ export interface components {
|
|
|
2997
3021
|
| "SetPolicySecret"
|
|
2998
3022
|
| "DeletePolicySecret"
|
|
2999
3023
|
| "CreatePolicyImportKey"
|
|
3024
|
+
| "GetPolicyBucket"
|
|
3025
|
+
| "ListPolicyBuckets"
|
|
3026
|
+
| "UpdatePolicyBucket"
|
|
3000
3027
|
| "UserExportDelete"
|
|
3001
3028
|
| "UserExportList"
|
|
3002
3029
|
| "UserExportInit"
|
|
@@ -3328,6 +3355,57 @@ export interface components {
|
|
|
3328
3355
|
*/
|
|
3329
3356
|
value: number;
|
|
3330
3357
|
};
|
|
3358
|
+
/**
|
|
3359
|
+
* @description The access-controlled actions that can be performed on a bucket
|
|
3360
|
+
* @enum {string}
|
|
3361
|
+
*/
|
|
3362
|
+
BucketAction:
|
|
3363
|
+
| "read:key:value"
|
|
3364
|
+
| "read:key:exists"
|
|
3365
|
+
| "update:key:value"
|
|
3366
|
+
| "delete:key:value"
|
|
3367
|
+
| "scan:keys"
|
|
3368
|
+
| "update:bucket:owner"
|
|
3369
|
+
| "update:bucket:acl"
|
|
3370
|
+
| "update:bucket:metadata";
|
|
3371
|
+
/** @description Information about a policy KV store bucket. */
|
|
3372
|
+
BucketInfo: ({
|
|
3373
|
+
created?: components["schemas"]["EpochDateTime"] | null;
|
|
3374
|
+
last_modified?: components["schemas"]["EpochDateTime"] | null;
|
|
3375
|
+
/**
|
|
3376
|
+
* Format: int64
|
|
3377
|
+
* @description Version of this object
|
|
3378
|
+
*/
|
|
3379
|
+
version?: number;
|
|
3380
|
+
} & {
|
|
3381
|
+
/** @description The access-control entries for the bucket. */
|
|
3382
|
+
acl?: unknown[] | null;
|
|
3383
|
+
/** @description Arbitrary user-defined metadata. */
|
|
3384
|
+
metadata?: unknown;
|
|
3385
|
+
owner: components["schemas"]["Id"];
|
|
3386
|
+
}) & {
|
|
3387
|
+
/** @description The name of the bucket. */
|
|
3388
|
+
name: string;
|
|
3389
|
+
};
|
|
3390
|
+
/**
|
|
3391
|
+
* @description Sub-entity of org where per-bucket metadata (like ACL) is stored.
|
|
3392
|
+
* The [Id] of a [BucketMeta] must be the bucket name.
|
|
3393
|
+
*/
|
|
3394
|
+
BucketMeta: {
|
|
3395
|
+
created?: components["schemas"]["EpochDateTime"] | null;
|
|
3396
|
+
last_modified?: components["schemas"]["EpochDateTime"] | null;
|
|
3397
|
+
/**
|
|
3398
|
+
* Format: int64
|
|
3399
|
+
* @description Version of this object
|
|
3400
|
+
*/
|
|
3401
|
+
version?: number;
|
|
3402
|
+
} & {
|
|
3403
|
+
/** @description The access-control entries for the bucket. */
|
|
3404
|
+
acl?: unknown[] | null;
|
|
3405
|
+
/** @description Arbitrary user-defined metadata. */
|
|
3406
|
+
metadata?: unknown;
|
|
3407
|
+
owner: components["schemas"]["Id"];
|
|
3408
|
+
};
|
|
3331
3409
|
CancelInvitationRequest: {
|
|
3332
3410
|
email: components["schemas"]["Email"];
|
|
3333
3411
|
};
|
|
@@ -4749,6 +4827,13 @@ export interface components {
|
|
|
4749
4827
|
| "manage:policy:secrets:update:values"
|
|
4750
4828
|
| "manage:policy:secrets:update:acl"
|
|
4751
4829
|
| "manage:policy:secrets:update:editPolicy"
|
|
4830
|
+
| "manage:policy:buckets:*"
|
|
4831
|
+
| "manage:policy:buckets:get"
|
|
4832
|
+
| "manage:policy:buckets:list"
|
|
4833
|
+
| "manage:policy:buckets:update:*"
|
|
4834
|
+
| "manage:policy:buckets:update:owner"
|
|
4835
|
+
| "manage:policy:buckets:update:acl"
|
|
4836
|
+
| "manage:policy:buckets:update:metadata"
|
|
4752
4837
|
| "manage:contact:*"
|
|
4753
4838
|
| "manage:contact:readonly"
|
|
4754
4839
|
| "manage:contact:create"
|
|
@@ -5007,6 +5092,7 @@ export interface components {
|
|
|
5007
5092
|
| "AutoAddBlsKeyToProtectedRole"
|
|
5008
5093
|
| "UserNotPolicyOwner"
|
|
5009
5094
|
| "UserNotContactOwner"
|
|
5095
|
+
| "UserNotBucketOwner"
|
|
5010
5096
|
| "LegacySessionCannotHaveScopeCeiling"
|
|
5011
5097
|
| "RoleInParentOrgNotAllowed"
|
|
5012
5098
|
| "RemoveKeyFromRoleUserNotAllowed"
|
|
@@ -6060,6 +6146,7 @@ export interface components {
|
|
|
6060
6146
|
| "OrgExportCiphertextNotFound"
|
|
6061
6147
|
| "UploadObjectNotFound"
|
|
6062
6148
|
| "PolicySecretNotFound"
|
|
6149
|
+
| "BucketMetaNotFound"
|
|
6063
6150
|
| "TimestreamDisabled"
|
|
6064
6151
|
| "CustomChainNotFound"
|
|
6065
6152
|
| "InvitationNotFound"
|
|
@@ -6740,6 +6827,21 @@ export interface components {
|
|
|
6740
6827
|
*/
|
|
6741
6828
|
last_evaluated_key?: string | null;
|
|
6742
6829
|
};
|
|
6830
|
+
/**
|
|
6831
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
6832
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
6833
|
+
*/
|
|
6834
|
+
PaginatedListBucketsResponse: {
|
|
6835
|
+
/** @description The buckets in the organization. */
|
|
6836
|
+
buckets: components["schemas"]["BucketInfo"][];
|
|
6837
|
+
} & {
|
|
6838
|
+
/**
|
|
6839
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
6840
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
6841
|
+
* but specify this value as the 'page.start' query parameter.
|
|
6842
|
+
*/
|
|
6843
|
+
last_evaluated_key?: string | null;
|
|
6844
|
+
};
|
|
6743
6845
|
/**
|
|
6744
6846
|
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
6745
6847
|
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
@@ -7060,16 +7162,16 @@ export interface components {
|
|
|
7060
7162
|
}) &
|
|
7061
7163
|
Record<string, never>;
|
|
7062
7164
|
/**
|
|
7063
|
-
* PolicyAction
|
|
7064
7165
|
* @description The access-controlled actions that can be performed on a named policy.
|
|
7065
|
-
* @example read:policy
|
|
7066
7166
|
* @enum {string}
|
|
7067
7167
|
*/
|
|
7068
7168
|
PolicyAction:
|
|
7069
7169
|
| "read:*"
|
|
7170
|
+
| "read"
|
|
7070
7171
|
| "read:policy"
|
|
7071
7172
|
| "read:logs"
|
|
7072
7173
|
| "update:*"
|
|
7174
|
+
| "update"
|
|
7073
7175
|
| "update:name"
|
|
7074
7176
|
| "update:rules"
|
|
7075
7177
|
| "update:metadata"
|
|
@@ -8791,6 +8893,23 @@ export interface components {
|
|
|
8791
8893
|
/** @description Optional policy evaluation tree. */
|
|
8792
8894
|
policy_eval_tree?: unknown;
|
|
8793
8895
|
} & Record<string, never>;
|
|
8896
|
+
/** @description The information needed to update a bucket. */
|
|
8897
|
+
UpdateBucketRequest: {
|
|
8898
|
+
/** @description Access-control entries defining how the bucket can be accessed. */
|
|
8899
|
+
acl?: unknown;
|
|
8900
|
+
/**
|
|
8901
|
+
* Format: int64
|
|
8902
|
+
* @description If set, updating only succeeds if the current version matches this value.
|
|
8903
|
+
*/
|
|
8904
|
+
expected_version?: number | null;
|
|
8905
|
+
/** @description Optional metadata. */
|
|
8906
|
+
metadata?: unknown;
|
|
8907
|
+
/**
|
|
8908
|
+
* @description Update the owner of the bucket
|
|
8909
|
+
* @example User#00000000-0000-0000-0000-000000000000
|
|
8910
|
+
*/
|
|
8911
|
+
owner?: string | null;
|
|
8912
|
+
};
|
|
8794
8913
|
/** @description The information needed to update a Contact. */
|
|
8795
8914
|
UpdateContactRequest: {
|
|
8796
8915
|
addresses?: components["schemas"]["AddressMap"] | null;
|
|
@@ -9621,6 +9740,29 @@ export interface components {
|
|
|
9621
9740
|
};
|
|
9622
9741
|
};
|
|
9623
9742
|
};
|
|
9743
|
+
/** @description Information about a policy KV store bucket. */
|
|
9744
|
+
BucketInfo: {
|
|
9745
|
+
content: {
|
|
9746
|
+
"application/json": ({
|
|
9747
|
+
created?: components["schemas"]["EpochDateTime"] | null;
|
|
9748
|
+
last_modified?: components["schemas"]["EpochDateTime"] | null;
|
|
9749
|
+
/**
|
|
9750
|
+
* Format: int64
|
|
9751
|
+
* @description Version of this object
|
|
9752
|
+
*/
|
|
9753
|
+
version?: number;
|
|
9754
|
+
} & {
|
|
9755
|
+
/** @description The access-control entries for the bucket. */
|
|
9756
|
+
acl?: unknown[] | null;
|
|
9757
|
+
/** @description Arbitrary user-defined metadata. */
|
|
9758
|
+
metadata?: unknown;
|
|
9759
|
+
owner: components["schemas"]["Id"];
|
|
9760
|
+
}) & {
|
|
9761
|
+
/** @description The name of the bucket. */
|
|
9762
|
+
name: string;
|
|
9763
|
+
};
|
|
9764
|
+
};
|
|
9765
|
+
};
|
|
9624
9766
|
/** @description The number of users and keys in an org, organized by user role and key type */
|
|
9625
9767
|
ComputeCountsResponse: {
|
|
9626
9768
|
content: {
|
|
@@ -10342,6 +10484,21 @@ export interface components {
|
|
|
10342
10484
|
};
|
|
10343
10485
|
};
|
|
10344
10486
|
};
|
|
10487
|
+
PaginatedListBucketsResponse: {
|
|
10488
|
+
content: {
|
|
10489
|
+
"application/json": {
|
|
10490
|
+
/** @description The buckets in the organization. */
|
|
10491
|
+
buckets: components["schemas"]["BucketInfo"][];
|
|
10492
|
+
} & {
|
|
10493
|
+
/**
|
|
10494
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
10495
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
10496
|
+
* but specify this value as the 'page.start' query parameter.
|
|
10497
|
+
*/
|
|
10498
|
+
last_evaluated_key?: string | null;
|
|
10499
|
+
};
|
|
10500
|
+
};
|
|
10501
|
+
};
|
|
10345
10502
|
PaginatedListContactsResponse: {
|
|
10346
10503
|
content: {
|
|
10347
10504
|
"application/json": {
|
|
@@ -14602,6 +14759,108 @@ export interface operations {
|
|
|
14602
14759
|
};
|
|
14603
14760
|
};
|
|
14604
14761
|
};
|
|
14762
|
+
/**
|
|
14763
|
+
* List Buckets
|
|
14764
|
+
* @description List Buckets
|
|
14765
|
+
*
|
|
14766
|
+
* List available meta information about all policy KV store buckets in the org.
|
|
14767
|
+
*/
|
|
14768
|
+
listPolicyBuckets: {
|
|
14769
|
+
parameters: {
|
|
14770
|
+
query?: {
|
|
14771
|
+
/**
|
|
14772
|
+
* @description Max number of items to return per page.
|
|
14773
|
+
*
|
|
14774
|
+
* If the actual number of returned items may be less that this, even if there exist more
|
|
14775
|
+
* data in the result set. To reliably determine if more data is left in the result set,
|
|
14776
|
+
* inspect the [UnencryptedLastEvalKey] value in the response object.
|
|
14777
|
+
*/
|
|
14778
|
+
"page.size"?: number;
|
|
14779
|
+
/**
|
|
14780
|
+
* @description The start of the page. Omit to start from the beginning; otherwise, only specify a
|
|
14781
|
+
* the exact value previously returned as 'last_evaluated_key' from the same endpoint.
|
|
14782
|
+
*/
|
|
14783
|
+
"page.start"?: string | null;
|
|
14784
|
+
};
|
|
14785
|
+
path: {
|
|
14786
|
+
/**
|
|
14787
|
+
* @description Name or ID of the desired Org
|
|
14788
|
+
* @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
14789
|
+
*/
|
|
14790
|
+
org_id: string;
|
|
14791
|
+
};
|
|
14792
|
+
};
|
|
14793
|
+
responses: {
|
|
14794
|
+
200: components["responses"]["PaginatedListBucketsResponse"];
|
|
14795
|
+
default: {
|
|
14796
|
+
content: {
|
|
14797
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
14798
|
+
};
|
|
14799
|
+
};
|
|
14800
|
+
};
|
|
14801
|
+
};
|
|
14802
|
+
/**
|
|
14803
|
+
* Get Bucket
|
|
14804
|
+
* @description Get Bucket
|
|
14805
|
+
*
|
|
14806
|
+
* Returns the meta information of a policy KV store bucket.
|
|
14807
|
+
*/
|
|
14808
|
+
getPolicyBucket: {
|
|
14809
|
+
parameters: {
|
|
14810
|
+
path: {
|
|
14811
|
+
/**
|
|
14812
|
+
* @description Name or ID of the desired Org
|
|
14813
|
+
* @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
14814
|
+
*/
|
|
14815
|
+
org_id: string;
|
|
14816
|
+
bucket_name: string;
|
|
14817
|
+
};
|
|
14818
|
+
};
|
|
14819
|
+
responses: {
|
|
14820
|
+
200: components["responses"]["BucketInfo"];
|
|
14821
|
+
default: {
|
|
14822
|
+
content: {
|
|
14823
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
14824
|
+
};
|
|
14825
|
+
};
|
|
14826
|
+
};
|
|
14827
|
+
};
|
|
14828
|
+
/**
|
|
14829
|
+
* Update Bucket
|
|
14830
|
+
* @description Update Bucket
|
|
14831
|
+
*
|
|
14832
|
+
* Updates meta information for an existing policy KV store bucket.
|
|
14833
|
+
*/
|
|
14834
|
+
updatePolicyBucket: {
|
|
14835
|
+
parameters: {
|
|
14836
|
+
path: {
|
|
14837
|
+
/**
|
|
14838
|
+
* @description Name or ID of the desired Org
|
|
14839
|
+
* @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
14840
|
+
*/
|
|
14841
|
+
org_id: string;
|
|
14842
|
+
bucket_name: string;
|
|
14843
|
+
};
|
|
14844
|
+
};
|
|
14845
|
+
requestBody: {
|
|
14846
|
+
content: {
|
|
14847
|
+
"application/json": components["schemas"]["UpdateBucketRequest"];
|
|
14848
|
+
};
|
|
14849
|
+
};
|
|
14850
|
+
responses: {
|
|
14851
|
+
200: components["responses"]["BucketInfo"];
|
|
14852
|
+
202: {
|
|
14853
|
+
content: {
|
|
14854
|
+
"application/json": components["schemas"]["AcceptedResponse"];
|
|
14855
|
+
};
|
|
14856
|
+
};
|
|
14857
|
+
default: {
|
|
14858
|
+
content: {
|
|
14859
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
14860
|
+
};
|
|
14861
|
+
};
|
|
14862
|
+
};
|
|
14863
|
+
};
|
|
14605
14864
|
/**
|
|
14606
14865
|
* Create Policy Import Key
|
|
14607
14866
|
* @description Create Policy Import Key
|
|
@@ -14632,7 +14891,7 @@ export interface operations {
|
|
|
14632
14891
|
* Get the org-wide policy secrets.
|
|
14633
14892
|
* @description Get the org-wide policy secrets.
|
|
14634
14893
|
*
|
|
14635
|
-
* Note that this only returns the keys for the secrets,
|
|
14894
|
+
* Note that this only returns the keys for the secrets, omitting the values.
|
|
14636
14895
|
* The values are secret and are not accessible outside Wasm policy execution.
|
|
14637
14896
|
*/
|
|
14638
14897
|
getPolicySecrets: {
|
package/src/schema_types.ts
CHANGED
|
@@ -291,10 +291,20 @@ export type ImportKeyRequestMaterial = schemas["ImportKeyRequestMaterial"];
|
|
|
291
291
|
export type InvitationAcceptRequest = schemas["InvitationAcceptRequest"];
|
|
292
292
|
|
|
293
293
|
export type KeyTypeAndDerivationPath = schemas["KeyTypeAndDerivationPath"];
|
|
294
|
-
|
|
295
294
|
export type PolicyInfo = schemas["PolicyInfo"] & {
|
|
296
295
|
acl?: JsonValue[];
|
|
297
296
|
};
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Coerce the less accurate `PolicyInfo` type from the OpenAPI schema to a more accurate {@link PolicyInfo}.
|
|
300
|
+
*
|
|
301
|
+
* @param p The policy info received on the wire
|
|
302
|
+
* @returns The same value coerced to {@link PolicyInfo}
|
|
303
|
+
*/
|
|
304
|
+
export function coercePolicyInfo(p: schemas["PolicyInfo"]): PolicyInfo {
|
|
305
|
+
return p as PolicyInfo;
|
|
306
|
+
}
|
|
307
|
+
|
|
298
308
|
export type UpdatePolicyRequest = schemas["UpdatePolicyRequest"] & {
|
|
299
309
|
rules?: JsonValue[];
|
|
300
310
|
acl?: JsonValue[];
|
|
@@ -303,6 +313,10 @@ export type ListPoliciesResponse = schemas["PaginatedListPoliciesResponse"];
|
|
|
303
313
|
export type PolicyType = schemas["PolicyType"];
|
|
304
314
|
export type PolicyAttachedToId = schemas["PolicyAttachedToId"];
|
|
305
315
|
|
|
316
|
+
export type ListBucketsResponse = schemas["PaginatedListBucketsResponse"];
|
|
317
|
+
export type UpdateBucketRequest = schemas["UpdateBucketRequest"];
|
|
318
|
+
export type BucketAction = schemas["BucketAction"];
|
|
319
|
+
|
|
306
320
|
export type UploadWasmPolicyRequest = schemas["UploadWasmPolicyRequest"];
|
|
307
321
|
export type UploadWasmPolicyResponse = schemas["UploadWasmPolicyResponse"];
|
|
308
322
|
export type InvokePolicyRequest = schemas["InvokePolicyRequest"];
|
package/src/scopes.ts
CHANGED
|
@@ -115,6 +115,13 @@ export const AllScopes: Record<ExplicitScope, string> =
|
|
|
115
115
|
"manage:policy:secrets:update:values" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the secrets keys and values",
|
|
116
116
|
"manage:policy:secrets:update:acl" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the secrets acl",
|
|
117
117
|
"manage:policy:secrets:update:editPolicy" : "Allows access only to the policy secrets 'update' endpoint, but restricting updates to the `edit_policy` property",
|
|
118
|
+
"manage:policy:buckets:*" : "Allows access to all policy buckets endpoints",
|
|
119
|
+
"manage:policy:buckets:get" : "Allows access only to the policy buckets 'get' endpoint",
|
|
120
|
+
"manage:policy:buckets:list" : "Allows access only to the policy buckets 'list' endpoint",
|
|
121
|
+
"manage:policy:buckets:update:*" : "Allows access only to the policy buckets 'update' endpoint",
|
|
122
|
+
"manage:policy:buckets:update:owner" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `owner` property",
|
|
123
|
+
"manage:policy:buckets:update:acl" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `acl` property",
|
|
124
|
+
"manage:policy:buckets:update:metadata" : "Allows access only to the policy buckets 'update' endpoint, but restricting updates to the `metadata` property",
|
|
118
125
|
"manage:contact:*" : "Allows access to all contact endpoints",
|
|
119
126
|
"manage:contact:readonly" : "Allows access to all contact readonly endpoints",
|
|
120
127
|
"manage:contact:create" : "Allows access to the contact 'create' endpoint",
|