@origincloud/iam 0.0.0-stage → 0.6.0

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.
Files changed (38) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +23 -2
  3. package/dist/v1beta1/audit_log.d.ts +136 -0
  4. package/dist/v1beta1/audit_log.d.ts.map +1 -0
  5. package/dist/v1beta1/audit_log.js +77 -0
  6. package/dist/v1beta1/audit_log.js.map +1 -0
  7. package/dist/v1beta1/index.d.ts +7 -0
  8. package/dist/v1beta1/index.d.ts.map +1 -0
  9. package/dist/v1beta1/index.js +8 -0
  10. package/dist/v1beta1/index.js.map +1 -0
  11. package/dist/v1beta1/permission.d.ts +92 -0
  12. package/dist/v1beta1/permission.d.ts.map +1 -0
  13. package/dist/v1beta1/permission.js +63 -0
  14. package/dist/v1beta1/permission.js.map +1 -0
  15. package/dist/v1beta1/role.d.ts +55 -0
  16. package/dist/v1beta1/role.d.ts.map +1 -0
  17. package/dist/v1beta1/role.js +42 -0
  18. package/dist/v1beta1/role.js.map +1 -0
  19. package/dist/v1beta1/role_binding.d.ts +172 -0
  20. package/dist/v1beta1/role_binding.d.ts.map +1 -0
  21. package/dist/v1beta1/role_binding.js +118 -0
  22. package/dist/v1beta1/role_binding.js.map +1 -0
  23. package/dist/v1beta1/service_account.d.ts +146 -0
  24. package/dist/v1beta1/service_account.d.ts.map +1 -0
  25. package/dist/v1beta1/service_account.js +106 -0
  26. package/dist/v1beta1/service_account.js.map +1 -0
  27. package/dist/v1beta1/user.d.ts +50 -0
  28. package/dist/v1beta1/user.d.ts.map +1 -0
  29. package/dist/v1beta1/user.js +36 -0
  30. package/dist/v1beta1/user.js.map +1 -0
  31. package/package.json +40 -4
  32. package/src/v1beta1/audit_log.ts +180 -0
  33. package/src/v1beta1/index.ts +8 -0
  34. package/src/v1beta1/permission.ts +138 -0
  35. package/src/v1beta1/role.ts +87 -0
  36. package/src/v1beta1/role_binding.ts +251 -0
  37. package/src/v1beta1/service_account.ts +225 -0
  38. package/src/v1beta1/user.ts +70 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
1
+ # @origincloud/iam
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The client of Origin Cloud's IAM service: users, service accounts, roles, role
4
+ bindings, permissions and the audit log. Part of the [Origin Cloud SDK for
5
+ TypeScript](https://github.com/origincloudhq/sdk-typescript), generated from the
6
+ API definitions in [origincloudhq/api](https://github.com/origincloudhq/api).
7
+
8
+ ```ts
9
+ import { Client } from "@origincloud/core";
10
+ import { AuditLogClient } from "@origincloud/iam/v1beta1";
11
+
12
+ const auditLogs = new AuditLogClient(new Client());
13
+ ```
14
+
15
+ | Import | API |
16
+ |---|---|
17
+ | `@origincloud/iam/v1beta1` | Users, service accounts, roles, role bindings, permissions and the audit log |
18
+
19
+ `v1beta1` is a preview version and may change in incompatible ways, like the API
20
+ itself. See the [repository's
21
+ README](https://github.com/origincloudhq/sdk-typescript#readme) for credentials
22
+ and behaviour.
23
+
24
+ Apache License 2.0.
@@ -0,0 +1,136 @@
1
+ import { type CallOptions, type Client, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls AuditLogService.
4
+ *
5
+ * An organization's audit log: a record of each change to who may do what
6
+ * in it, written when the change is made and never changed afterwards.
7
+ * It records role bindings created and deleted, members removed, invites
8
+ * created and deleted, and service accounts created and deleted.
9
+ *
10
+ * This API serves a recent window of the log, 90 days unless the platform
11
+ * sets it longer: a list says where its window starts in
12
+ * `windowStartTime`, and an older entry is `NOT_FOUND` here.
13
+ */
14
+ export declare class AuditLogClient {
15
+ /**
16
+ * The endpoint the client sends its calls to, which also serves the
17
+ * operations its methods answer with.
18
+ */
19
+ readonly service: Service;
20
+ /** A client of AuditLogService that sends its calls through `client`. */
21
+ constructor(client: Client);
22
+ /**
23
+ * Returns an audit log entry. Needs `iam.audit_log.list` on the
24
+ * organization.
25
+ */
26
+ getAuditLogEntry(request: GetAuditLogEntryRequest, options?: CallOptions): Promise<AuditLogEntry>;
27
+ /**
28
+ * Lists an organization's audit log entries, most recent first,
29
+ * optionally only a project's, an actor's or an action's. Needs
30
+ * `iam.audit_log.list` on the organization.
31
+ */
32
+ listAuditLogEntries(request: ListAuditLogEntriesRequest, options?: CallOptions): Promise<ListAuditLogEntriesResponse>;
33
+ /**
34
+ * Iterates over everything listAuditLogEntries lists from the request's page on,
35
+ * fetching the next page as the loop reaches it. A page that fails ends
36
+ * the iteration with its error.
37
+ */
38
+ allAuditLogEntries(request: ListAuditLogEntriesRequest, options?: CallOptions): AsyncGenerator<AuditLogEntry, void, undefined>;
39
+ }
40
+ /** One recorded change. */
41
+ export interface AuditLogEntry {
42
+ /** The entry's resource name. */
43
+ name?: string;
44
+ /**
45
+ * The project the change was limited to, `projects/{project}`; empty for
46
+ * a change to the whole organization.
47
+ */
48
+ project?: string;
49
+ /**
50
+ * Who made the change, as it was when the change was made:
51
+ * `user:{email}` with the verified address the account had then,
52
+ * `userId:{user}` when none was recorded, `serviceAccount:{service_account}`,
53
+ * or `platform` for a change the platform made itself. A later change of
54
+ * address doesn't change it.
55
+ */
56
+ actor?: string;
57
+ /**
58
+ * What was done, as a permission key names it, such as
59
+ * `iam.role.assign`.
60
+ */
61
+ action?: string;
62
+ /**
63
+ * What it was done to, written as `actor` is, or the email address
64
+ * invited; empty when the action has no target.
65
+ */
66
+ target?: string;
67
+ /** Whether the change was made. */
68
+ outcome?: AuditLogEntry_Outcome;
69
+ /** When the change was made. */
70
+ occurTime?: string;
71
+ /**
72
+ * Details of the change that depend on the action, such as the `role`
73
+ * granted or a service account's `displayName`.
74
+ */
75
+ details?: Record<string, string>;
76
+ }
77
+ /** Whether the change was made. */
78
+ export declare const AuditLogEntry_Outcome: {
79
+ /** Not set. */
80
+ readonly OUTCOME_UNSPECIFIED: "OUTCOME_UNSPECIFIED";
81
+ /** It was made. */
82
+ readonly SUCCEEDED: "SUCCEEDED";
83
+ /** It was refused for lack of a permission. */
84
+ readonly DENIED: "DENIED";
85
+ };
86
+ /** Whether the change was made. */
87
+ export type AuditLogEntry_Outcome = (typeof AuditLogEntry_Outcome)[keyof typeof AuditLogEntry_Outcome];
88
+ /** The request for GetAuditLogEntry. */
89
+ export interface GetAuditLogEntryRequest {
90
+ /** The entry to return. */
91
+ name?: string;
92
+ }
93
+ /** The request for ListAuditLogEntries. */
94
+ export interface ListAuditLogEntriesRequest {
95
+ /**
96
+ * The organization whose audit log to list,
97
+ * `organizations/{organization}`.
98
+ */
99
+ parent?: string;
100
+ /**
101
+ * Only the entries of changes limited to this project,
102
+ * `projects/{project}`. Every entry when empty.
103
+ */
104
+ project?: string;
105
+ /**
106
+ * Only the entries of changes made by this member's account,
107
+ * `user:{email}` or `serviceAccount:{service_account}`. Every actor's
108
+ * when empty.
109
+ */
110
+ actor?: string;
111
+ /**
112
+ * Only the entries of this action, such as `iam.role.assign`. Every
113
+ * action's when empty.
114
+ */
115
+ action?: string;
116
+ /**
117
+ * The most entries to return; the server clamps it, and 0 means its
118
+ * default.
119
+ */
120
+ pageSize?: number;
121
+ /** A previous response's `nextPageToken`, for the page after it. */
122
+ pageToken?: string;
123
+ }
124
+ /** The response for ListAuditLogEntries. */
125
+ export interface ListAuditLogEntriesResponse {
126
+ /** The entries on this page, most recent first. */
127
+ auditLogEntries?: AuditLogEntry[];
128
+ /** The token for the next page; empty on the last one. */
129
+ nextPageToken?: string;
130
+ /**
131
+ * Where the window this API serves starts: entries older than it aren't
132
+ * listed.
133
+ */
134
+ windowStartTime?: string;
135
+ }
136
+ //# sourceMappingURL=audit_log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit_log.d.ts","sourceRoot":"","sources":["../../src/v1beta1/audit_log.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAA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AAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEvG,wCAAwC;AACxC,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,2CAA2C;AAC3C,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC1C,mDAAmD;IACnD,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC;IAClC,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,77 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/iam/v1beta1/audit_log.proto
3
+ import { pathValue, query } from "@origincloud/core";
4
+ /**
5
+ * Calls AuditLogService.
6
+ *
7
+ * An organization's audit log: a record of each change to who may do what
8
+ * in it, written when the change is made and never changed afterwards.
9
+ * It records role bindings created and deleted, members removed, invites
10
+ * created and deleted, and service accounts created and deleted.
11
+ *
12
+ * This API serves a recent window of the log, 90 days unless the platform
13
+ * sets it longer: a list says where its window starts in
14
+ * `windowStartTime`, and an older entry is `NOT_FOUND` here.
15
+ */
16
+ export class AuditLogClient {
17
+ /**
18
+ * The endpoint the client sends its calls to, which also serves the
19
+ * operations its methods answer with.
20
+ */
21
+ service;
22
+ /** A client of AuditLogService that sends its calls through `client`. */
23
+ constructor(client) {
24
+ this.service = client.service("iam", false);
25
+ }
26
+ /**
27
+ * Returns an audit log entry. Needs `iam.audit_log.list` on the
28
+ * organization.
29
+ */
30
+ async getAuditLogEntry(request, options) {
31
+ const p0 = pathValue("name", request.name, "organizations/*/auditLogEntries/*");
32
+ return this.service.call({
33
+ method: "GET",
34
+ path: `/v1beta1/${p0}`,
35
+ query: query(request, ["name"]),
36
+ idempotent: true,
37
+ }, options);
38
+ }
39
+ /**
40
+ * Lists an organization's audit log entries, most recent first,
41
+ * optionally only a project's, an actor's or an action's. Needs
42
+ * `iam.audit_log.list` on the organization.
43
+ */
44
+ async listAuditLogEntries(request, options) {
45
+ const p0 = pathValue("parent", request.parent, "organizations/*");
46
+ return this.service.call({
47
+ method: "GET",
48
+ path: `/v1beta1/${p0}/auditLogEntries`,
49
+ query: query(request, ["parent"]),
50
+ idempotent: true,
51
+ }, options);
52
+ }
53
+ /**
54
+ * Iterates over everything listAuditLogEntries lists from the request's page on,
55
+ * fetching the next page as the loop reaches it. A page that fails ends
56
+ * the iteration with its error.
57
+ */
58
+ async *allAuditLogEntries(request, options) {
59
+ for (let page = request;;) {
60
+ const response = await this.listAuditLogEntries(page, options);
61
+ yield* response.auditLogEntries ?? [];
62
+ if (!response.nextPageToken)
63
+ return;
64
+ page = { ...page, pageToken: response.nextPageToken };
65
+ }
66
+ }
67
+ }
68
+ /** Whether the change was made. */
69
+ export const AuditLogEntry_Outcome = {
70
+ /** Not set. */
71
+ OUTCOME_UNSPECIFIED: "OUTCOME_UNSPECIFIED",
72
+ /** It was made. */
73
+ SUCCEEDED: "SUCCEEDED",
74
+ /** It was refused for lack of a permission. */
75
+ DENIED: "DENIED",
76
+ };
77
+ //# sourceMappingURL=audit_log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit_log.js","sourceRoot":"","sources":["../../src/v1beta1/audit_log.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,kDAAkD;AAElD,OAAO,EAA+C,SAAS,EAAE,KAAK,EAAE,MAA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AC/D,KAAK,CAAC,CAAC,QAAQ,CAAC,eAAe,IAAI,EAAE,CAAC;YACtC,IAAI,CAAC,QAAQ,CAAC,aAAa;gBAAE,OAAO;YACpC,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,aAAa,EAAE,CAAC;QACxD,CAAC;IACH,CAAC;CACF;AAwCD,mCAAmC;AACnC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,eAAe;IACf,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB;IACnB,SAAS,EAAE,WAAW;IACtB,+CAA+C;IAC/C,MAAM,EAAE,QAAQ;CACR,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./audit_log.js";
2
+ export * from "./permission.js";
3
+ export * from "./role.js";
4
+ export * from "./role_binding.js";
5
+ export * from "./service_account.js";
6
+ export * from "./user.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ export * from "./audit_log.js";
3
+ export * from "./permission.js";
4
+ export * from "./role.js";
5
+ export * from "./role_binding.js";
6
+ export * from "./service_account.js";
7
+ export * from "./user.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { type CallOptions, type Client, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls PermissionService.
4
+ *
5
+ * The catalog of permissions, and which of them a caller holds. A
6
+ * permission allows one action on one kind of resource, such as
7
+ * `pvs.volume.create`; roles bundle them. Reading the catalog needs no
8
+ * permission.
9
+ */
10
+ export declare class PermissionClient {
11
+ /**
12
+ * The endpoint the client sends its calls to, which also serves the
13
+ * operations its methods answer with.
14
+ */
15
+ readonly service: Service;
16
+ /** A client of PermissionService that sends its calls through `client`. */
17
+ constructor(client: Client);
18
+ /** Returns a permission. */
19
+ getPermission(request: GetPermissionRequest, options?: CallOptions): Promise<Permission>;
20
+ /**
21
+ * Lists every permission the platform checks, in catalog order,
22
+ * including those no predefined role grants by default, such as the
23
+ * billing account permissions.
24
+ */
25
+ listPermissions(request: ListPermissionsRequest, options?: CallOptions): Promise<ListPermissionsResponse>;
26
+ /**
27
+ * Returns the subset of `permissions` the caller holds on an organization
28
+ * or a project. A permission held on the organization counts for each of
29
+ * its projects; one held on a project counts only there. Every resource
30
+ * in a project is governed by the project's permissions, so asking about
31
+ * the project answers for each of its resources. A permission the
32
+ * catalog doesn't name is never held.
33
+ */
34
+ testIamPermissions(request: TestIamPermissionsRequest, options?: CallOptions): Promise<TestIamPermissionsResponse>;
35
+ }
36
+ /** One action on one kind of resource, which a role grants. */
37
+ export interface Permission {
38
+ /**
39
+ * The permission's resource name, `permissions/{service}.{resource}.{action}`,
40
+ * such as `permissions/pvs.volume.create`.
41
+ */
42
+ name?: string;
43
+ /**
44
+ * The permission's URN, the identifier access policies and the audit log
45
+ * use.
46
+ */
47
+ urn?: string;
48
+ /** The service whose API checks it, such as `pvs`. */
49
+ service?: string;
50
+ /** The kind of resource it applies to, such as `volume`. */
51
+ resourceType?: string;
52
+ /** The action it allows, such as `create`. */
53
+ action?: string;
54
+ }
55
+ /** The request for GetPermission. */
56
+ export interface GetPermissionRequest {
57
+ /** The permission to return, `permissions/{permission}`. */
58
+ name?: string;
59
+ }
60
+ /**
61
+ * The request for ListPermissions. The catalog is bounded, so it comes in
62
+ * one page.
63
+ */
64
+ export interface ListPermissionsRequest {
65
+ }
66
+ /** The response for ListPermissions. */
67
+ export interface ListPermissionsResponse {
68
+ /** Every permission, in catalog order. */
69
+ permissions?: Permission[];
70
+ }
71
+ /** The request for TestIamPermissions. */
72
+ export interface TestIamPermissionsRequest {
73
+ /**
74
+ * The organization, `organizations/{organization}`, or the project,
75
+ * `projects/{project}`, to test the permissions on.
76
+ */
77
+ resource?: string;
78
+ /**
79
+ * The permissions to test, by their keys, such as `pvs.volume.create`;
80
+ * at most 100.
81
+ */
82
+ permissions?: string[];
83
+ }
84
+ /** The response for TestIamPermissions. */
85
+ export interface TestIamPermissionsResponse {
86
+ /**
87
+ * The permissions of the request the caller holds on the resource, in the
88
+ * order they were asked for.
89
+ */
90
+ permissions?: string[];
91
+ }
92
+ //# sourceMappingURL=permission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/v1beta1/permission.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AAElG;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC3B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,2EAA2E;gBAC/D,MAAM,EAAE,MAAM;IAI1B,4BAA4B;IACtB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAa9F;;;;OAIG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAY/G;;;;;;;OAOG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAYzH;AAED,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;CAAG;AAE1C,wCAAwC;AACxC,MAAM,WAAW,uBAAuB;IACtC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
@@ -0,0 +1,63 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/iam/v1beta1/permission.proto
3
+ import { pathValue, query } from "@origincloud/core";
4
+ /**
5
+ * Calls PermissionService.
6
+ *
7
+ * The catalog of permissions, and which of them a caller holds. A
8
+ * permission allows one action on one kind of resource, such as
9
+ * `pvs.volume.create`; roles bundle them. Reading the catalog needs no
10
+ * permission.
11
+ */
12
+ export class PermissionClient {
13
+ /**
14
+ * The endpoint the client sends its calls to, which also serves the
15
+ * operations its methods answer with.
16
+ */
17
+ service;
18
+ /** A client of PermissionService that sends its calls through `client`. */
19
+ constructor(client) {
20
+ this.service = client.service("iam", false);
21
+ }
22
+ /** Returns a permission. */
23
+ async getPermission(request, options) {
24
+ const p0 = pathValue("name", request.name, "permissions/*");
25
+ return this.service.call({
26
+ method: "GET",
27
+ path: `/v1beta1/${p0}`,
28
+ query: query(request, ["name"]),
29
+ idempotent: true,
30
+ }, options);
31
+ }
32
+ /**
33
+ * Lists every permission the platform checks, in catalog order,
34
+ * including those no predefined role grants by default, such as the
35
+ * billing account permissions.
36
+ */
37
+ async listPermissions(request, options) {
38
+ return this.service.call({
39
+ method: "GET",
40
+ path: `/v1beta1/permissions`,
41
+ query: query(request, []),
42
+ idempotent: true,
43
+ }, options);
44
+ }
45
+ /**
46
+ * Returns the subset of `permissions` the caller holds on an organization
47
+ * or a project. A permission held on the organization counts for each of
48
+ * its projects; one held on a project counts only there. Every resource
49
+ * in a project is governed by the project's permissions, so asking about
50
+ * the project answers for each of its resources. A permission the
51
+ * catalog doesn't name is never held.
52
+ */
53
+ async testIamPermissions(request, options) {
54
+ const p0 = pathValue("resource", request.resource, "*/*");
55
+ return this.service.call({
56
+ method: "POST",
57
+ path: `/v1beta1/${p0}:testIamPermissions`,
58
+ body: request,
59
+ idempotent: true,
60
+ }, options);
61
+ }
62
+ }
63
+ //# sourceMappingURL=permission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/v1beta1/permission.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,mDAAmD;AAEnD,OAAO,EAA+C,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACM,OAAO,CAAU;IAE1B,2EAA2E;IAC3E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,C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