@casual-simulation/aux-records 3.2.13 → 3.2.14-alpha.7890390188
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/AIController.d.ts +7 -4
- package/AIController.js +11 -0
- package/AIController.js.map +1 -1
- package/AuthController.d.ts +2 -1
- package/AuthController.js +6 -3
- package/AuthController.js.map +1 -1
- package/AuthStore.d.ts +1 -21
- package/CachingPolicyStore.d.ts +16 -5
- package/CachingPolicyStore.js +66 -39
- package/CachingPolicyStore.js.map +1 -1
- package/DataRecordsController.d.ts +67 -5
- package/DataRecordsController.js +141 -78
- package/DataRecordsController.js.map +1 -1
- package/DataRecordsStore.d.ts +35 -1
- package/DataRecordsStore.js.map +1 -1
- package/EventRecordsController.d.ts +5 -5
- package/EventRecordsController.js +54 -35
- package/EventRecordsController.js.map +1 -1
- package/FileRecordsController.d.ts +6 -6
- package/FileRecordsController.js +142 -76
- package/FileRecordsController.js.map +1 -1
- package/MemoryStore.d.ts +28 -17
- package/MemoryStore.js +457 -110
- package/MemoryStore.js.map +1 -1
- package/PolicyController.d.ts +512 -677
- package/PolicyController.js +1196 -2934
- package/PolicyController.js.map +1 -1
- package/PolicyStore.d.ts +319 -90
- package/PolicyStore.js +125 -0
- package/PolicyStore.js.map +1 -1
- package/RecordsServer.d.ts +3 -4
- package/RecordsServer.js +88 -111
- package/RecordsServer.js.map +1 -1
- package/RecordsStore.d.ts +3 -0
- package/TestUtils.d.ts +1 -1
- package/TestUtils.js.map +1 -1
- package/Utils.d.ts +21 -3
- package/Utils.js +42 -3
- package/Utils.js.map +1 -1
- package/package.json +3 -3
- package/websockets/InstRecordsStore.d.ts +21 -0
- package/websockets/InstRecordsStore.js +43 -1
- package/websockets/InstRecordsStore.js.map +1 -1
- package/websockets/WebsocketController.d.ts +7 -7
- package/websockets/WebsocketController.js +153 -82
- package/websockets/WebsocketController.js.map +1 -1
package/PolicyController.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AuthController } from './AuthController';
|
|
2
2
|
import { RecordsController, ValidatePublicRecordKeyFailure, ValidatePublicRecordKeyResult } from './RecordsController';
|
|
3
3
|
import { NotSupportedError, ServerError, SubscriptionLimitReached } from '@casual-simulation/aux-common/Errors';
|
|
4
|
-
import { AvailablePermissions,
|
|
4
|
+
import { AvailablePermissions, ResourceKinds, ActionKinds, SubjectType, DenialReason, PrivacyFeatures, PermissionOptions } from '@casual-simulation/aux-common';
|
|
5
5
|
import { ListedStudioAssignment, PublicRecordKeyPolicy } from './RecordsStore';
|
|
6
|
-
import { AssignedRole,
|
|
6
|
+
import { AssignedRole, AssignPermissionToSubjectAndMarkerFailure, MarkerPermissionAssignment, PolicyStore, ResourcePermissionAssignment, RoleAssignment, UpdateUserRolesFailure } from './PolicyStore';
|
|
7
7
|
/**
|
|
8
8
|
* The maximum number of instances that can be authorized at once.
|
|
9
9
|
*/
|
|
@@ -13,13 +13,16 @@ export declare const MAX_ALLOWED_INSTANCES = 2;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const MAX_ALLOWED_MARKERS = 2;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Gets the resources that need to be authorized when creating a resource with the given markers.
|
|
17
|
+
* @param markers The markers that will be placed on the resource.
|
|
17
18
|
*/
|
|
18
|
-
export declare
|
|
19
|
+
export declare function getMarkerResourcesForCreation(markers: string[]): ResourceInfo[];
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Gets the resources that need to be authorized when updating a resource with the given markers.
|
|
22
|
+
* @param existingMarkers The markers that already exist on the resource.
|
|
23
|
+
* @param newMarkers The markers that will replace the existing markers. If null, then no markers will be added or removed.
|
|
21
24
|
*/
|
|
22
|
-
export declare
|
|
25
|
+
export declare function getMarkerResourcesForUpdate(existingMarkers: string[], newMarkers: string[]): ResourceInfo[];
|
|
23
26
|
/**
|
|
24
27
|
* Defines a class that is able to calculate the policies and permissions that are allowed for specific actions.
|
|
25
28
|
*/
|
|
@@ -33,21 +36,70 @@ export declare class PolicyController {
|
|
|
33
36
|
* @param request The request that will be authorized.
|
|
34
37
|
* @returns The authorization context that will be used to evaluate whether the request is authorized.
|
|
35
38
|
*/
|
|
36
|
-
constructAuthorizationContext(request:
|
|
39
|
+
constructAuthorizationContext(request: ConstructAuthorizationContextRequest): Promise<ConstructAuthorizationContextResult>;
|
|
37
40
|
/**
|
|
38
|
-
* Attempts to authorize the given
|
|
39
|
-
* Returns a promise that resolves with information about the security properties of the request.
|
|
41
|
+
* Attempts to authorize the given user and instances for the action and resource(s).
|
|
40
42
|
* @param context The authorization context for the request.
|
|
41
43
|
* @param request The request.
|
|
42
44
|
*/
|
|
43
|
-
|
|
45
|
+
authorizeUserAndInstances(context: AuthorizationContext, request: AuthorizeUserAndInstancesRequest): Promise<AuthorizeUserAndInstancesResult>;
|
|
44
46
|
/**
|
|
45
|
-
* Attempts to authorize the given
|
|
46
|
-
* Returns a promise that resolves with information about the security properties of the request.
|
|
47
|
+
* Attempts to authorize the given user and instances for the given resources.
|
|
47
48
|
* @param context The authorization context for the request.
|
|
48
49
|
* @param request The request.
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
authorizeUserAndInstancesForResources(context: AuthorizationContext, request: AuthorizeUserAndInstancesForResources): Promise<AuthorizeUserAndInstancesForResourcesResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Attempts to authorize the given subjects for the action and resource(s).
|
|
54
|
+
* @param context The authorization context for the request.
|
|
55
|
+
* @param request The request.
|
|
56
|
+
*/
|
|
57
|
+
authorizeSubjects(context: AuthorizationContext, request: AuthorizeSubjectsRequest): Promise<AuthorizeSubjectsResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Attempts to authorize the given subject for the action and resource(s).
|
|
60
|
+
* Returns a promise that resolves with information about the security properties of the request.
|
|
61
|
+
* @param context The context for the request.
|
|
62
|
+
* @param request The request to authorize.
|
|
63
|
+
*/
|
|
64
|
+
authorizeSubject(context: ConstructAuthorizationContextResult, request: AuthorizeSubjectRequest): Promise<AuthorizeSubjectResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Attempts to authorize the given subject for the action and resource(s).
|
|
67
|
+
* Returns a promise that resolves with information about the security properties of the request.
|
|
68
|
+
* @param context The context for the request.
|
|
69
|
+
* @param request The request to authorize.
|
|
70
|
+
*/
|
|
71
|
+
authorizeSubjectUsingContext(context: AuthorizationContext, request: AuthorizeSubjectRequest): Promise<AuthorizeSubjectResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Attempts to authorize the given subject for the action and resource(s).
|
|
74
|
+
* Returns a promise that resolves with information about the security properties of the request.
|
|
75
|
+
* @param context The context for the request.
|
|
76
|
+
* @param request The request to authorize.
|
|
77
|
+
*/
|
|
78
|
+
private _authorizeSubjectUsingContext;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the list of permissions in the given record.
|
|
81
|
+
* @param recordKeyOrRecordName The name of the record.
|
|
82
|
+
* @param userId The ID of the currently logged in user.
|
|
83
|
+
* @param instances The instances that are loaded.
|
|
84
|
+
*/
|
|
85
|
+
listPermissions(recordKeyOrRecordName: string, userId: string, instances?: string[] | null): Promise<ListPermissionsResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the list of permissions that have been assigned to the given marker.
|
|
88
|
+
* @param recordKeyOrRecordName The name of the record.
|
|
89
|
+
* @param marker The marker that the permissions should be listed for.
|
|
90
|
+
* @param userId The ID of the currently logged in user.
|
|
91
|
+
* @param instances The instances that are loaded.
|
|
92
|
+
*/
|
|
93
|
+
listPermissionsForMarker(recordKeyOrRecordName: string, marker: string, userId: string, instances?: string[] | null): Promise<ListPermissionsForMarkerResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Gets the list of permissions that have been assigned to the given marker.
|
|
96
|
+
* @param recordKeyOrRecordName The name of the record.
|
|
97
|
+
* @param resourceKind The kind of the resource.
|
|
98
|
+
* @param resourceId The ID of the resource.
|
|
99
|
+
* @param userId The ID of the currently logged in user.
|
|
100
|
+
* @param instances The instances that are loaded.
|
|
101
|
+
*/
|
|
102
|
+
listPermissionsForResource(recordKeyOrRecordName: string, resourceKind: ResourceKinds, resourceId: string, userId: string, instances?: string[] | null): Promise<ListPermissionsForResourceResult>;
|
|
51
103
|
/**
|
|
52
104
|
* Attempts to grant a permission to a marker.
|
|
53
105
|
* @param request The request for the operation.
|
|
@@ -59,21 +111,20 @@ export declare class PolicyController {
|
|
|
59
111
|
*/
|
|
60
112
|
revokeMarkerPermission(request: RevokeMarkerPermissionRequest): Promise<RevokeMarkerPermissionResult>;
|
|
61
113
|
/**
|
|
62
|
-
* Attempts to
|
|
63
|
-
* @param
|
|
64
|
-
* @param userId The ID of the user that is currently logged in.
|
|
65
|
-
* @param marker The marker.
|
|
66
|
-
* @param instances The instances that the request is being made from.
|
|
114
|
+
* Attempts to grant a permission to a resource.
|
|
115
|
+
* @param request The request.
|
|
67
116
|
*/
|
|
68
|
-
|
|
117
|
+
grantResourcePermission(request: GrantResourcePermissionRequest): Promise<GrantResourcePermissionResult>;
|
|
69
118
|
/**
|
|
70
|
-
* Attempts to
|
|
71
|
-
* @param
|
|
72
|
-
* @param userId The ID of the user that is currently logged in.
|
|
73
|
-
* @param startingMarker The marker that policies should be returned after.
|
|
74
|
-
* @param instances The instances that the request is being made from.
|
|
119
|
+
* Attempts to revoke a permission from a resource.
|
|
120
|
+
* @param request The request for the operation.
|
|
75
121
|
*/
|
|
76
|
-
|
|
122
|
+
revokeResourcePermission(request: RevokeResourcePermissionRequest): Promise<RevokeResourcePermissionResult>;
|
|
123
|
+
/**
|
|
124
|
+
* Attempts to revoke the permission with the given ID.
|
|
125
|
+
* @param request The request for the operation.
|
|
126
|
+
*/
|
|
127
|
+
revokePermission(request: RevokePermissionRequest): Promise<RevokePermissionResult>;
|
|
77
128
|
/**
|
|
78
129
|
* Attempts to list the roles that are assigned to a user.
|
|
79
130
|
* @param recordKeyOrRecordName The record key or the name of the record.
|
|
@@ -122,127 +173,6 @@ export declare class PolicyController {
|
|
|
122
173
|
* @param instances The instances that the request is being made from.
|
|
123
174
|
*/
|
|
124
175
|
revokeRole(recordKeyOrRecordName: string, userId: string, request: RevokeRoleRequest, instances?: string[]): Promise<RevokeRoleResult>;
|
|
125
|
-
/**
|
|
126
|
-
* Attempts to authorize the given request.
|
|
127
|
-
* Returns a promise that resolves with information about the security properties of the request.
|
|
128
|
-
* @param context The authorization context for the request.
|
|
129
|
-
* @param request The request.
|
|
130
|
-
*/
|
|
131
|
-
private _authorizeRequestUsingContext;
|
|
132
|
-
private _authorizeDataCreateRequest;
|
|
133
|
-
/**
|
|
134
|
-
* Authorizes the given subject for data.create requests.
|
|
135
|
-
*
|
|
136
|
-
* @param context The context for the authorization.
|
|
137
|
-
* @param subjectType The type of subject that is being authorized.
|
|
138
|
-
* @param id The ID of the subject.
|
|
139
|
-
* @returns The authorization that approves the subject for the request. Null if the subject is not authorized.
|
|
140
|
-
*/
|
|
141
|
-
private _authorizeCreateData;
|
|
142
|
-
private _authorizeDataReadRequest;
|
|
143
|
-
private _authorizeDataRead;
|
|
144
|
-
private _authorizeDataUpdateRequest;
|
|
145
|
-
private _authorizeDataUpdate;
|
|
146
|
-
private _authorizeDataDeleteRequest;
|
|
147
|
-
private _authorizeDataDelete;
|
|
148
|
-
private _authorizeDataListRequest;
|
|
149
|
-
private _authorizeDataList;
|
|
150
|
-
private _authorizeFileCreateRequest;
|
|
151
|
-
private _authorizeFileCreate;
|
|
152
|
-
private _authorizeFileReadRequest;
|
|
153
|
-
private _authorizeFileRead;
|
|
154
|
-
private _authorizeFileListRequest;
|
|
155
|
-
private _authorizeFileList;
|
|
156
|
-
private _authorizeFileUpdateRequest;
|
|
157
|
-
private _authorizeFileUpdate;
|
|
158
|
-
private _authorizeFileDeleteRequest;
|
|
159
|
-
private _authorizeFileDelete;
|
|
160
|
-
private _authorizeEventCountRequest;
|
|
161
|
-
private _authorizeEventCount;
|
|
162
|
-
private _authorizeEventIncrementRequest;
|
|
163
|
-
private _authorizeEventIncrement;
|
|
164
|
-
private _authorizeEventUpdateRequest;
|
|
165
|
-
private _authorizeEventUpdate;
|
|
166
|
-
private _authorizeEventListRequest;
|
|
167
|
-
private _authorizeEventList;
|
|
168
|
-
private _authorizePolicyGrantPermissionRequest;
|
|
169
|
-
private _authorizePolicyGrantPermission;
|
|
170
|
-
private _authorizePolicyRevokePermissionRequest;
|
|
171
|
-
private _authorizePolicyRevokePermission;
|
|
172
|
-
private _authorizePolicyReadRequest;
|
|
173
|
-
private _authorizePolicyRead;
|
|
174
|
-
private _authorizePolicyListRequest;
|
|
175
|
-
private _authorizePolicyList;
|
|
176
|
-
private _authorizeRoleListRequest;
|
|
177
|
-
private _authorizeRoleList;
|
|
178
|
-
private _authorizeRoleReadRequest;
|
|
179
|
-
private _authorizeRoleRead;
|
|
180
|
-
private _authorizeRoleGrantRequest;
|
|
181
|
-
private _authorizeRoleGrant;
|
|
182
|
-
private _authorizeRoleRevokeRequest;
|
|
183
|
-
private _authorizeRoleRevoke;
|
|
184
|
-
private _authorizeInstCreateRequest;
|
|
185
|
-
/**
|
|
186
|
-
* Authorizes the given subject for inst.create requests.
|
|
187
|
-
*
|
|
188
|
-
* @param context The context for the authorization.
|
|
189
|
-
* @param subjectType The type of subject that is being authorized.
|
|
190
|
-
* @param id The ID of the subject.
|
|
191
|
-
* @returns The authorization that approves the subject for the request. Null if the subject is not authorized.
|
|
192
|
-
*/
|
|
193
|
-
private _authorizeCreateInst;
|
|
194
|
-
private _authorizeInstReadRequest;
|
|
195
|
-
private _authorizeInstRead;
|
|
196
|
-
private _authorizeInstUpdateRequest;
|
|
197
|
-
private _authorizeInstUpdate;
|
|
198
|
-
private _authorizeInstUpdateDataRequest;
|
|
199
|
-
private _authorizeInstUpdateData;
|
|
200
|
-
private _authorizeInstDeleteRequest;
|
|
201
|
-
private _authorizeInstDelete;
|
|
202
|
-
private _authorizeInstListRequest;
|
|
203
|
-
private _authorizeInstList;
|
|
204
|
-
private _authorizeInstSendActionRequest;
|
|
205
|
-
private _authorizeInstSendAction;
|
|
206
|
-
/**
|
|
207
|
-
* Attempts to authorize the given request based on common request properties.
|
|
208
|
-
*
|
|
209
|
-
* Evaluates the recordKey, userId, and instances with the given resource markers and authorize function.
|
|
210
|
-
* The given authorize function will be called with the User ID, and each inst and should return the authorization that should be used for each case.
|
|
211
|
-
* If it returns null, then the request is not authorized and will be rejected as such.
|
|
212
|
-
*
|
|
213
|
-
* @param context The context for the request.
|
|
214
|
-
* @param request The request that should be authorized.
|
|
215
|
-
* @param resourceMarkers The list of markers that need to be validated.
|
|
216
|
-
* @param authorize The function that should be used to authorize each subject in the request.
|
|
217
|
-
* @param skipInstanceChecksWhenValidRecordKeyIsProvided Whether or not to skip instance checks when a valid record key is provided.
|
|
218
|
-
* @param isListOperation Whether the request is a list operation.
|
|
219
|
-
*/
|
|
220
|
-
private _authorizeRequest;
|
|
221
|
-
private _authorizeInstances;
|
|
222
|
-
private _listPermissionsForMarkers;
|
|
223
|
-
private _every;
|
|
224
|
-
private _some;
|
|
225
|
-
private _byType;
|
|
226
|
-
private _byData;
|
|
227
|
-
private _byFile;
|
|
228
|
-
private _byEvent;
|
|
229
|
-
private _byInst;
|
|
230
|
-
private _byRecordOwner;
|
|
231
|
-
private _byStudioRole;
|
|
232
|
-
private _byEveryoneRole;
|
|
233
|
-
private _byAdminRole;
|
|
234
|
-
private _bySubjectRole;
|
|
235
|
-
private _byUserRole;
|
|
236
|
-
private _byInstRole;
|
|
237
|
-
private _byRole;
|
|
238
|
-
private _byPolicy;
|
|
239
|
-
private _byRolePermission;
|
|
240
|
-
private _byRoleGrant;
|
|
241
|
-
private _byRoleRevoke;
|
|
242
|
-
private _byPolicyList;
|
|
243
|
-
private _byRoleList;
|
|
244
|
-
private _testRegex;
|
|
245
|
-
private _findPermissionByFilter;
|
|
246
176
|
}
|
|
247
177
|
/**
|
|
248
178
|
* Determines if any markers will be remaining after the removal and addition of the specified markers.
|
|
@@ -251,24 +181,10 @@ export declare class PolicyController {
|
|
|
251
181
|
* @param addedMarkers The markers that will be added.
|
|
252
182
|
*/
|
|
253
183
|
export declare function willMarkersBeRemaining(existingMarkers: string[], removedMarkers: string[] | null, addedMarkers: string[] | null): boolean;
|
|
254
|
-
export declare function returnAuthorizationResult(a: AuthorizeDenied): {
|
|
255
|
-
success: false;
|
|
256
|
-
errorCode: Exclude<AuthorizeDenied['errorCode'], 'action_not_supported'>;
|
|
257
|
-
errorMessage: AuthorizeDenied['errorMessage'];
|
|
258
|
-
} & Omit<AuthorizeDenied, 'allowed'>;
|
|
259
184
|
/**
|
|
260
|
-
*
|
|
261
|
-
* the privacy settings of the record owner and the user.
|
|
262
|
-
* @param markerPolicies The marker policies that should be merged.
|
|
185
|
+
* Gets a simple human readable explaination for the given permission assignment.
|
|
263
186
|
*/
|
|
264
|
-
export declare function
|
|
265
|
-
marker: string;
|
|
266
|
-
result: ListMarkerPoliciesResult;
|
|
267
|
-
}[]): MarkerPermission[];
|
|
268
|
-
export interface MarkerPermission {
|
|
269
|
-
marker: string;
|
|
270
|
-
permissions: PossiblePermission[];
|
|
271
|
-
}
|
|
187
|
+
export declare function explainationForPermissionAssignment(subjectType: SubjectType, permissionAssignment: MarkerPermissionAssignment | ResourcePermissionAssignment): string;
|
|
272
188
|
export type ConstructAuthorizationContextResult = ConstructAuthorizationContextSuccess | ConstructAuthorizationContextFailure;
|
|
273
189
|
export interface ConstructAuthorizationContextSuccess {
|
|
274
190
|
success: true;
|
|
@@ -287,506 +203,32 @@ export interface AuthorizationContext {
|
|
|
287
203
|
recordStudioId: string;
|
|
288
204
|
recordStudioMembers?: ListedStudioAssignment[];
|
|
289
205
|
subjectPolicy: PublicRecordKeyPolicy;
|
|
290
|
-
}
|
|
291
|
-
export interface RolesContext<T extends AuthorizeRequestBase> extends AuthorizationContext {
|
|
292
|
-
userRoles: Set<string> | null;
|
|
293
|
-
instRoles: {
|
|
294
|
-
[inst: string]: Set<string>;
|
|
295
|
-
};
|
|
296
|
-
markers: MarkerPermission[];
|
|
297
|
-
request: T;
|
|
298
|
-
allowedDataItems?: ListedDataItem[];
|
|
299
|
-
allowedFileItems?: ListedFileItem[];
|
|
300
|
-
allowedEventItems?: ListedEventItem[];
|
|
301
|
-
allowedInstItems?: ListedInstItem[];
|
|
302
|
-
}
|
|
303
|
-
interface PossiblePermission {
|
|
304
|
-
policy: PolicyDocument;
|
|
305
|
-
permission: AvailablePermissions;
|
|
306
|
-
}
|
|
307
|
-
export type AuthorizeRequest = AuthorizeDataCreateRequest | AuthorizeReadDataRequest | AuthorizeUpdateDataRequest | AuthorizeDeleteDataRequest | AuthorizeListDataRequest | AuthorizeCreateFileRequest | AuthorizeReadFileRequest | AuthorizeListFileRequest | AuthorizeUpdateFileRequest | AuthorizeDeleteFileRequest | AuthorizeCountEventRequest | AuthorizeIncrementEventRequest | AuthorizeUpdateEventRequest | AuthorizeListEventRequest | AuthorizeGrantPermissionToPolicyRequest | AuthorizeRevokePermissionToPolicyRequest | AuthorizeReadPolicyRequest | AuthorizeListPoliciesRequest | AuthorizeListRolesRequest | AuthorizeReadRoleRequest | AuthorizeGrantRoleRequest | AuthorizeRevokeRoleRequest | AuthorizeInstCreateRequest | AuthorizeInstDeleteRequest | AuthorizeInstReadRequest | AuthorizeInstUpdateDataRequest | AuthorizeInstUpdateRequest | AuthorizeInstListRequest | AuthorizeInstSendActionListRequest;
|
|
308
|
-
export interface AuthorizeRequestBase {
|
|
309
|
-
/**
|
|
310
|
-
* The record key that should be used or the name of the record that the request is being authorized for.
|
|
311
|
-
*/
|
|
312
|
-
recordKeyOrRecordName: string;
|
|
313
|
-
/**
|
|
314
|
-
* The type of the action that is being authorized.
|
|
315
|
-
*/
|
|
316
|
-
action: string;
|
|
317
|
-
/**
|
|
318
|
-
* The ID of the user that is currently logged in.
|
|
319
|
-
*/
|
|
320
|
-
userId?: string | null;
|
|
321
|
-
/**
|
|
322
|
-
* The instances that the request is being made from.
|
|
323
|
-
*/
|
|
324
|
-
instances?: string[] | null;
|
|
325
|
-
}
|
|
326
|
-
export interface AuthorizeDataCreateRequest extends AuthorizeRequestBase {
|
|
327
|
-
action: 'data.create';
|
|
328
|
-
/**
|
|
329
|
-
* The address that the new record will be placed at.
|
|
330
|
-
*/
|
|
331
|
-
address: string;
|
|
332
|
-
/**
|
|
333
|
-
* The list of resource markers that should be applied to the data.
|
|
334
|
-
*/
|
|
335
|
-
resourceMarkers: string[];
|
|
336
|
-
}
|
|
337
|
-
export interface AuthorizeReadDataRequest extends AuthorizeRequestBase {
|
|
338
|
-
action: 'data.read';
|
|
339
|
-
/**
|
|
340
|
-
* The address that the record is placed at.
|
|
341
|
-
*/
|
|
342
|
-
address: string;
|
|
343
|
-
/**
|
|
344
|
-
* The list of resource markers that are applied to the data.
|
|
345
|
-
*/
|
|
346
|
-
resourceMarkers: string[];
|
|
347
|
-
}
|
|
348
|
-
export interface AuthorizeUpdateDataRequest extends AuthorizeRequestBase {
|
|
349
|
-
action: 'data.update';
|
|
350
|
-
/**
|
|
351
|
-
* The address that the record is placed at.
|
|
352
|
-
*/
|
|
353
|
-
address: string;
|
|
354
|
-
/**
|
|
355
|
-
* The list of resource markers that are applied to the data.
|
|
356
|
-
*/
|
|
357
|
-
existingMarkers: string[];
|
|
358
|
-
/**
|
|
359
|
-
* The new resource markers that will be added to the data.
|
|
360
|
-
* If omitted, then no markers are being added to the data.
|
|
361
|
-
*/
|
|
362
|
-
addedMarkers?: string[];
|
|
363
|
-
/**
|
|
364
|
-
* The markers that will be removed from the data.
|
|
365
|
-
* If omitted, then no markers are being removed from the data.
|
|
366
|
-
*/
|
|
367
|
-
removedMarkers?: string[];
|
|
368
|
-
}
|
|
369
|
-
export interface AuthorizeDeleteDataRequest extends AuthorizeRequestBase {
|
|
370
|
-
action: 'data.delete';
|
|
371
|
-
/**
|
|
372
|
-
* The address that the record is placed at.
|
|
373
|
-
*/
|
|
374
|
-
address: string;
|
|
375
|
-
/**
|
|
376
|
-
* The list of resource markers that are applied to the data.
|
|
377
|
-
*/
|
|
378
|
-
resourceMarkers: string[];
|
|
379
|
-
}
|
|
380
|
-
export interface AuthorizeListDataRequest extends AuthorizeRequestBase {
|
|
381
|
-
action: 'data.list';
|
|
382
|
-
/**
|
|
383
|
-
* The list of items that should be filtered.
|
|
384
|
-
*/
|
|
385
|
-
dataItems: ListedDataItem[];
|
|
386
|
-
}
|
|
387
|
-
export interface AuthorizeFileRequest extends AuthorizeRequestBase {
|
|
388
|
-
/**
|
|
389
|
-
* The size of the file that is being created in bytes.
|
|
390
|
-
*/
|
|
391
|
-
fileSizeInBytes: number;
|
|
392
|
-
/**
|
|
393
|
-
* The MIME Type of the file.
|
|
394
|
-
*/
|
|
395
|
-
fileMimeType: string;
|
|
396
|
-
}
|
|
397
|
-
export interface AuthorizeCreateFileRequest extends AuthorizeFileRequest {
|
|
398
|
-
action: 'file.create';
|
|
399
|
-
/**
|
|
400
|
-
* The list of resource markers that should be applied to the file.
|
|
401
|
-
*/
|
|
402
|
-
resourceMarkers: string[];
|
|
403
|
-
}
|
|
404
|
-
export interface AuthorizeReadFileRequest extends AuthorizeFileRequest {
|
|
405
|
-
action: 'file.read';
|
|
406
|
-
/**
|
|
407
|
-
* The list of resource markers that are applied to the file.
|
|
408
|
-
*/
|
|
409
|
-
resourceMarkers: string[];
|
|
410
|
-
}
|
|
411
|
-
export interface AuthorizeListFileRequest extends AuthorizeRequestBase {
|
|
412
|
-
action: 'file.list';
|
|
413
|
-
/**
|
|
414
|
-
* The list of items that should be filtered.
|
|
415
|
-
*/
|
|
416
|
-
fileItems: ListedFileItem[];
|
|
417
|
-
}
|
|
418
|
-
export interface AuthorizeUpdateFileRequest extends AuthorizeFileRequest {
|
|
419
|
-
action: 'file.update';
|
|
420
|
-
/**
|
|
421
|
-
* The list of resource markers that are applied to the file.
|
|
422
|
-
*/
|
|
423
|
-
existingMarkers: string[];
|
|
424
|
-
/**
|
|
425
|
-
* The new resource markers that will be added to the file.
|
|
426
|
-
* If omitted, then no markers are being added to the file.
|
|
427
|
-
*/
|
|
428
|
-
addedMarkers?: string[];
|
|
429
|
-
/**
|
|
430
|
-
* The markers that will be removed from the file.
|
|
431
|
-
* If omitted, then no markers are being removed from the file.
|
|
432
|
-
*/
|
|
433
|
-
removedMarkers?: string[];
|
|
434
|
-
}
|
|
435
|
-
export interface AuthorizeDeleteFileRequest extends AuthorizeFileRequest {
|
|
436
|
-
action: 'file.delete';
|
|
437
|
-
/**
|
|
438
|
-
* The list of resource markers that are applied to the file.
|
|
439
|
-
*/
|
|
440
|
-
resourceMarkers: string[];
|
|
441
|
-
}
|
|
442
|
-
export interface AuthorizeEventRequest extends AuthorizeRequestBase {
|
|
443
|
-
/**
|
|
444
|
-
* The name of the event.
|
|
445
|
-
*/
|
|
446
|
-
eventName: string;
|
|
447
|
-
}
|
|
448
|
-
export interface AuthorizeCountEventRequest extends AuthorizeEventRequest {
|
|
449
|
-
action: 'event.count';
|
|
450
|
-
/**
|
|
451
|
-
* The list of resource markers that are applied to the event.
|
|
452
|
-
*/
|
|
453
|
-
resourceMarkers: string[];
|
|
454
|
-
}
|
|
455
|
-
export interface AuthorizeIncrementEventRequest extends AuthorizeEventRequest {
|
|
456
|
-
action: 'event.increment';
|
|
457
|
-
/**
|
|
458
|
-
* The list of resource markers that are applied to the event.
|
|
459
|
-
*/
|
|
460
|
-
resourceMarkers: string[];
|
|
461
|
-
}
|
|
462
|
-
export interface AuthorizeUpdateEventRequest extends AuthorizeEventRequest {
|
|
463
|
-
action: 'event.update';
|
|
464
|
-
/**
|
|
465
|
-
* The list of resource markers that are applied to the event.
|
|
466
|
-
*/
|
|
467
|
-
existingMarkers: string[];
|
|
468
|
-
/**
|
|
469
|
-
* The new resource markers that will be added to the event.
|
|
470
|
-
* If omitted, then no markers are being added to the event.
|
|
471
|
-
*/
|
|
472
|
-
addedMarkers?: string[];
|
|
473
|
-
/**
|
|
474
|
-
* The markers that will be removed from the event.
|
|
475
|
-
* If omitted, then no markers are being removed from the event.
|
|
476
|
-
*/
|
|
477
|
-
removedMarkers?: string[];
|
|
478
|
-
}
|
|
479
|
-
export interface AuthorizeListEventRequest extends AuthorizeRequestBase {
|
|
480
|
-
action: 'event.list';
|
|
481
|
-
/**
|
|
482
|
-
* The list of items that should be filtered.
|
|
483
|
-
*/
|
|
484
|
-
eventItems: ListedEventItem[];
|
|
485
|
-
}
|
|
486
|
-
export interface AuthorizePolicyRequest extends AuthorizeRequestBase {
|
|
487
|
-
/**
|
|
488
|
-
* The name of the policy.
|
|
489
|
-
*/
|
|
490
|
-
policy: string;
|
|
491
|
-
}
|
|
492
|
-
export interface AuthorizeGrantPermissionToPolicyRequest extends AuthorizePolicyRequest {
|
|
493
|
-
action: 'policy.grantPermission';
|
|
494
|
-
}
|
|
495
|
-
export interface AuthorizeRevokePermissionToPolicyRequest extends AuthorizePolicyRequest {
|
|
496
|
-
action: 'policy.revokePermission';
|
|
497
|
-
}
|
|
498
|
-
export interface AuthorizeReadPolicyRequest extends AuthorizePolicyRequest {
|
|
499
|
-
action: 'policy.read';
|
|
500
|
-
}
|
|
501
|
-
export interface AuthorizeListPoliciesRequest extends Omit<AuthorizePolicyRequest, 'policy'> {
|
|
502
|
-
action: 'policy.list';
|
|
503
|
-
}
|
|
504
|
-
export interface AuthorizeRoleRequest extends AuthorizeRequestBase {
|
|
505
|
-
/**
|
|
506
|
-
* The name of the role.
|
|
507
|
-
*/
|
|
508
|
-
role: string;
|
|
509
|
-
}
|
|
510
|
-
export interface AuthorizeListRolesRequest extends Omit<AuthorizeRoleRequest, 'role'> {
|
|
511
|
-
action: 'role.list';
|
|
512
|
-
}
|
|
513
|
-
export interface AuthorizeReadRoleRequest extends AuthorizeRoleRequest {
|
|
514
|
-
action: 'role.read';
|
|
515
|
-
}
|
|
516
|
-
export interface AuthorizeGrantRoleRequest extends AuthorizeRoleRequest {
|
|
517
|
-
action: 'role.grant';
|
|
518
|
-
/**
|
|
519
|
-
* The ID of the user that the role should be granted to.
|
|
520
|
-
*/
|
|
521
|
-
targetUserId?: string;
|
|
522
|
-
/**
|
|
523
|
-
* The inst that the role should be granted to.
|
|
524
|
-
*/
|
|
525
|
-
targetInstance?: string;
|
|
526
|
-
/**
|
|
527
|
-
* The time that the grant will expire.
|
|
528
|
-
* If omitted, then the grant will never expire.
|
|
529
|
-
*/
|
|
530
|
-
expireTimeMs?: number | null;
|
|
531
|
-
}
|
|
532
|
-
export interface AuthorizeRevokeRoleRequest extends AuthorizeRoleRequest {
|
|
533
|
-
action: 'role.revoke';
|
|
534
|
-
/**
|
|
535
|
-
* The ID of the user that the role should be granted to.
|
|
536
|
-
*/
|
|
537
|
-
targetUserId?: string;
|
|
538
|
-
/**
|
|
539
|
-
* The inst that the role should be granted to.
|
|
540
|
-
*/
|
|
541
|
-
targetInstance?: string;
|
|
542
|
-
}
|
|
543
|
-
export interface AuthorizeInstRequest extends AuthorizeRequestBase {
|
|
544
|
-
/**
|
|
545
|
-
* The inst that the request is being made for.
|
|
546
|
-
*/
|
|
547
|
-
inst: string;
|
|
548
|
-
/**
|
|
549
|
-
* The list of resource markers that are applied to the inst.
|
|
550
|
-
*/
|
|
551
|
-
resourceMarkers: string[];
|
|
552
|
-
}
|
|
553
|
-
export interface AuthorizeInstCreateRequest extends AuthorizeInstRequest {
|
|
554
|
-
action: 'inst.create';
|
|
555
|
-
}
|
|
556
|
-
export interface AuthorizeInstDeleteRequest extends AuthorizeInstRequest {
|
|
557
|
-
action: 'inst.delete';
|
|
558
|
-
}
|
|
559
|
-
export interface AuthorizeInstUpdateRequest extends AuthorizeRequestBase {
|
|
560
|
-
action: 'inst.update';
|
|
561
|
-
/**
|
|
562
|
-
* The inst that the request is being made for.
|
|
563
|
-
*/
|
|
564
|
-
inst: string;
|
|
565
|
-
/**
|
|
566
|
-
* The list of resource markers that are applied to the inst.
|
|
567
|
-
*/
|
|
568
|
-
existingMarkers: string[];
|
|
569
|
-
/**
|
|
570
|
-
* The new resource markers that will be added to the inst.
|
|
571
|
-
* If omitted, then no markers are being added to the inst.
|
|
572
|
-
*/
|
|
573
|
-
addedMarkers?: string[];
|
|
574
|
-
/**
|
|
575
|
-
* The markers that will be removed from the inst.
|
|
576
|
-
* If omitted, then no markers are being removed from the inst.
|
|
577
|
-
*/
|
|
578
|
-
removedMarkers?: string[];
|
|
579
|
-
}
|
|
580
|
-
export interface AuthorizeInstUpdateDataRequest extends AuthorizeInstRequest {
|
|
581
|
-
action: 'inst.updateData';
|
|
582
|
-
}
|
|
583
|
-
export interface AuthorizeInstReadRequest extends AuthorizeInstRequest {
|
|
584
|
-
action: 'inst.read';
|
|
585
|
-
}
|
|
586
|
-
export interface AuthorizeInstListRequest extends AuthorizeRequestBase {
|
|
587
|
-
action: 'inst.list';
|
|
588
|
-
/**
|
|
589
|
-
* The list of insts.
|
|
590
|
-
*/
|
|
591
|
-
insts: ListedInstItem[];
|
|
592
|
-
}
|
|
593
|
-
export interface AuthorizeInstSendActionListRequest extends AuthorizeInstRequest {
|
|
594
|
-
action: 'inst.sendAction';
|
|
595
|
-
}
|
|
596
|
-
export interface ListedDataItem {
|
|
597
|
-
/**
|
|
598
|
-
* The address of the item.
|
|
599
|
-
*/
|
|
600
|
-
address: string;
|
|
601
|
-
/**
|
|
602
|
-
* The list of markers for the item.
|
|
603
|
-
*/
|
|
604
|
-
markers: string[];
|
|
605
|
-
}
|
|
606
|
-
export interface ListedFileItem {
|
|
607
|
-
/**
|
|
608
|
-
* The name of the file.
|
|
609
|
-
*/
|
|
610
|
-
fileName: string;
|
|
611
|
-
/**
|
|
612
|
-
* The MIME type of the file.
|
|
613
|
-
*/
|
|
614
|
-
fileMimeType: string;
|
|
615
|
-
/**
|
|
616
|
-
* The size of the file in bytes.
|
|
617
|
-
*/
|
|
618
|
-
fileSizeInBytes: number;
|
|
619
|
-
/**
|
|
620
|
-
* The list of markers for the item.
|
|
621
|
-
*/
|
|
622
|
-
markers: string[];
|
|
623
|
-
}
|
|
624
|
-
export interface ListedEventItem {
|
|
625
|
-
/**
|
|
626
|
-
* The name of the event.
|
|
627
|
-
*/
|
|
628
|
-
eventName: string;
|
|
629
|
-
/**
|
|
630
|
-
* The list of markers for the item.
|
|
631
|
-
*/
|
|
632
|
-
markers: string[];
|
|
633
|
-
}
|
|
634
|
-
export interface ListedInstItem {
|
|
635
|
-
/**
|
|
636
|
-
* The name of the inst.
|
|
637
|
-
*/
|
|
638
|
-
inst: string;
|
|
639
|
-
/**
|
|
640
|
-
* The markers that are applied to the inst.
|
|
641
|
-
*/
|
|
642
|
-
markers: string[];
|
|
643
|
-
}
|
|
644
|
-
export type AuthorizeResult = AuthorizeAllowed | AuthorizeDenied;
|
|
645
|
-
export interface AuthorizeAllowed {
|
|
646
|
-
allowed: true;
|
|
647
|
-
/**
|
|
648
|
-
* The name of the record that the request should be for.
|
|
649
|
-
*/
|
|
650
|
-
recordName: string;
|
|
651
|
-
/**
|
|
652
|
-
* The ID of the owner of the record key.
|
|
653
|
-
* Null if no record key was provided.
|
|
654
|
-
*/
|
|
655
|
-
recordKeyOwnerId: string | null;
|
|
656
|
-
/**
|
|
657
|
-
* The ID of the user who (directly or indirectly) authorized the request.
|
|
658
|
-
* If a valid record key was provided, then this is the ID of the owner of the record key.
|
|
659
|
-
* If only a user ID was provided, then this is the ID of the user who is logged in.
|
|
660
|
-
* If no one was logged in, then this is null.
|
|
661
|
-
*/
|
|
662
|
-
authorizerId: string | null;
|
|
663
|
-
/**
|
|
664
|
-
* The authorization information about the subject.
|
|
665
|
-
*/
|
|
666
|
-
subject: SubjectAuthorization;
|
|
667
|
-
/**
|
|
668
|
-
* The authorization information about the instances.
|
|
669
|
-
*/
|
|
670
|
-
instances: InstEnvironmentAuthorization[];
|
|
671
|
-
/**
|
|
672
|
-
* The list of allowed data items.
|
|
673
|
-
*/
|
|
674
|
-
allowedDataItems?: ListedDataItem[];
|
|
675
|
-
/**
|
|
676
|
-
* The list of allowed file items.
|
|
677
|
-
*/
|
|
678
|
-
allowedFileItems?: ListedFileItem[];
|
|
679
|
-
/**
|
|
680
|
-
* The list of allowed event items.
|
|
681
|
-
*/
|
|
682
|
-
allowedEventItems?: ListedEventItem[];
|
|
683
|
-
/**
|
|
684
|
-
* The list of allowed inst items.
|
|
685
|
-
*/
|
|
686
|
-
allowedInstItems?: ListedInstItem[];
|
|
687
|
-
}
|
|
688
|
-
export type GenericResult = GenericAllowed | GenericDenied;
|
|
689
|
-
export interface GenericAllowed {
|
|
690
|
-
success: true;
|
|
691
|
-
authorization: GenericAuthorization;
|
|
692
|
-
}
|
|
693
|
-
export interface GenericDenied {
|
|
694
|
-
success: false;
|
|
695
|
-
reason: DenialReason;
|
|
696
|
-
}
|
|
697
|
-
export interface GenericAuthorization {
|
|
698
|
-
/**
|
|
699
|
-
* The role that was selected for authorization.
|
|
700
|
-
*
|
|
701
|
-
* If true, then that indicates that the "everyone" role was used.
|
|
702
|
-
* If a string, then that is the name of the role that was used.
|
|
703
|
-
*/
|
|
704
|
-
role: string | true;
|
|
705
|
-
/**
|
|
706
|
-
* The security markers that were evaluated.
|
|
707
|
-
*/
|
|
708
|
-
markers: MarkerAuthorization[];
|
|
709
|
-
}
|
|
710
|
-
/**
|
|
711
|
-
* Defines an interface that contains authorization information aboutthe subject that is party to an action.
|
|
712
|
-
*
|
|
713
|
-
* Generally, this includes information about the user and if they have the correct permissions for the action.
|
|
714
|
-
*/
|
|
715
|
-
export interface SubjectAuthorization extends GenericAuthorization {
|
|
716
|
-
/**
|
|
717
|
-
* The ID of the user that was authorized.
|
|
718
|
-
* Null if no user ID was provided.
|
|
719
|
-
*/
|
|
720
|
-
userId: string | null;
|
|
721
|
-
/**
|
|
722
|
-
* the policy that should be used for storage of subject information.
|
|
723
|
-
*/
|
|
724
|
-
subjectPolicy: PublicRecordKeyPolicy;
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Defines an interface that represents the result of calculating whether a particular action is authorized for a particular marker.
|
|
728
|
-
*/
|
|
729
|
-
export interface MarkerAuthorization {
|
|
730
206
|
/**
|
|
731
|
-
* The
|
|
207
|
+
* The ID of the user who created the record key.
|
|
732
208
|
*/
|
|
733
|
-
|
|
209
|
+
recordKeyCreatorId: string;
|
|
734
210
|
/**
|
|
735
|
-
* The
|
|
211
|
+
* The privacy features of the user that owns the record.
|
|
736
212
|
*/
|
|
737
|
-
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Defines an interface that represents the result of calculating the policy and permission that grants a particular action.
|
|
741
|
-
*/
|
|
742
|
-
export interface ActionAuthorization {
|
|
743
|
-
/**
|
|
744
|
-
* The action that was granted.
|
|
745
|
-
*/
|
|
746
|
-
action: AvailablePermissions['type'];
|
|
747
|
-
/**
|
|
748
|
-
* The policy document that authorizes the action.
|
|
749
|
-
*/
|
|
750
|
-
grantingPolicy: PolicyDocument;
|
|
751
|
-
/**
|
|
752
|
-
* The permission that authorizes the action to be performed.
|
|
753
|
-
*/
|
|
754
|
-
grantingPermission: AvailablePermissions;
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* Defines an interface that contains authorization information about the environment that is party to an action.
|
|
758
|
-
*
|
|
759
|
-
* Generally, this includes information about the inst that is triggering the operation.
|
|
760
|
-
*/
|
|
761
|
-
export type InstEnvironmentAuthorization = AuthorizedInst | NotRequiredInst;
|
|
762
|
-
export interface AuthorizedInst extends GenericAuthorization {
|
|
213
|
+
recordOwnerPrivacyFeatures: PrivacyFeatures;
|
|
763
214
|
/**
|
|
764
|
-
* The
|
|
215
|
+
* The privacy features of the user that is currently logged in.
|
|
765
216
|
*/
|
|
766
|
-
|
|
217
|
+
userPrivacyFeatures: PrivacyFeatures;
|
|
767
218
|
/**
|
|
768
|
-
* The
|
|
769
|
-
*/
|
|
770
|
-
inst: string;
|
|
771
|
-
}
|
|
772
|
-
export interface NotRequiredInst {
|
|
773
|
-
/**
|
|
774
|
-
* The inst that was authorized.
|
|
219
|
+
* The ID of the user that is currently logged in.
|
|
775
220
|
*/
|
|
776
|
-
|
|
221
|
+
userId: string;
|
|
222
|
+
}
|
|
223
|
+
export interface ConstructAuthorizationContextRequest {
|
|
777
224
|
/**
|
|
778
|
-
* The
|
|
225
|
+
* The record key that should be used or the name of the record that the request is being authorized for.
|
|
779
226
|
*/
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
export interface AuthorizeDenied {
|
|
783
|
-
allowed: false;
|
|
784
|
-
errorCode: ServerError | ValidatePublicRecordKeyFailure['errorCode'] | 'action_not_supported' | 'not_logged_in' | 'not_authorized' | SubscriptionLimitReached | 'unacceptable_request';
|
|
785
|
-
errorMessage: string;
|
|
227
|
+
recordKeyOrRecordName: string;
|
|
786
228
|
/**
|
|
787
|
-
* The
|
|
229
|
+
* The ID of the user that is currently logged in.
|
|
788
230
|
*/
|
|
789
|
-
|
|
231
|
+
userId?: string | null;
|
|
790
232
|
}
|
|
791
233
|
export interface GrantMarkerPermissionRequest {
|
|
792
234
|
recordKeyOrRecordName: string;
|
|
@@ -796,7 +238,7 @@ export interface GrantMarkerPermissionRequest {
|
|
|
796
238
|
instances?: string[] | null;
|
|
797
239
|
}
|
|
798
240
|
/**
|
|
799
|
-
* Defines the possible results of
|
|
241
|
+
* Defines the possible results of granting a permission to a marker.
|
|
800
242
|
*
|
|
801
243
|
* @dochash types/records/policies
|
|
802
244
|
* @doctitle Policy Types
|
|
@@ -831,21 +273,19 @@ export interface GrantMarkerPermissionFailure {
|
|
|
831
273
|
/**
|
|
832
274
|
* The error code that indicates why the request failed.
|
|
833
275
|
*/
|
|
834
|
-
errorCode: ServerError |
|
|
276
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'] | AssignPermissionToSubjectAndMarkerFailure['errorCode'];
|
|
835
277
|
/**
|
|
836
278
|
* The error message that indicates why the request failed.
|
|
837
279
|
*/
|
|
838
280
|
errorMessage: string;
|
|
839
281
|
}
|
|
840
282
|
export interface RevokeMarkerPermissionRequest {
|
|
841
|
-
|
|
283
|
+
permissionId: string;
|
|
842
284
|
userId: string;
|
|
843
|
-
marker: string;
|
|
844
|
-
permission: AvailablePermissions;
|
|
845
285
|
instances?: string[] | null;
|
|
846
286
|
}
|
|
847
287
|
/**
|
|
848
|
-
* Defines the possible results of revoking a
|
|
288
|
+
* Defines the possible results of revoking a permission from a marker.
|
|
849
289
|
*
|
|
850
290
|
* @dochash types/records/policies
|
|
851
291
|
* @docgroup 02-revoke
|
|
@@ -854,7 +294,7 @@ export interface RevokeMarkerPermissionRequest {
|
|
|
854
294
|
*/
|
|
855
295
|
export type RevokeMarkerPermissionResult = RevokeMarkerPermissionSuccess | RevokeMarkerPermissionFailure;
|
|
856
296
|
/**
|
|
857
|
-
* Defines an interface that represents a successful request to revoke a
|
|
297
|
+
* Defines an interface that represents a successful request to revoke a permission from a marker.
|
|
858
298
|
*
|
|
859
299
|
* @dochash types/records/policies
|
|
860
300
|
* @docgroup 02-revoke
|
|
@@ -865,7 +305,7 @@ export interface RevokeMarkerPermissionSuccess {
|
|
|
865
305
|
success: true;
|
|
866
306
|
}
|
|
867
307
|
/**
|
|
868
|
-
* Defines an interface that represents a failed request to revoke a
|
|
308
|
+
* Defines an interface that represents a failed request to revoke a permission from a marker.
|
|
869
309
|
*
|
|
870
310
|
* @dochash types/records/policies
|
|
871
311
|
* @docgroup 02-revoke
|
|
@@ -877,32 +317,141 @@ export interface RevokeMarkerPermissionFailure {
|
|
|
877
317
|
/**
|
|
878
318
|
* The error code that indicates why the request failed.
|
|
879
319
|
*/
|
|
880
|
-
errorCode: ServerError |
|
|
320
|
+
errorCode: ServerError | 'permission_not_found' | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
881
321
|
/**
|
|
882
322
|
* The error message that indicates why the request failed.
|
|
883
323
|
*/
|
|
884
324
|
errorMessage: string;
|
|
885
325
|
}
|
|
886
|
-
export
|
|
887
|
-
|
|
326
|
+
export interface GrantResourcePermissionRequest {
|
|
327
|
+
recordKeyOrRecordName: string;
|
|
328
|
+
userId: string;
|
|
329
|
+
permission: AvailablePermissions;
|
|
330
|
+
instances?: string[] | null;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Defines the possible results of granting a permission to a resource.
|
|
334
|
+
*
|
|
335
|
+
* @dochash types/records/policies
|
|
336
|
+
* @docname GrantResourcePermissionResult
|
|
337
|
+
*/
|
|
338
|
+
export type GrantResourcePermissionResult = GrantResourcePermissionSuccess | GrantResourcePermissionFailure;
|
|
339
|
+
/**
|
|
340
|
+
* Defines an interface that represents a successful request to grant a permission to a resource.
|
|
341
|
+
*
|
|
342
|
+
* @dochash types/records/policies
|
|
343
|
+
* @docgroup 01-grant
|
|
344
|
+
* @docorder 1
|
|
345
|
+
* @docname GrantResourcePermissionSuccess
|
|
346
|
+
*/
|
|
347
|
+
export interface GrantResourcePermissionSuccess {
|
|
348
|
+
success: true;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Defines an interface that represents a failed request to grant a permission to a resource.
|
|
352
|
+
*
|
|
353
|
+
* @dochash types/records/policies
|
|
354
|
+
* @docgroup 01-grant
|
|
355
|
+
* @docorder 2
|
|
356
|
+
* @docname GrantResourcePermissionFailure
|
|
357
|
+
*/
|
|
358
|
+
export interface GrantResourcePermissionFailure {
|
|
359
|
+
success: false;
|
|
360
|
+
/**
|
|
361
|
+
* The error code that indicates why the request failed.
|
|
362
|
+
*/
|
|
363
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'] | AssignPermissionToSubjectAndMarkerFailure['errorCode'];
|
|
364
|
+
/**
|
|
365
|
+
* The error message that indicates why the request failed.
|
|
366
|
+
*/
|
|
367
|
+
errorMessage: string;
|
|
368
|
+
}
|
|
369
|
+
export interface RevokeResourcePermissionRequest {
|
|
370
|
+
permissionId: string;
|
|
371
|
+
userId: string;
|
|
372
|
+
instances?: string[] | null;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Defines the possible results of revoking a resource permission.
|
|
376
|
+
*
|
|
377
|
+
* @dochash types/records/policies
|
|
378
|
+
* @docgroup 02-revoke
|
|
379
|
+
* @docorder 0
|
|
380
|
+
* @docname RevokeResourcePermissionResult
|
|
381
|
+
*/
|
|
382
|
+
export type RevokeResourcePermissionResult = RevokeResourcePermissionSuccess | RevokeResourcePermissionFailure;
|
|
383
|
+
/**
|
|
384
|
+
* Defines an interface that represents a successful request to revoke a permission from a resource.
|
|
385
|
+
*
|
|
386
|
+
* @dochash types/records/policies
|
|
387
|
+
* @docgroup 02-revoke
|
|
388
|
+
* @docorder 1
|
|
389
|
+
* @docname RevokeResourcePermissionSuccess
|
|
390
|
+
*/
|
|
391
|
+
export interface RevokeResourcePermissionSuccess {
|
|
888
392
|
success: true;
|
|
889
|
-
document: PolicyDocument;
|
|
890
|
-
markers: string[];
|
|
891
393
|
}
|
|
892
|
-
|
|
394
|
+
/**
|
|
395
|
+
* Defines an interface that represents a failed request to revoke a permission from a resource.
|
|
396
|
+
*
|
|
397
|
+
* @dochash types/records/policies
|
|
398
|
+
* @docgroup 02-revoke
|
|
399
|
+
* @docorder 2
|
|
400
|
+
* @docname RevokeResourcePermissionFailure
|
|
401
|
+
*/
|
|
402
|
+
export interface RevokeResourcePermissionFailure {
|
|
893
403
|
success: false;
|
|
894
|
-
|
|
404
|
+
/**
|
|
405
|
+
* The error code that indicates why the request failed.
|
|
406
|
+
*/
|
|
407
|
+
errorCode: ServerError | 'permission_not_found' | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
408
|
+
/**
|
|
409
|
+
* The error message that indicates why the request failed.
|
|
410
|
+
*/
|
|
895
411
|
errorMessage: string;
|
|
896
412
|
}
|
|
897
|
-
export
|
|
898
|
-
|
|
413
|
+
export interface RevokePermissionRequest {
|
|
414
|
+
permissionId: string;
|
|
415
|
+
userId: string;
|
|
416
|
+
instances?: string[] | null;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Defines the possible results of revoking a permission.
|
|
420
|
+
*
|
|
421
|
+
* @dochash types/records/policies
|
|
422
|
+
* @docgroup 02-revoke
|
|
423
|
+
* @docorder 0
|
|
424
|
+
* @docname RevokeMarkerPermissionResult
|
|
425
|
+
*/
|
|
426
|
+
export type RevokePermissionResult = RevokePermissionSuccess | RevokePermissionFailure;
|
|
427
|
+
/**
|
|
428
|
+
* Defines an interface that represents a successful request to revoke a permission.
|
|
429
|
+
*
|
|
430
|
+
* @dochash types/records/policies
|
|
431
|
+
* @docgroup 02-revoke
|
|
432
|
+
* @docorder 1
|
|
433
|
+
* @docname RevokePermissionSuccess
|
|
434
|
+
*/
|
|
435
|
+
export interface RevokePermissionSuccess {
|
|
899
436
|
success: true;
|
|
900
|
-
policies: ListedUserPolicy[];
|
|
901
|
-
totalCount: number;
|
|
902
437
|
}
|
|
903
|
-
|
|
438
|
+
/**
|
|
439
|
+
* Defines an interface that represents a failed request to revoke a permission.
|
|
440
|
+
*
|
|
441
|
+
* @dochash types/records/policies
|
|
442
|
+
* @docgroup 02-revoke
|
|
443
|
+
* @docorder 2
|
|
444
|
+
* @docname RevokePermissionFailure
|
|
445
|
+
*/
|
|
446
|
+
export interface RevokePermissionFailure {
|
|
904
447
|
success: false;
|
|
905
|
-
|
|
448
|
+
/**
|
|
449
|
+
* The error code that indicates why the request failed.
|
|
450
|
+
*/
|
|
451
|
+
errorCode: ServerError | 'permission_not_found' | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
452
|
+
/**
|
|
453
|
+
* The error message that indicates why the request failed.
|
|
454
|
+
*/
|
|
906
455
|
errorMessage: string;
|
|
907
456
|
}
|
|
908
457
|
export type ListAssignedUserRolesResult = ListAssignedUserRolesSuccess | ListAssignedUserRolesFailure;
|
|
@@ -915,7 +464,7 @@ export interface ListAssignedUserRolesSuccess {
|
|
|
915
464
|
}
|
|
916
465
|
export interface ListAssignedUserRolesFailure {
|
|
917
466
|
success: false;
|
|
918
|
-
errorCode: ServerError |
|
|
467
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
919
468
|
errorMessage: string;
|
|
920
469
|
}
|
|
921
470
|
export type ListAssignedInstRolesResult = ListAssignedInstRolesSuccess | ListAssignedInstRolesFailure;
|
|
@@ -928,7 +477,7 @@ export interface ListAssignedInstRolesSuccess {
|
|
|
928
477
|
}
|
|
929
478
|
export interface ListAssignedInstRolesFailure {
|
|
930
479
|
success: false;
|
|
931
|
-
errorCode: ServerError |
|
|
480
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
932
481
|
errorMessage: string;
|
|
933
482
|
}
|
|
934
483
|
export type ListRoleAssignmentsResult = ListRoleAssignmentsSuccess | ListRoleAssignmentsFailure;
|
|
@@ -945,7 +494,7 @@ export interface ListRoleAssignmentsSuccess {
|
|
|
945
494
|
}
|
|
946
495
|
export interface ListRoleAssignmentsFailure {
|
|
947
496
|
success: false;
|
|
948
|
-
errorCode: ServerError | NotSupportedError |
|
|
497
|
+
errorCode: ServerError | NotSupportedError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
949
498
|
errorMessage: string;
|
|
950
499
|
}
|
|
951
500
|
export interface GrantRoleRequest {
|
|
@@ -990,7 +539,7 @@ export interface GrantRoleFailure {
|
|
|
990
539
|
/**
|
|
991
540
|
* The error code that indicates why the request failed.
|
|
992
541
|
*/
|
|
993
|
-
errorCode: ServerError |
|
|
542
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'] | UpdateUserRolesFailure['errorCode'];
|
|
994
543
|
/**
|
|
995
544
|
* The error message that indicates why the request failed.
|
|
996
545
|
*/
|
|
@@ -1034,11 +583,297 @@ export interface RevokeRoleFailure {
|
|
|
1034
583
|
/**
|
|
1035
584
|
* The error code that indicates why the request failed.
|
|
1036
585
|
*/
|
|
1037
|
-
errorCode: ServerError |
|
|
586
|
+
errorCode: ServerError | ConstructAuthorizationContextFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'] | UpdateUserRolesFailure['errorCode'];
|
|
1038
587
|
/**
|
|
1039
588
|
* The error message that indicates why the request failed.
|
|
1040
589
|
*/
|
|
1041
590
|
errorMessage: string;
|
|
1042
591
|
}
|
|
1043
|
-
export {
|
|
592
|
+
export interface ResourceInfo {
|
|
593
|
+
/**
|
|
594
|
+
* The kind of the resource.
|
|
595
|
+
*/
|
|
596
|
+
resourceKind: ResourceKinds;
|
|
597
|
+
/**
|
|
598
|
+
* The ID of the resource.
|
|
599
|
+
*/
|
|
600
|
+
resourceId: string;
|
|
601
|
+
/**
|
|
602
|
+
* The kind of the action.
|
|
603
|
+
*/
|
|
604
|
+
action: ActionKinds;
|
|
605
|
+
/**
|
|
606
|
+
* The markers that are applied to the resource.
|
|
607
|
+
*/
|
|
608
|
+
markers: string[];
|
|
609
|
+
}
|
|
610
|
+
export interface AuthorizeSubject {
|
|
611
|
+
/**
|
|
612
|
+
* The type of the subject that should be authorized.
|
|
613
|
+
*/
|
|
614
|
+
subjectType: SubjectType;
|
|
615
|
+
/**
|
|
616
|
+
* The ID of the subject that should be authorized.
|
|
617
|
+
*/
|
|
618
|
+
subjectId: string | null;
|
|
619
|
+
}
|
|
620
|
+
export interface AuthorizeUserAndInstancesRequest {
|
|
621
|
+
/**
|
|
622
|
+
* The ID of the user that should be authorized.
|
|
623
|
+
*/
|
|
624
|
+
userId: string;
|
|
625
|
+
/**
|
|
626
|
+
* The instances that should be authorized.
|
|
627
|
+
*/
|
|
628
|
+
instances: string[];
|
|
629
|
+
/**
|
|
630
|
+
* The kind of resource that the action is being performed on.
|
|
631
|
+
*/
|
|
632
|
+
resourceKind: ResourceKinds;
|
|
633
|
+
/**
|
|
634
|
+
* The kind of the action.
|
|
635
|
+
*/
|
|
636
|
+
action: ActionKinds;
|
|
637
|
+
/**
|
|
638
|
+
* The ID of the resource.
|
|
639
|
+
* Should be omitted if the action is "list".
|
|
640
|
+
*/
|
|
641
|
+
resourceId?: string;
|
|
642
|
+
/**
|
|
643
|
+
* The markers that are applied to the resource.
|
|
644
|
+
*/
|
|
645
|
+
markers: string[];
|
|
646
|
+
}
|
|
647
|
+
export type AuthorizeUserAndInstancesResult = AuthorizeUserAndInstancesSuccess | AuthorizeSubjectFailure;
|
|
648
|
+
export interface AuthorizeUserAndInstancesSuccess {
|
|
649
|
+
success: true;
|
|
650
|
+
recordName: string;
|
|
651
|
+
/**
|
|
652
|
+
* The permission that authorizes the user to perform the request.
|
|
653
|
+
*/
|
|
654
|
+
user: AuthorizedSubject;
|
|
655
|
+
/**
|
|
656
|
+
* The results for each subject.
|
|
657
|
+
*/
|
|
658
|
+
results: AuthorizedSubject[];
|
|
659
|
+
}
|
|
660
|
+
export interface AuthorizeUserAndInstancesForResources {
|
|
661
|
+
/**
|
|
662
|
+
* The ID of the user that should be authorized.
|
|
663
|
+
*/
|
|
664
|
+
userId: string;
|
|
665
|
+
/**
|
|
666
|
+
* The instances that should be authorized.
|
|
667
|
+
*/
|
|
668
|
+
instances: string[];
|
|
669
|
+
/**
|
|
670
|
+
* The resources that should be authorized.
|
|
671
|
+
*/
|
|
672
|
+
resources: ResourceInfo[];
|
|
673
|
+
}
|
|
674
|
+
export type AuthorizeUserAndInstancesForResourcesResult = AuthorizeUserAndInstancesForResourcesSuccess | AuthorizeSubjectFailure;
|
|
675
|
+
export interface AuthorizeUserAndInstancesForResourcesSuccess {
|
|
676
|
+
success: true;
|
|
677
|
+
recordName: string;
|
|
678
|
+
results: AuthorizedResource[];
|
|
679
|
+
}
|
|
680
|
+
export interface AuthorizedResource extends ResourceInfo, AuthorizeUserAndInstancesSuccess {
|
|
681
|
+
}
|
|
682
|
+
export interface AuthorizeSubjectsRequest {
|
|
683
|
+
/**
|
|
684
|
+
* The list of subjects that should be authorized.
|
|
685
|
+
*/
|
|
686
|
+
subjects: AuthorizeSubject[];
|
|
687
|
+
/**
|
|
688
|
+
* The kind of resource that the action is being performed on.
|
|
689
|
+
*/
|
|
690
|
+
resourceKind: ResourceKinds;
|
|
691
|
+
/**
|
|
692
|
+
* The kind of the action.
|
|
693
|
+
*/
|
|
694
|
+
action: ActionKinds;
|
|
695
|
+
/**
|
|
696
|
+
* The ID of the resource.
|
|
697
|
+
* Should be omitted if the action is "list".
|
|
698
|
+
*/
|
|
699
|
+
resourceId?: string;
|
|
700
|
+
/**
|
|
701
|
+
* The markers that are applied to the resource.
|
|
702
|
+
*/
|
|
703
|
+
markers: string[];
|
|
704
|
+
}
|
|
705
|
+
export interface AuthorizeSubjectRequest {
|
|
706
|
+
/**
|
|
707
|
+
* The type of the subject that should be authorized.
|
|
708
|
+
*/
|
|
709
|
+
subjectType: SubjectType;
|
|
710
|
+
/**
|
|
711
|
+
* The ID of the subject that should be authorized.
|
|
712
|
+
*/
|
|
713
|
+
subjectId: string | null;
|
|
714
|
+
/**
|
|
715
|
+
* The kind of resource that the action is being performed on.
|
|
716
|
+
*/
|
|
717
|
+
resourceKind: ResourceKinds;
|
|
718
|
+
/**
|
|
719
|
+
* The kind of the action.
|
|
720
|
+
*/
|
|
721
|
+
action: ActionKinds;
|
|
722
|
+
/**
|
|
723
|
+
* The ID of the resource.
|
|
724
|
+
* Should be omitted if the action is "list".
|
|
725
|
+
*/
|
|
726
|
+
resourceId?: string;
|
|
727
|
+
/**
|
|
728
|
+
* The markers that are applied to the resource.
|
|
729
|
+
*/
|
|
730
|
+
markers: string[];
|
|
731
|
+
}
|
|
732
|
+
export type AuthorizeSubjectsResult = AuthorizeSubjectsSuccess | AuthorizeSubjectFailure;
|
|
733
|
+
export interface AuthorizeSubjectsSuccess {
|
|
734
|
+
success: true;
|
|
735
|
+
recordName: string;
|
|
736
|
+
/**
|
|
737
|
+
* The results for each subject.
|
|
738
|
+
*/
|
|
739
|
+
results: AuthorizedSubject[];
|
|
740
|
+
}
|
|
741
|
+
export type AuthorizeSubjectResult = AuthorizeSubjectSuccess | AuthorizeSubjectFailure;
|
|
742
|
+
export interface AuthorizeSubjectSuccess {
|
|
743
|
+
success: true;
|
|
744
|
+
/**
|
|
745
|
+
* The name of the record that the action should be for.
|
|
746
|
+
*/
|
|
747
|
+
recordName: string;
|
|
748
|
+
/**
|
|
749
|
+
* The permission that authorizes the request.
|
|
750
|
+
*/
|
|
751
|
+
permission: MarkerPermissionAssignment | ResourcePermissionAssignment;
|
|
752
|
+
/**
|
|
753
|
+
* The explaination for the authorization.
|
|
754
|
+
*/
|
|
755
|
+
explanation: string;
|
|
756
|
+
}
|
|
757
|
+
export interface AuthorizedSubject extends AuthorizeSubjectSuccess {
|
|
758
|
+
/**
|
|
759
|
+
* The type of the subject that was authorized.
|
|
760
|
+
*/
|
|
761
|
+
subjectType: SubjectType;
|
|
762
|
+
/**
|
|
763
|
+
* The ID of the subject that was authorized.
|
|
764
|
+
*/
|
|
765
|
+
subjectId: string;
|
|
766
|
+
}
|
|
767
|
+
export interface AuthorizeSubjectFailure {
|
|
768
|
+
success: false;
|
|
769
|
+
/**
|
|
770
|
+
* The error code that occurred.
|
|
771
|
+
*/
|
|
772
|
+
errorCode: ServerError | ValidatePublicRecordKeyFailure['errorCode'] | 'action_not_supported' | 'not_logged_in' | 'not_authorized' | SubscriptionLimitReached | 'unacceptable_request';
|
|
773
|
+
/**
|
|
774
|
+
* The error message that occurred.
|
|
775
|
+
*/
|
|
776
|
+
errorMessage: string;
|
|
777
|
+
/**
|
|
778
|
+
* The denial reason.
|
|
779
|
+
*/
|
|
780
|
+
reason?: DenialReason;
|
|
781
|
+
}
|
|
782
|
+
export type ListPermissionsResult = ListPermissionsSuccess | ListPermissionsFailure;
|
|
783
|
+
export interface ListPermissionsSuccess {
|
|
784
|
+
success: true;
|
|
785
|
+
recordName: string;
|
|
786
|
+
resourcePermissions: ListedResourcePermission[];
|
|
787
|
+
markerPermissions: ListedMarkerPermission[];
|
|
788
|
+
}
|
|
789
|
+
export interface ListPermissionsFailure {
|
|
790
|
+
success: false;
|
|
791
|
+
errorCode: ServerError | ValidatePublicRecordKeyFailure['errorCode'] | AuthorizeSubjectFailure['errorCode'];
|
|
792
|
+
errorMessage: string;
|
|
793
|
+
}
|
|
794
|
+
export type ListPermissionsForMarkerResult = ListPermissionsForMarkerSuccess | ListPermissionsFailure;
|
|
795
|
+
export interface ListPermissionsForMarkerSuccess {
|
|
796
|
+
success: true;
|
|
797
|
+
recordName: string;
|
|
798
|
+
markerPermissions: ListedMarkerPermission[];
|
|
799
|
+
}
|
|
800
|
+
export type ListPermissionsForResourceResult = ListPermissionsForResourceSuccess | ListPermissionsFailure;
|
|
801
|
+
export interface ListPermissionsForResourceSuccess {
|
|
802
|
+
success: true;
|
|
803
|
+
recordName: string;
|
|
804
|
+
resourcePermissions: ListedResourcePermission[];
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Defines an interface that represents a permission that grants access.
|
|
808
|
+
*/
|
|
809
|
+
export interface ListedPermission {
|
|
810
|
+
/**
|
|
811
|
+
* The ID of the permission.
|
|
812
|
+
*/
|
|
813
|
+
id: string;
|
|
814
|
+
/**
|
|
815
|
+
* The name of the record.
|
|
816
|
+
*/
|
|
817
|
+
recordName: string;
|
|
818
|
+
/**
|
|
819
|
+
* The kind of the actions that the subject is allowed to perform.
|
|
820
|
+
* Null if the subject is allowed to perform any action.
|
|
821
|
+
*/
|
|
822
|
+
action: ActionKinds | null;
|
|
823
|
+
/**
|
|
824
|
+
* The options for the permission assignment.
|
|
825
|
+
*/
|
|
826
|
+
options: PermissionOptions;
|
|
827
|
+
/**
|
|
828
|
+
* The ID of the subject.
|
|
829
|
+
*/
|
|
830
|
+
subjectId: string;
|
|
831
|
+
/**
|
|
832
|
+
* The type of the subject.
|
|
833
|
+
*/
|
|
834
|
+
subjectType: SubjectType;
|
|
835
|
+
/**
|
|
836
|
+
* The ID of the user that the assignment grants permission to.
|
|
837
|
+
* Null if the subject type is not "user".
|
|
838
|
+
*/
|
|
839
|
+
userId: string | null;
|
|
840
|
+
/**
|
|
841
|
+
* The time that the permission expires.
|
|
842
|
+
* Null if the permission never expires.
|
|
843
|
+
*/
|
|
844
|
+
expireTimeMs: number | null;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Defines an interface that represents a permission that grants access to a single resource.
|
|
848
|
+
*
|
|
849
|
+
* @dochash types/permissions
|
|
850
|
+
* @docname ResourcePermission
|
|
851
|
+
*/
|
|
852
|
+
export interface ListedResourcePermission extends ListedPermission {
|
|
853
|
+
/**
|
|
854
|
+
* The kind of the resource.
|
|
855
|
+
*/
|
|
856
|
+
resourceKind: ResourceKinds;
|
|
857
|
+
/**
|
|
858
|
+
* The ID of the resource.
|
|
859
|
+
*/
|
|
860
|
+
resourceId: string;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Defines an interface that represents a permission that grants access to resources with a marker.
|
|
864
|
+
*
|
|
865
|
+
* @dochash types/permissions
|
|
866
|
+
* @docname MarkerPermission
|
|
867
|
+
*/
|
|
868
|
+
export interface ListedMarkerPermission extends ListedPermission {
|
|
869
|
+
/**
|
|
870
|
+
* The marker that the permission applies to.
|
|
871
|
+
*/
|
|
872
|
+
marker: string;
|
|
873
|
+
/**
|
|
874
|
+
* The kind of the resource.
|
|
875
|
+
* Null if the permission applies to all resources.
|
|
876
|
+
*/
|
|
877
|
+
resourceKind: ResourceKinds | null;
|
|
878
|
+
}
|
|
1044
879
|
//# sourceMappingURL=PolicyController.d.ts.map
|