@tapis/tapis-typescript-sk 0.0.2
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/.openapi-generator/FILES +67 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +45 -0
- package/dist/apis/GeneralApi.d.ts +45 -0
- package/dist/apis/GeneralApi.js +199 -0
- package/dist/apis/RoleApi.d.ts +205 -0
- package/dist/apis/RoleApi.js +861 -0
- package/dist/apis/UserApi.d.ts +276 -0
- package/dist/apis/UserApi.js +1166 -0
- package/dist/apis/VaultApi.d.ts +195 -0
- package/dist/apis/VaultApi.js +740 -0
- package/dist/apis/index.d.ts +4 -0
- package/dist/apis/index.js +11 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -0
- package/dist/models/Options.d.ts +27 -0
- package/dist/models/Options.js +41 -0
- package/dist/models/ReqAddChildRole.d.ts +39 -0
- package/dist/models/ReqAddChildRole.js +45 -0
- package/dist/models/ReqAddRolePermission.d.ts +39 -0
- package/dist/models/ReqAddRolePermission.js +45 -0
- package/dist/models/ReqCreateRole.d.ts +39 -0
- package/dist/models/ReqCreateRole.js +45 -0
- package/dist/models/ReqGrantAdminRole.d.ts +33 -0
- package/dist/models/ReqGrantAdminRole.js +43 -0
- package/dist/models/ReqGrantUserPermission.d.ts +39 -0
- package/dist/models/ReqGrantUserPermission.js +45 -0
- package/dist/models/ReqGrantUserRole.d.ts +39 -0
- package/dist/models/ReqGrantUserRole.js +45 -0
- package/dist/models/ReqGrantUserRoleWithPermission.d.ts +45 -0
- package/dist/models/ReqGrantUserRoleWithPermission.js +47 -0
- package/dist/models/ReqPreviewPathPrefix.d.ts +63 -0
- package/dist/models/ReqPreviewPathPrefix.js +53 -0
- package/dist/models/ReqRemoveChildRole.d.ts +39 -0
- package/dist/models/ReqRemoveChildRole.js +45 -0
- package/dist/models/ReqRemoveRolePermission.d.ts +39 -0
- package/dist/models/ReqRemoveRolePermission.js +45 -0
- package/dist/models/ReqReplacePathPrefix.d.ts +63 -0
- package/dist/models/ReqReplacePathPrefix.js +53 -0
- package/dist/models/ReqRevokeAdminRole.d.ts +33 -0
- package/dist/models/ReqRevokeAdminRole.js +43 -0
- package/dist/models/ReqRevokeUserPermission.d.ts +39 -0
- package/dist/models/ReqRevokeUserPermission.js +45 -0
- package/dist/models/ReqRevokeUserRole.d.ts +39 -0
- package/dist/models/ReqRevokeUserRole.js +45 -0
- package/dist/models/ReqUpdateRoleDescription.d.ts +33 -0
- package/dist/models/ReqUpdateRoleDescription.js +43 -0
- package/dist/models/ReqUpdateRoleName.d.ts +33 -0
- package/dist/models/ReqUpdateRoleName.js +43 -0
- package/dist/models/ReqUpdateRoleOwner.d.ts +39 -0
- package/dist/models/ReqUpdateRoleOwner.js +45 -0
- package/dist/models/ReqUserHasRole.d.ts +45 -0
- package/dist/models/ReqUserHasRole.js +47 -0
- package/dist/models/ReqUserHasRoleMulti.d.ts +45 -0
- package/dist/models/ReqUserHasRoleMulti.js +47 -0
- package/dist/models/ReqUserIsAdmin.d.ts +33 -0
- package/dist/models/ReqUserIsAdmin.js +43 -0
- package/dist/models/ReqUserIsPermitted.d.ts +45 -0
- package/dist/models/ReqUserIsPermitted.js +47 -0
- package/dist/models/ReqUserIsPermittedMulti.d.ts +45 -0
- package/dist/models/ReqUserIsPermittedMulti.js +47 -0
- package/dist/models/ReqValidateServicePwd.d.ts +39 -0
- package/dist/models/ReqValidateServicePwd.js +45 -0
- package/dist/models/ReqVersions.d.ts +39 -0
- package/dist/models/ReqVersions.js +45 -0
- package/dist/models/ReqWriteSecret.d.ts +48 -0
- package/dist/models/ReqWriteSecret.js +48 -0
- package/dist/models/RespAuthorized.d.ts +46 -0
- package/dist/models/RespAuthorized.js +48 -0
- package/dist/models/RespBasic.d.ts +45 -0
- package/dist/models/RespBasic.js +47 -0
- package/dist/models/RespChangeCount.d.ts +46 -0
- package/dist/models/RespChangeCount.js +48 -0
- package/dist/models/RespName.d.ts +46 -0
- package/dist/models/RespName.js +48 -0
- package/dist/models/RespNameArray.d.ts +46 -0
- package/dist/models/RespNameArray.js +48 -0
- package/dist/models/RespPathPrefixes.d.ts +46 -0
- package/dist/models/RespPathPrefixes.js +48 -0
- package/dist/models/RespProbe.d.ts +46 -0
- package/dist/models/RespProbe.js +48 -0
- package/dist/models/RespResourceUrl.d.ts +46 -0
- package/dist/models/RespResourceUrl.js +48 -0
- package/dist/models/RespRole.d.ts +46 -0
- package/dist/models/RespRole.js +48 -0
- package/dist/models/RespSecret.d.ts +46 -0
- package/dist/models/RespSecret.js +48 -0
- package/dist/models/RespSecretList.d.ts +46 -0
- package/dist/models/RespSecretList.js +48 -0
- package/dist/models/RespSecretMeta.d.ts +46 -0
- package/dist/models/RespSecretMeta.js +48 -0
- package/dist/models/RespSecretVersionMetadata.d.ts +46 -0
- package/dist/models/RespSecretVersionMetadata.js +48 -0
- package/dist/models/RespVersions.d.ts +45 -0
- package/dist/models/RespVersions.js +47 -0
- package/dist/models/ResultAuthorized.d.ts +27 -0
- package/dist/models/ResultAuthorized.js +41 -0
- package/dist/models/ResultChangeCount.d.ts +27 -0
- package/dist/models/ResultChangeCount.js +41 -0
- package/dist/models/ResultName.d.ts +27 -0
- package/dist/models/ResultName.js +41 -0
- package/dist/models/ResultNameArray.d.ts +27 -0
- package/dist/models/ResultNameArray.js +41 -0
- package/dist/models/ResultResourceUrl.d.ts +27 -0
- package/dist/models/ResultResourceUrl.js +41 -0
- package/dist/models/SkProbe.d.ts +45 -0
- package/dist/models/SkProbe.js +47 -0
- package/dist/models/SkRole.d.ts +93 -0
- package/dist/models/SkRole.js +63 -0
- package/dist/models/SkSecret.d.ts +36 -0
- package/dist/models/SkSecret.js +44 -0
- package/dist/models/SkSecretList.d.ts +33 -0
- package/dist/models/SkSecretList.js +43 -0
- package/dist/models/SkSecretMetadata.d.ts +45 -0
- package/dist/models/SkSecretMetadata.js +47 -0
- package/dist/models/SkSecretVersion.d.ts +45 -0
- package/dist/models/SkSecretVersion.js +47 -0
- package/dist/models/SkSecretVersionMetadata.d.ts +58 -0
- package/dist/models/SkSecretVersionMetadata.js +52 -0
- package/dist/models/Transformation.d.ts +39 -0
- package/dist/models/Transformation.js +45 -0
- package/dist/models/index.d.ts +53 -0
- package/dist/models/index.js +60 -0
- package/dist/runtime.d.ts +140 -0
- package/dist/runtime.js +420 -0
- package/package.json +15 -0
- package/src/apis/GeneralApi.ts +117 -0
- package/src/apis/RoleApi.ts +782 -0
- package/src/apis/UserApi.ts +1047 -0
- package/src/apis/VaultApi.ts +802 -0
- package/src/apis/index.ts +6 -0
- package/src/index.ts +5 -0
- package/src/models/Options.ts +56 -0
- package/src/models/ReqAddChildRole.ts +72 -0
- package/src/models/ReqAddRolePermission.ts +72 -0
- package/src/models/ReqCreateRole.ts +72 -0
- package/src/models/ReqGrantAdminRole.ts +64 -0
- package/src/models/ReqGrantUserPermission.ts +72 -0
- package/src/models/ReqGrantUserRole.ts +72 -0
- package/src/models/ReqGrantUserRoleWithPermission.ts +80 -0
- package/src/models/ReqPreviewPathPrefix.ts +104 -0
- package/src/models/ReqRemoveChildRole.ts +72 -0
- package/src/models/ReqRemoveRolePermission.ts +72 -0
- package/src/models/ReqReplacePathPrefix.ts +104 -0
- package/src/models/ReqRevokeAdminRole.ts +64 -0
- package/src/models/ReqRevokeUserPermission.ts +72 -0
- package/src/models/ReqRevokeUserRole.ts +72 -0
- package/src/models/ReqUpdateRoleDescription.ts +64 -0
- package/src/models/ReqUpdateRoleName.ts +64 -0
- package/src/models/ReqUpdateRoleOwner.ts +72 -0
- package/src/models/ReqUserHasRole.ts +80 -0
- package/src/models/ReqUserHasRoleMulti.ts +80 -0
- package/src/models/ReqUserIsAdmin.ts +64 -0
- package/src/models/ReqUserIsPermitted.ts +80 -0
- package/src/models/ReqUserIsPermittedMulti.ts +80 -0
- package/src/models/ReqValidateServicePwd.ts +72 -0
- package/src/models/ReqVersions.ts +72 -0
- package/src/models/ReqWriteSecret.ts +87 -0
- package/src/models/RespAuthorized.ts +87 -0
- package/src/models/RespBasic.ts +80 -0
- package/src/models/RespChangeCount.ts +87 -0
- package/src/models/RespName.ts +87 -0
- package/src/models/RespNameArray.ts +87 -0
- package/src/models/RespPathPrefixes.ts +87 -0
- package/src/models/RespProbe.ts +87 -0
- package/src/models/RespResourceUrl.ts +87 -0
- package/src/models/RespRole.ts +87 -0
- package/src/models/RespSecret.ts +87 -0
- package/src/models/RespSecretList.ts +87 -0
- package/src/models/RespSecretMeta.ts +87 -0
- package/src/models/RespSecretVersionMetadata.ts +87 -0
- package/src/models/RespVersions.ts +80 -0
- package/src/models/ResultAuthorized.ts +56 -0
- package/src/models/ResultChangeCount.ts +56 -0
- package/src/models/ResultName.ts +56 -0
- package/src/models/ResultNameArray.ts +56 -0
- package/src/models/ResultResourceUrl.ts +56 -0
- package/src/models/SkProbe.ts +80 -0
- package/src/models/SkRole.ts +144 -0
- package/src/models/SkSecret.ts +71 -0
- package/src/models/SkSecretList.ts +64 -0
- package/src/models/SkSecretMetadata.ts +80 -0
- package/src/models/SkSecretVersion.ts +80 -0
- package/src/models/SkSecretVersionMetadata.ts +103 -0
- package/src/models/Transformation.ts +72 -0
- package/src/models/index.ts +55 -0
- package/src/runtime.ts +320 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,1047 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Tapis Security API
|
|
5
|
+
* The Tapis Security API provides access to the Tapis Security Kernel authorization and secrets facilities.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1
|
|
8
|
+
* Contact: cicsupport@tacc.utexas.edu
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import {
|
|
18
|
+
ReqGrantAdminRole,
|
|
19
|
+
ReqGrantAdminRoleFromJSON,
|
|
20
|
+
ReqGrantAdminRoleToJSON,
|
|
21
|
+
ReqGrantUserPermission,
|
|
22
|
+
ReqGrantUserPermissionFromJSON,
|
|
23
|
+
ReqGrantUserPermissionToJSON,
|
|
24
|
+
ReqGrantUserRole,
|
|
25
|
+
ReqGrantUserRoleFromJSON,
|
|
26
|
+
ReqGrantUserRoleToJSON,
|
|
27
|
+
ReqGrantUserRoleWithPermission,
|
|
28
|
+
ReqGrantUserRoleWithPermissionFromJSON,
|
|
29
|
+
ReqGrantUserRoleWithPermissionToJSON,
|
|
30
|
+
ReqRevokeAdminRole,
|
|
31
|
+
ReqRevokeAdminRoleFromJSON,
|
|
32
|
+
ReqRevokeAdminRoleToJSON,
|
|
33
|
+
ReqRevokeUserPermission,
|
|
34
|
+
ReqRevokeUserPermissionFromJSON,
|
|
35
|
+
ReqRevokeUserPermissionToJSON,
|
|
36
|
+
ReqRevokeUserRole,
|
|
37
|
+
ReqRevokeUserRoleFromJSON,
|
|
38
|
+
ReqRevokeUserRoleToJSON,
|
|
39
|
+
ReqUserHasRole,
|
|
40
|
+
ReqUserHasRoleFromJSON,
|
|
41
|
+
ReqUserHasRoleToJSON,
|
|
42
|
+
ReqUserHasRoleMulti,
|
|
43
|
+
ReqUserHasRoleMultiFromJSON,
|
|
44
|
+
ReqUserHasRoleMultiToJSON,
|
|
45
|
+
ReqUserIsAdmin,
|
|
46
|
+
ReqUserIsAdminFromJSON,
|
|
47
|
+
ReqUserIsAdminToJSON,
|
|
48
|
+
ReqUserIsPermitted,
|
|
49
|
+
ReqUserIsPermittedFromJSON,
|
|
50
|
+
ReqUserIsPermittedToJSON,
|
|
51
|
+
ReqUserIsPermittedMulti,
|
|
52
|
+
ReqUserIsPermittedMultiFromJSON,
|
|
53
|
+
ReqUserIsPermittedMultiToJSON,
|
|
54
|
+
RespAuthorized,
|
|
55
|
+
RespAuthorizedFromJSON,
|
|
56
|
+
RespAuthorizedToJSON,
|
|
57
|
+
RespBasic,
|
|
58
|
+
RespBasicFromJSON,
|
|
59
|
+
RespBasicToJSON,
|
|
60
|
+
RespChangeCount,
|
|
61
|
+
RespChangeCountFromJSON,
|
|
62
|
+
RespChangeCountToJSON,
|
|
63
|
+
RespName,
|
|
64
|
+
RespNameFromJSON,
|
|
65
|
+
RespNameToJSON,
|
|
66
|
+
RespNameArray,
|
|
67
|
+
RespNameArrayFromJSON,
|
|
68
|
+
RespNameArrayToJSON,
|
|
69
|
+
} from '../models';
|
|
70
|
+
|
|
71
|
+
export interface GetAdminsRequest {
|
|
72
|
+
tenant: string;
|
|
73
|
+
pretty?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface GetDefaultUserRole1Request {
|
|
77
|
+
user: string;
|
|
78
|
+
pretty?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface GetUserNamesRequest {
|
|
82
|
+
tenant?: string;
|
|
83
|
+
pretty?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface GetUserPermsRequest {
|
|
87
|
+
user: string;
|
|
88
|
+
tenant?: string;
|
|
89
|
+
implies?: string;
|
|
90
|
+
impliedBy?: string;
|
|
91
|
+
pretty?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface GetUserRolesRequest {
|
|
95
|
+
user: string;
|
|
96
|
+
tenant?: string;
|
|
97
|
+
pretty?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface GetUsersWithPermissionRequest {
|
|
101
|
+
permSpec: string;
|
|
102
|
+
tenant?: string;
|
|
103
|
+
pretty?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface GetUsersWithRoleRequest {
|
|
107
|
+
roleName: string;
|
|
108
|
+
tenant?: string;
|
|
109
|
+
pretty?: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface GrantAdminRoleRequest {
|
|
113
|
+
reqGrantAdminRole: ReqGrantAdminRole;
|
|
114
|
+
pretty?: boolean;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface GrantRoleRequest {
|
|
118
|
+
reqGrantUserRole: ReqGrantUserRole;
|
|
119
|
+
pretty?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface GrantRoleWithPermissionRequest {
|
|
123
|
+
reqGrantUserRoleWithPermission: ReqGrantUserRoleWithPermission;
|
|
124
|
+
pretty?: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface GrantUserPermissionRequest {
|
|
128
|
+
reqGrantUserPermission: ReqGrantUserPermission;
|
|
129
|
+
pretty?: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface HasRoleRequest {
|
|
133
|
+
reqUserHasRole: ReqUserHasRole;
|
|
134
|
+
pretty?: boolean;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface HasRoleAllRequest {
|
|
138
|
+
reqUserHasRoleMulti: ReqUserHasRoleMulti;
|
|
139
|
+
pretty?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface HasRoleAnyRequest {
|
|
143
|
+
reqUserHasRoleMulti: ReqUserHasRoleMulti;
|
|
144
|
+
pretty?: boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface IsAdminRequest {
|
|
148
|
+
reqUserIsAdmin: ReqUserIsAdmin;
|
|
149
|
+
pretty?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface IsPermittedRequest {
|
|
153
|
+
reqUserIsPermitted: ReqUserIsPermitted;
|
|
154
|
+
pretty?: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface IsPermittedAllRequest {
|
|
158
|
+
reqUserIsPermittedMulti: ReqUserIsPermittedMulti;
|
|
159
|
+
pretty?: boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface IsPermittedAnyRequest {
|
|
163
|
+
reqUserIsPermittedMulti: ReqUserIsPermittedMulti;
|
|
164
|
+
pretty?: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface RevokeAdminRoleRequest {
|
|
168
|
+
reqRevokeAdminRole: ReqRevokeAdminRole;
|
|
169
|
+
pretty?: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface RevokeUserPermissionRequest {
|
|
173
|
+
reqRevokeUserPermission: ReqRevokeUserPermission;
|
|
174
|
+
pretty?: boolean;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface RevokeUserRoleRequest {
|
|
178
|
+
reqRevokeUserRole: ReqRevokeUserRole;
|
|
179
|
+
pretty?: boolean;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
*/
|
|
185
|
+
export class UserApi extends runtime.BaseAPI {
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
189
|
+
*/
|
|
190
|
+
async getAdminsRaw(requestParameters: GetAdminsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
191
|
+
if (requestParameters.tenant === null || requestParameters.tenant === undefined) {
|
|
192
|
+
throw new runtime.RequiredError('tenant','Required parameter requestParameters.tenant was null or undefined when calling getAdmins.');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const queryParameters: any = {};
|
|
196
|
+
|
|
197
|
+
if (requestParameters.pretty !== undefined) {
|
|
198
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
202
|
+
|
|
203
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
204
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const response = await this.request({
|
|
208
|
+
path: `/security/user/admins/{tenant}`.replace(`{${"tenant"}}`, encodeURIComponent(String(requestParameters.tenant))),
|
|
209
|
+
method: 'GET',
|
|
210
|
+
headers: headerParameters,
|
|
211
|
+
query: queryParameters,
|
|
212
|
+
}, initOverrides);
|
|
213
|
+
|
|
214
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Get all users assigned the tenant administrator role ($!tenant_admin). This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
219
|
+
*/
|
|
220
|
+
async getAdmins(requestParameters: GetAdminsRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
221
|
+
const response = await this.getAdminsRaw(requestParameters, initOverrides);
|
|
222
|
+
return await response.value();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
|
|
227
|
+
*/
|
|
228
|
+
async getDefaultUserRole1Raw(requestParameters: GetDefaultUserRole1Request, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespName>> {
|
|
229
|
+
if (requestParameters.user === null || requestParameters.user === undefined) {
|
|
230
|
+
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling getDefaultUserRole1.');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const queryParameters: any = {};
|
|
234
|
+
|
|
235
|
+
if (requestParameters.pretty !== undefined) {
|
|
236
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
240
|
+
|
|
241
|
+
const response = await this.request({
|
|
242
|
+
path: `/security/user/defaultRole/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))),
|
|
243
|
+
method: 'GET',
|
|
244
|
+
headers: headerParameters,
|
|
245
|
+
query: queryParameters,
|
|
246
|
+
}, initOverrides);
|
|
247
|
+
|
|
248
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameFromJSON(jsonValue));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Get a user\'s default role. The default role is implicitly created by the system when needed if it doesn\'t already exist. No authorization required. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. This implies the maximum length of a user name is 58 since role names are limited to 60 characters.
|
|
253
|
+
*/
|
|
254
|
+
async getDefaultUserRole1(requestParameters: GetDefaultUserRole1Request, initOverrides?: RequestInit): Promise<RespName> {
|
|
255
|
+
const response = await this.getDefaultUserRole1Raw(requestParameters, initOverrides);
|
|
256
|
+
return await response.value();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
261
|
+
*/
|
|
262
|
+
async getUserNamesRaw(requestParameters: GetUserNamesRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
263
|
+
const queryParameters: any = {};
|
|
264
|
+
|
|
265
|
+
if (requestParameters.tenant !== undefined) {
|
|
266
|
+
queryParameters['tenant'] = requestParameters.tenant;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (requestParameters.pretty !== undefined) {
|
|
270
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
274
|
+
|
|
275
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
276
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const response = await this.request({
|
|
280
|
+
path: `/security/user`,
|
|
281
|
+
method: 'GET',
|
|
282
|
+
headers: headerParameters,
|
|
283
|
+
query: queryParameters,
|
|
284
|
+
}, initOverrides);
|
|
285
|
+
|
|
286
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Get the names of all users in the tenant that have been granted a role or permission. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
291
|
+
*/
|
|
292
|
+
async getUserNames(requestParameters: GetUserNamesRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
293
|
+
const response = await this.getUserNamesRaw(requestParameters, initOverrides);
|
|
294
|
+
return await response.value();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. The implied parameter removes permissions from the result list that the specified permission do not imply. The impliedBy parameter removes permissions from the result list that the specified permission are not implied by. Below are some examples.Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
299
|
+
*/
|
|
300
|
+
async getUserPermsRaw(requestParameters: GetUserPermsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
301
|
+
if (requestParameters.user === null || requestParameters.user === undefined) {
|
|
302
|
+
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling getUserPerms.');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const queryParameters: any = {};
|
|
306
|
+
|
|
307
|
+
if (requestParameters.tenant !== undefined) {
|
|
308
|
+
queryParameters['tenant'] = requestParameters.tenant;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (requestParameters.implies !== undefined) {
|
|
312
|
+
queryParameters['implies'] = requestParameters.implies;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (requestParameters.impliedBy !== undefined) {
|
|
316
|
+
queryParameters['impliedBy'] = requestParameters.impliedBy;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (requestParameters.pretty !== undefined) {
|
|
320
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
324
|
+
|
|
325
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
326
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const response = await this.request({
|
|
330
|
+
path: `/security/user/perms/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))),
|
|
331
|
+
method: 'GET',
|
|
332
|
+
headers: headerParameters,
|
|
333
|
+
query: queryParameters,
|
|
334
|
+
}, initOverrides);
|
|
335
|
+
|
|
336
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Get the permissions assigned to a user in a tenant, including those assigned transively. The result list can be optionally filtered by the one or both of the query parameters: implies and impliedBy. The implied parameter removes permissions from the result list that the specified permission do not imply. The impliedBy parameter removes permissions from the result list that the specified permission are not implied by. Below are some examples.Consider a user that is assigned these permissions: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 **Using the *implies* Query Parameter** When _implies=stream:dev:*:project1_, this endpoint returns: stream:dev:read:project1 stream:dev:read,write:project1 stream:dev:read,write,exec:project1 When _implies=stream:dev:write:project1_, this endpoint returns an empty list. **Using the *impliedBy* Query Parameter** When _impliedBy=stream:dev:*:project1_, this endpoint returns an empty list. When _impliedBy=stream:dev:write:project1_, this endpoint returns: stream:dev:read,write:project1 stream:dev:read,write,exec:project1 This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
341
|
+
*/
|
|
342
|
+
async getUserPerms(requestParameters: GetUserPermsRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
343
|
+
const response = await this.getUserPermsRaw(requestParameters, initOverrides);
|
|
344
|
+
return await response.value();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
349
|
+
*/
|
|
350
|
+
async getUserRolesRaw(requestParameters: GetUserRolesRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
351
|
+
if (requestParameters.user === null || requestParameters.user === undefined) {
|
|
352
|
+
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling getUserRoles.');
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const queryParameters: any = {};
|
|
356
|
+
|
|
357
|
+
if (requestParameters.tenant !== undefined) {
|
|
358
|
+
queryParameters['tenant'] = requestParameters.tenant;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (requestParameters.pretty !== undefined) {
|
|
362
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
366
|
+
|
|
367
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
368
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const response = await this.request({
|
|
372
|
+
path: `/security/user/roles/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))),
|
|
373
|
+
method: 'GET',
|
|
374
|
+
headers: headerParameters,
|
|
375
|
+
query: queryParameters,
|
|
376
|
+
}, initOverrides);
|
|
377
|
+
|
|
378
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Get the roles assigned to a user in the specified tenant, including those assigned transively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
383
|
+
*/
|
|
384
|
+
async getUserRoles(requestParameters: GetUserRolesRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
385
|
+
const response = await this.getUserRolesRaw(requestParameters, initOverrides);
|
|
386
|
+
return await response.value();
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
391
|
+
*/
|
|
392
|
+
async getUsersWithPermissionRaw(requestParameters: GetUsersWithPermissionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
393
|
+
if (requestParameters.permSpec === null || requestParameters.permSpec === undefined) {
|
|
394
|
+
throw new runtime.RequiredError('permSpec','Required parameter requestParameters.permSpec was null or undefined when calling getUsersWithPermission.');
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const queryParameters: any = {};
|
|
398
|
+
|
|
399
|
+
if (requestParameters.tenant !== undefined) {
|
|
400
|
+
queryParameters['tenant'] = requestParameters.tenant;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (requestParameters.pretty !== undefined) {
|
|
404
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
408
|
+
|
|
409
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
410
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const response = await this.request({
|
|
414
|
+
path: `/security/user/withPermission/{permSpec}`.replace(`{${"permSpec"}}`, encodeURIComponent(String(requestParameters.permSpec))),
|
|
415
|
+
method: 'GET',
|
|
416
|
+
headers: headerParameters,
|
|
417
|
+
query: queryParameters,
|
|
418
|
+
}, initOverrides);
|
|
419
|
+
|
|
420
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Get all users in a tenant assigned a permission. The permSpec parameter is a permission specification that uses colons as separators, the asterisk as a wildcard character and commas to define lists. Here are examples of permission specifications: system:mytenant:read:mysystem system:mytenant:*:mysystem system:mytenant files:mytenant:read,write:mysystems This method recognizes the percent sign (%) as a string wildcard only in the context of database searching. If a percent sign (%) appears in the permSpec it is interpreted as a zero or more character wildcard. For example, the following specification would match the first three of the above example specifications but not the fourth: system:mytenant:% The wildcard character cannot appear as the first character in the permSpec. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
425
|
+
*/
|
|
426
|
+
async getUsersWithPermission(requestParameters: GetUsersWithPermissionRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
427
|
+
const response = await this.getUsersWithPermissionRaw(requestParameters, initOverrides);
|
|
428
|
+
return await response.value();
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
433
|
+
*/
|
|
434
|
+
async getUsersWithRoleRaw(requestParameters: GetUsersWithRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespNameArray>> {
|
|
435
|
+
if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
|
|
436
|
+
throw new runtime.RequiredError('roleName','Required parameter requestParameters.roleName was null or undefined when calling getUsersWithRole.');
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const queryParameters: any = {};
|
|
440
|
+
|
|
441
|
+
if (requestParameters.tenant !== undefined) {
|
|
442
|
+
queryParameters['tenant'] = requestParameters.tenant;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (requestParameters.pretty !== undefined) {
|
|
446
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
450
|
+
|
|
451
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
452
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const response = await this.request({
|
|
456
|
+
path: `/security/user/withRole/{roleName}`.replace(`{${"roleName"}}`, encodeURIComponent(String(requestParameters.roleName))),
|
|
457
|
+
method: 'GET',
|
|
458
|
+
headers: headerParameters,
|
|
459
|
+
query: queryParameters,
|
|
460
|
+
}, initOverrides);
|
|
461
|
+
|
|
462
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespNameArrayFromJSON(jsonValue));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Get all users assigned a role. The role must exist in the tenant. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
467
|
+
*/
|
|
468
|
+
async getUsersWithRole(requestParameters: GetUsersWithRoleRequest, initOverrides?: RequestInit): Promise<RespNameArray> {
|
|
469
|
+
const response = await this.getUsersWithRoleRaw(requestParameters, initOverrides);
|
|
470
|
+
return await response.value();
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Grant a user the tenant administrator role. A valid tenant and user must be specified in the request body. The user specified in the JWT must be an administrator in the tenant specified in the request body.
|
|
475
|
+
*/
|
|
476
|
+
async grantAdminRoleRaw(requestParameters: GrantAdminRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
477
|
+
if (requestParameters.reqGrantAdminRole === null || requestParameters.reqGrantAdminRole === undefined) {
|
|
478
|
+
throw new runtime.RequiredError('reqGrantAdminRole','Required parameter requestParameters.reqGrantAdminRole was null or undefined when calling grantAdminRole.');
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const queryParameters: any = {};
|
|
482
|
+
|
|
483
|
+
if (requestParameters.pretty !== undefined) {
|
|
484
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
488
|
+
|
|
489
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
490
|
+
|
|
491
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
492
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const response = await this.request({
|
|
496
|
+
path: `/security/user/grantAdminRole`,
|
|
497
|
+
method: 'POST',
|
|
498
|
+
headers: headerParameters,
|
|
499
|
+
query: queryParameters,
|
|
500
|
+
body: ReqGrantAdminRoleToJSON(requestParameters.reqGrantAdminRole),
|
|
501
|
+
}, initOverrides);
|
|
502
|
+
|
|
503
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Grant a user the tenant administrator role. A valid tenant and user must be specified in the request body. The user specified in the JWT must be an administrator in the tenant specified in the request body.
|
|
508
|
+
*/
|
|
509
|
+
async grantAdminRole(requestParameters: GrantAdminRoleRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
510
|
+
const response = await this.grantAdminRoleRaw(requestParameters, initOverrides);
|
|
511
|
+
return await response.value();
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Grant a user the specified role. A valid tenant and user must be specified in the request body. This request is authorized only if the requestor is the role owner or an administrator. The user and the role must be in the same tenant.
|
|
516
|
+
*/
|
|
517
|
+
async grantRoleRaw(requestParameters: GrantRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
518
|
+
if (requestParameters.reqGrantUserRole === null || requestParameters.reqGrantUserRole === undefined) {
|
|
519
|
+
throw new runtime.RequiredError('reqGrantUserRole','Required parameter requestParameters.reqGrantUserRole was null or undefined when calling grantRole.');
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const queryParameters: any = {};
|
|
523
|
+
|
|
524
|
+
if (requestParameters.pretty !== undefined) {
|
|
525
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
529
|
+
|
|
530
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
531
|
+
|
|
532
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
533
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
const response = await this.request({
|
|
537
|
+
path: `/security/user/grantRole`,
|
|
538
|
+
method: 'POST',
|
|
539
|
+
headers: headerParameters,
|
|
540
|
+
query: queryParameters,
|
|
541
|
+
body: ReqGrantUserRoleToJSON(requestParameters.reqGrantUserRole),
|
|
542
|
+
}, initOverrides);
|
|
543
|
+
|
|
544
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Grant a user the specified role. A valid tenant and user must be specified in the request body. This request is authorized only if the requestor is the role owner or an administrator. The user and the role must be in the same tenant.
|
|
549
|
+
*/
|
|
550
|
+
async grantRole(requestParameters: GrantRoleRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
551
|
+
const response = await this.grantRoleRaw(requestParameters, initOverrides);
|
|
552
|
+
return await response.value();
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. Only the role owner or an administrator is authorized to make this request. The user and the role must be in the same tenant.
|
|
557
|
+
*/
|
|
558
|
+
async grantRoleWithPermissionRaw(requestParameters: GrantRoleWithPermissionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
559
|
+
if (requestParameters.reqGrantUserRoleWithPermission === null || requestParameters.reqGrantUserRoleWithPermission === undefined) {
|
|
560
|
+
throw new runtime.RequiredError('reqGrantUserRoleWithPermission','Required parameter requestParameters.reqGrantUserRoleWithPermission was null or undefined when calling grantRoleWithPermission.');
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const queryParameters: any = {};
|
|
564
|
+
|
|
565
|
+
if (requestParameters.pretty !== undefined) {
|
|
566
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
570
|
+
|
|
571
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
572
|
+
|
|
573
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
574
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const response = await this.request({
|
|
578
|
+
path: `/security/user/grantRoleWithPerm`,
|
|
579
|
+
method: 'POST',
|
|
580
|
+
headers: headerParameters,
|
|
581
|
+
query: queryParameters,
|
|
582
|
+
body: ReqGrantUserRoleWithPermissionToJSON(requestParameters.reqGrantUserRoleWithPermission),
|
|
583
|
+
}, initOverrides);
|
|
584
|
+
|
|
585
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Grant a user the specified role containing the specified permission. This compound request first adds the permission to the role if it is not already a member of the role and then assigns the role to the user. The change count returned can range from zero to two depending on how many insertions were actually required. Only the role owner or an administrator is authorized to make this request. The user and the role must be in the same tenant.
|
|
590
|
+
*/
|
|
591
|
+
async grantRoleWithPermission(requestParameters: GrantRoleWithPermissionRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
592
|
+
const response = await this.grantRoleWithPermissionRaw(requestParameters, initOverrides);
|
|
593
|
+
return await response.value();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist,this request will create that role and grant it to the user before assigning the permission to the role. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
|
|
598
|
+
*/
|
|
599
|
+
async grantUserPermissionRaw(requestParameters: GrantUserPermissionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
600
|
+
if (requestParameters.reqGrantUserPermission === null || requestParameters.reqGrantUserPermission === undefined) {
|
|
601
|
+
throw new runtime.RequiredError('reqGrantUserPermission','Required parameter requestParameters.reqGrantUserPermission was null or undefined when calling grantUserPermission.');
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
const queryParameters: any = {};
|
|
605
|
+
|
|
606
|
+
if (requestParameters.pretty !== undefined) {
|
|
607
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
611
|
+
|
|
612
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
613
|
+
|
|
614
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
615
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const response = await this.request({
|
|
619
|
+
path: `/security/user/grantUserPermission`,
|
|
620
|
+
method: 'POST',
|
|
621
|
+
headers: headerParameters,
|
|
622
|
+
query: queryParameters,
|
|
623
|
+
body: ReqGrantUserPermissionToJSON(requestParameters.reqGrantUserPermission),
|
|
624
|
+
}, initOverrides);
|
|
625
|
+
|
|
626
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Grant a user the specified permission by assigning that permission to to the user\'s default role. If the user\'s default role does not exist,this request will create that role and grant it to the user before assigning the permission to the role. A user\'s default role name is discoverable by calling either of the user/defaultRole or role/defaultRole endpoints. The change count returned can range from zero to three depending on how many insertions and updates were actually required The caller must be an administrator or service allowed to perform updates in the user\'s tenant.
|
|
631
|
+
*/
|
|
632
|
+
async grantUserPermission(requestParameters: GrantUserPermissionRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
633
|
+
const response = await this.grantUserPermissionRaw(requestParameters, initOverrides);
|
|
634
|
+
return await response.value();
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
639
|
+
*/
|
|
640
|
+
async hasRoleRaw(requestParameters: HasRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
641
|
+
if (requestParameters.reqUserHasRole === null || requestParameters.reqUserHasRole === undefined) {
|
|
642
|
+
throw new runtime.RequiredError('reqUserHasRole','Required parameter requestParameters.reqUserHasRole was null or undefined when calling hasRole.');
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const queryParameters: any = {};
|
|
646
|
+
|
|
647
|
+
if (requestParameters.pretty !== undefined) {
|
|
648
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
652
|
+
|
|
653
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
654
|
+
|
|
655
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
656
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const response = await this.request({
|
|
660
|
+
path: `/security/user/hasRole`,
|
|
661
|
+
method: 'POST',
|
|
662
|
+
headers: headerParameters,
|
|
663
|
+
query: queryParameters,
|
|
664
|
+
body: ReqUserHasRoleToJSON(requestParameters.reqUserHasRole),
|
|
665
|
+
}, initOverrides);
|
|
666
|
+
|
|
667
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Check whether a user in a tenant has been assigned the specified role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
672
|
+
*/
|
|
673
|
+
async hasRole(requestParameters: HasRoleRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
674
|
+
const response = await this.hasRoleRaw(requestParameters, initOverrides);
|
|
675
|
+
return await response.value();
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
680
|
+
*/
|
|
681
|
+
async hasRoleAllRaw(requestParameters: HasRoleAllRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
682
|
+
if (requestParameters.reqUserHasRoleMulti === null || requestParameters.reqUserHasRoleMulti === undefined) {
|
|
683
|
+
throw new runtime.RequiredError('reqUserHasRoleMulti','Required parameter requestParameters.reqUserHasRoleMulti was null or undefined when calling hasRoleAll.');
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
const queryParameters: any = {};
|
|
687
|
+
|
|
688
|
+
if (requestParameters.pretty !== undefined) {
|
|
689
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
693
|
+
|
|
694
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
695
|
+
|
|
696
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
697
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
const response = await this.request({
|
|
701
|
+
path: `/security/user/hasRoleAll`,
|
|
702
|
+
method: 'POST',
|
|
703
|
+
headers: headerParameters,
|
|
704
|
+
query: queryParameters,
|
|
705
|
+
body: ReqUserHasRoleMultiToJSON(requestParameters.reqUserHasRoleMulti),
|
|
706
|
+
}, initOverrides);
|
|
707
|
+
|
|
708
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Check whether a user in a tenant has been assigned all of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
713
|
+
*/
|
|
714
|
+
async hasRoleAll(requestParameters: HasRoleAllRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
715
|
+
const response = await this.hasRoleAllRaw(requestParameters, initOverrides);
|
|
716
|
+
return await response.value();
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
721
|
+
*/
|
|
722
|
+
async hasRoleAnyRaw(requestParameters: HasRoleAnyRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
723
|
+
if (requestParameters.reqUserHasRoleMulti === null || requestParameters.reqUserHasRoleMulti === undefined) {
|
|
724
|
+
throw new runtime.RequiredError('reqUserHasRoleMulti','Required parameter requestParameters.reqUserHasRoleMulti was null or undefined when calling hasRoleAny.');
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const queryParameters: any = {};
|
|
728
|
+
|
|
729
|
+
if (requestParameters.pretty !== undefined) {
|
|
730
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
734
|
+
|
|
735
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
736
|
+
|
|
737
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
738
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
const response = await this.request({
|
|
742
|
+
path: `/security/user/hasRoleAny`,
|
|
743
|
+
method: 'POST',
|
|
744
|
+
headers: headerParameters,
|
|
745
|
+
query: queryParameters,
|
|
746
|
+
body: ReqUserHasRoleMultiToJSON(requestParameters.reqUserHasRoleMulti),
|
|
747
|
+
}, initOverrides);
|
|
748
|
+
|
|
749
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Check whether a user in a tenant has been assigned any of the roles specified in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
754
|
+
*/
|
|
755
|
+
async hasRoleAny(requestParameters: HasRoleAnyRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
756
|
+
const response = await this.hasRoleAnyRaw(requestParameters, initOverrides);
|
|
757
|
+
return await response.value();
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
762
|
+
*/
|
|
763
|
+
async isAdminRaw(requestParameters: IsAdminRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
764
|
+
if (requestParameters.reqUserIsAdmin === null || requestParameters.reqUserIsAdmin === undefined) {
|
|
765
|
+
throw new runtime.RequiredError('reqUserIsAdmin','Required parameter requestParameters.reqUserIsAdmin was null or undefined when calling isAdmin.');
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
const queryParameters: any = {};
|
|
769
|
+
|
|
770
|
+
if (requestParameters.pretty !== undefined) {
|
|
771
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
775
|
+
|
|
776
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
777
|
+
|
|
778
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
779
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const response = await this.request({
|
|
783
|
+
path: `/security/user/isAdmin`,
|
|
784
|
+
method: 'POST',
|
|
785
|
+
headers: headerParameters,
|
|
786
|
+
query: queryParameters,
|
|
787
|
+
body: ReqUserIsAdminToJSON(requestParameters.reqUserIsAdmin),
|
|
788
|
+
}, initOverrides);
|
|
789
|
+
|
|
790
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Check whether a user in a tenant has been assigned the tenant administrator role, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
795
|
+
*/
|
|
796
|
+
async isAdmin(requestParameters: IsAdminRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
797
|
+
const response = await this.isAdminRaw(requestParameters, initOverrides);
|
|
798
|
+
return await response.value();
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
803
|
+
*/
|
|
804
|
+
async isPermittedRaw(requestParameters: IsPermittedRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
805
|
+
if (requestParameters.reqUserIsPermitted === null || requestParameters.reqUserIsPermitted === undefined) {
|
|
806
|
+
throw new runtime.RequiredError('reqUserIsPermitted','Required parameter requestParameters.reqUserIsPermitted was null or undefined when calling isPermitted.');
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
const queryParameters: any = {};
|
|
810
|
+
|
|
811
|
+
if (requestParameters.pretty !== undefined) {
|
|
812
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
816
|
+
|
|
817
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
818
|
+
|
|
819
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
820
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
const response = await this.request({
|
|
824
|
+
path: `/security/user/isPermitted`,
|
|
825
|
+
method: 'POST',
|
|
826
|
+
headers: headerParameters,
|
|
827
|
+
query: queryParameters,
|
|
828
|
+
body: ReqUserIsPermittedToJSON(requestParameters.reqUserIsPermitted),
|
|
829
|
+
}, initOverrides);
|
|
830
|
+
|
|
831
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Check whether specified permission matches a permission assigned to the user, either directly or transitively. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
836
|
+
*/
|
|
837
|
+
async isPermitted(requestParameters: IsPermittedRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
838
|
+
const response = await this.isPermittedRaw(requestParameters, initOverrides);
|
|
839
|
+
return await response.value();
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
844
|
+
*/
|
|
845
|
+
async isPermittedAllRaw(requestParameters: IsPermittedAllRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
846
|
+
if (requestParameters.reqUserIsPermittedMulti === null || requestParameters.reqUserIsPermittedMulti === undefined) {
|
|
847
|
+
throw new runtime.RequiredError('reqUserIsPermittedMulti','Required parameter requestParameters.reqUserIsPermittedMulti was null or undefined when calling isPermittedAll.');
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const queryParameters: any = {};
|
|
851
|
+
|
|
852
|
+
if (requestParameters.pretty !== undefined) {
|
|
853
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
857
|
+
|
|
858
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
859
|
+
|
|
860
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
861
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const response = await this.request({
|
|
865
|
+
path: `/security/user/isPermittedAll`,
|
|
866
|
+
method: 'POST',
|
|
867
|
+
headers: headerParameters,
|
|
868
|
+
query: queryParameters,
|
|
869
|
+
body: ReqUserIsPermittedMultiToJSON(requestParameters.reqUserIsPermittedMulti),
|
|
870
|
+
}, initOverrides);
|
|
871
|
+
|
|
872
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Check whether a user\'s permissions satisfy all of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
877
|
+
*/
|
|
878
|
+
async isPermittedAll(requestParameters: IsPermittedAllRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
879
|
+
const response = await this.isPermittedAllRaw(requestParameters, initOverrides);
|
|
880
|
+
return await response.value();
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
885
|
+
*/
|
|
886
|
+
async isPermittedAnyRaw(requestParameters: IsPermittedAnyRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespAuthorized>> {
|
|
887
|
+
if (requestParameters.reqUserIsPermittedMulti === null || requestParameters.reqUserIsPermittedMulti === undefined) {
|
|
888
|
+
throw new runtime.RequiredError('reqUserIsPermittedMulti','Required parameter requestParameters.reqUserIsPermittedMulti was null or undefined when calling isPermittedAny.');
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
const queryParameters: any = {};
|
|
892
|
+
|
|
893
|
+
if (requestParameters.pretty !== undefined) {
|
|
894
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
898
|
+
|
|
899
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
900
|
+
|
|
901
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
902
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
const response = await this.request({
|
|
906
|
+
path: `/security/user/isPermittedAny`,
|
|
907
|
+
method: 'POST',
|
|
908
|
+
headers: headerParameters,
|
|
909
|
+
query: queryParameters,
|
|
910
|
+
body: ReqUserIsPermittedMultiToJSON(requestParameters.reqUserIsPermittedMulti),
|
|
911
|
+
}, initOverrides);
|
|
912
|
+
|
|
913
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespAuthorizedFromJSON(jsonValue));
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Check whether a user\'s permissions satisfy any of the permission specifications contained in the request body. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
|
|
918
|
+
*/
|
|
919
|
+
async isPermittedAny(requestParameters: IsPermittedAnyRequest, initOverrides?: RequestInit): Promise<RespAuthorized> {
|
|
920
|
+
const response = await this.isPermittedAnyRaw(requestParameters, initOverrides);
|
|
921
|
+
return await response.value();
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Revoke the previously granted tenant administrator role from a user. No action is taken if the user is not currently assigned the role (the request is idempotent). The request will not be honored if revoking the role would leave the tenant with no administrator. The user specified in the JWT must themselves be an administrator and a valid tenant and user must be specified in the request body.
|
|
926
|
+
*/
|
|
927
|
+
async revokeAdminRoleRaw(requestParameters: RevokeAdminRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
928
|
+
if (requestParameters.reqRevokeAdminRole === null || requestParameters.reqRevokeAdminRole === undefined) {
|
|
929
|
+
throw new runtime.RequiredError('reqRevokeAdminRole','Required parameter requestParameters.reqRevokeAdminRole was null or undefined when calling revokeAdminRole.');
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
const queryParameters: any = {};
|
|
933
|
+
|
|
934
|
+
if (requestParameters.pretty !== undefined) {
|
|
935
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
939
|
+
|
|
940
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
941
|
+
|
|
942
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
943
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
const response = await this.request({
|
|
947
|
+
path: `/security/user/revokeAdminRole`,
|
|
948
|
+
method: 'POST',
|
|
949
|
+
headers: headerParameters,
|
|
950
|
+
query: queryParameters,
|
|
951
|
+
body: ReqRevokeAdminRoleToJSON(requestParameters.reqRevokeAdminRole),
|
|
952
|
+
}, initOverrides);
|
|
953
|
+
|
|
954
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Revoke the previously granted tenant administrator role from a user. No action is taken if the user is not currently assigned the role (the request is idempotent). The request will not be honored if revoking the role would leave the tenant with no administrator. The user specified in the JWT must themselves be an administrator and a valid tenant and user must be specified in the request body.
|
|
959
|
+
*/
|
|
960
|
+
async revokeAdminRole(requestParameters: RevokeAdminRoleRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
961
|
+
const response = await this.revokeAdminRoleRaw(requestParameters, initOverrides);
|
|
962
|
+
return await response.value();
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
|
|
967
|
+
*/
|
|
968
|
+
async revokeUserPermissionRaw(requestParameters: RevokeUserPermissionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
969
|
+
if (requestParameters.reqRevokeUserPermission === null || requestParameters.reqRevokeUserPermission === undefined) {
|
|
970
|
+
throw new runtime.RequiredError('reqRevokeUserPermission','Required parameter requestParameters.reqRevokeUserPermission was null or undefined when calling revokeUserPermission.');
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
const queryParameters: any = {};
|
|
974
|
+
|
|
975
|
+
if (requestParameters.pretty !== undefined) {
|
|
976
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
980
|
+
|
|
981
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
982
|
+
|
|
983
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
984
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
const response = await this.request({
|
|
988
|
+
path: `/security/user/revokeUserPermission`,
|
|
989
|
+
method: 'POST',
|
|
990
|
+
headers: headerParameters,
|
|
991
|
+
query: queryParameters,
|
|
992
|
+
body: ReqRevokeUserPermissionToJSON(requestParameters.reqRevokeUserPermission),
|
|
993
|
+
}, initOverrides);
|
|
994
|
+
|
|
995
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Revoke the specified permission from the user\'s default role. A user\'s default role is constructed by prepending \'$$\' to the user\'s name. Default roles are created on demand. If the role does not exist when this method is called no error is reported and no changes occur. The change count returned can be zero or one depending on how many permissions were revoked. A valid tenant and user must be specified in the request body. The caller must be an administrator, a service or the user themselves.
|
|
1000
|
+
*/
|
|
1001
|
+
async revokeUserPermission(requestParameters: RevokeUserPermissionRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
1002
|
+
const response = await this.revokeUserPermissionRaw(requestParameters, initOverrides);
|
|
1003
|
+
return await response.value();
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. This request is authorized only if the requestor is the role owner or an administrator.
|
|
1008
|
+
*/
|
|
1009
|
+
async revokeUserRoleRaw(requestParameters: RevokeUserRoleRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RespChangeCount>> {
|
|
1010
|
+
if (requestParameters.reqRevokeUserRole === null || requestParameters.reqRevokeUserRole === undefined) {
|
|
1011
|
+
throw new runtime.RequiredError('reqRevokeUserRole','Required parameter requestParameters.reqRevokeUserRole was null or undefined when calling revokeUserRole.');
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
const queryParameters: any = {};
|
|
1015
|
+
|
|
1016
|
+
if (requestParameters.pretty !== undefined) {
|
|
1017
|
+
queryParameters['pretty'] = requestParameters.pretty;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1021
|
+
|
|
1022
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
1023
|
+
|
|
1024
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1025
|
+
headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
const response = await this.request({
|
|
1029
|
+
path: `/security/user/revokeUserRole`,
|
|
1030
|
+
method: 'POST',
|
|
1031
|
+
headers: headerParameters,
|
|
1032
|
+
query: queryParameters,
|
|
1033
|
+
body: ReqRevokeUserRoleToJSON(requestParameters.reqRevokeUserRole),
|
|
1034
|
+
}, initOverrides);
|
|
1035
|
+
|
|
1036
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespChangeCountFromJSON(jsonValue));
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Revoke a previously granted role from a user. No action is taken if the user is not currently assigned the role. This request is idempotent. This request is authorized only if the requestor is the role owner or an administrator.
|
|
1041
|
+
*/
|
|
1042
|
+
async revokeUserRole(requestParameters: RevokeUserRoleRequest, initOverrides?: RequestInit): Promise<RespChangeCount> {
|
|
1043
|
+
const response = await this.revokeUserRoleRaw(requestParameters, initOverrides);
|
|
1044
|
+
return await response.value();
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
}
|