@tapis/tapis-typescript-sk 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/.openapi-generator/FILES +16 -6
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +5 -4
  4. package/dist/apis/AdminApi.d.ts +26 -0
  5. package/dist/apis/AdminApi.js +128 -0
  6. package/dist/apis/GeneralApi.d.ts +25 -16
  7. package/dist/apis/GeneralApi.js +72 -23
  8. package/dist/apis/RoleApi.d.ts +99 -76
  9. package/dist/apis/RoleApi.js +540 -340
  10. package/dist/apis/ShareApi.d.ts +110 -0
  11. package/dist/apis/ShareApi.js +469 -0
  12. package/dist/apis/UserApi.d.ts +84 -126
  13. package/dist/apis/UserApi.js +467 -538
  14. package/dist/apis/VaultApi.d.ts +52 -49
  15. package/dist/apis/VaultApi.js +413 -341
  16. package/dist/apis/index.d.ts +2 -0
  17. package/dist/apis/index.js +20 -7
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +17 -6
  20. package/dist/models/Options.d.ts +8 -3
  21. package/dist/models/Options.js +23 -15
  22. package/dist/models/ReqAddChildRole.d.ts +11 -6
  23. package/dist/models/ReqAddChildRole.js +33 -19
  24. package/dist/models/ReqAddRolePermission.d.ts +18 -6
  25. package/dist/models/ReqAddRolePermission.js +36 -19
  26. package/dist/models/ReqCreateRole.d.ts +18 -6
  27. package/dist/models/ReqCreateRole.js +36 -19
  28. package/dist/models/ReqGrantRole.d.ts +51 -0
  29. package/dist/models/ReqGrantRole.js +62 -0
  30. package/dist/models/ReqGrantRoleWithPermission.d.ts +57 -0
  31. package/dist/models/ReqGrantRoleWithPermission.js +66 -0
  32. package/dist/models/ReqGrantUserPermission.d.ts +11 -6
  33. package/dist/models/ReqGrantUserPermission.js +33 -19
  34. package/dist/models/ReqPreviewPathPrefix.d.ts +19 -7
  35. package/dist/models/ReqPreviewPathPrefix.js +46 -27
  36. package/dist/models/ReqRemoveChildRole.d.ts +11 -6
  37. package/dist/models/ReqRemoveChildRole.js +33 -19
  38. package/dist/models/ReqRemovePermissionFromAllRoles.d.ts +38 -0
  39. package/dist/models/ReqRemovePermissionFromAllRoles.js +55 -0
  40. package/dist/models/ReqRemoveRolePermission.d.ts +18 -6
  41. package/dist/models/ReqRemoveRolePermission.js +36 -19
  42. package/dist/models/ReqReplacePathPrefix.d.ts +19 -7
  43. package/dist/models/ReqReplacePathPrefix.js +46 -27
  44. package/dist/models/ReqRevokeRole.d.ts +51 -0
  45. package/dist/models/ReqRevokeRole.js +62 -0
  46. package/dist/models/ReqRevokeUserPermission.d.ts +11 -6
  47. package/dist/models/ReqRevokeUserPermission.js +33 -19
  48. package/dist/models/ReqRolePermits.d.ts +45 -0
  49. package/dist/models/ReqRolePermits.js +60 -0
  50. package/dist/models/ReqShareResource.d.ts +68 -0
  51. package/dist/models/ReqShareResource.js +73 -0
  52. package/dist/models/ReqUpdateRoleDescription.d.ts +17 -5
  53. package/dist/models/ReqUpdateRoleDescription.js +32 -17
  54. package/dist/models/ReqUpdateRoleName.d.ts +17 -5
  55. package/dist/models/ReqUpdateRoleName.js +32 -17
  56. package/dist/models/ReqUpdateRoleOwner.d.ts +17 -5
  57. package/dist/models/ReqUpdateRoleOwner.js +34 -19
  58. package/dist/models/ReqUserHasRole.d.ts +18 -6
  59. package/dist/models/ReqUserHasRole.js +38 -21
  60. package/dist/models/ReqUserHasRoleMulti.d.ts +11 -6
  61. package/dist/models/ReqUserHasRoleMulti.js +35 -21
  62. package/dist/models/ReqUserIsAdmin.d.ts +10 -5
  63. package/dist/models/ReqUserIsAdmin.js +29 -17
  64. package/dist/models/ReqUserIsPermitted.d.ts +11 -6
  65. package/dist/models/ReqUserIsPermitted.js +35 -21
  66. package/dist/models/ReqUserIsPermittedMulti.d.ts +11 -6
  67. package/dist/models/ReqUserIsPermittedMulti.js +35 -21
  68. package/dist/models/ReqValidatePwd.d.ts +44 -0
  69. package/dist/models/ReqValidatePwd.js +59 -0
  70. package/dist/models/ReqVersions.d.ts +11 -6
  71. package/dist/models/ReqVersions.js +33 -19
  72. package/dist/models/ReqWriteSecret.d.ts +12 -7
  73. package/dist/models/ReqWriteSecret.js +36 -22
  74. package/dist/models/RespAuthorized.d.ts +27 -4
  75. package/dist/models/RespAuthorized.js +36 -22
  76. package/dist/models/RespBasic.d.ts +26 -3
  77. package/dist/models/RespBasic.js +35 -21
  78. package/dist/models/RespBoolean.d.ts +69 -0
  79. package/dist/models/RespBoolean.js +62 -0
  80. package/dist/models/RespChangeCount.d.ts +27 -4
  81. package/dist/models/RespChangeCount.js +36 -22
  82. package/dist/models/RespName.d.ts +27 -4
  83. package/dist/models/RespName.js +36 -22
  84. package/dist/models/RespNameArray.d.ts +27 -4
  85. package/dist/models/RespNameArray.js +36 -22
  86. package/dist/models/RespPathPrefixes.d.ts +27 -4
  87. package/dist/models/RespPathPrefixes.js +36 -22
  88. package/dist/models/RespProbe.d.ts +27 -4
  89. package/dist/models/RespProbe.js +36 -22
  90. package/dist/models/RespResourceUrl.d.ts +27 -4
  91. package/dist/models/RespResourceUrl.js +36 -22
  92. package/dist/models/RespRole.d.ts +27 -4
  93. package/dist/models/RespRole.js +36 -22
  94. package/dist/models/RespSecret.d.ts +27 -4
  95. package/dist/models/RespSecret.js +36 -22
  96. package/dist/models/RespSecretList.d.ts +27 -4
  97. package/dist/models/RespSecretList.js +36 -22
  98. package/dist/models/RespSecretMeta.d.ts +27 -4
  99. package/dist/models/RespSecretMeta.js +36 -22
  100. package/dist/models/RespSecretVersionMetadata.d.ts +27 -4
  101. package/dist/models/RespSecretVersionMetadata.js +36 -22
  102. package/dist/models/RespShare.d.ts +69 -0
  103. package/dist/models/RespShare.js +62 -0
  104. package/dist/models/RespShareList.d.ts +69 -0
  105. package/dist/models/RespShareList.js +62 -0
  106. package/dist/models/RespVersions.d.ts +26 -3
  107. package/dist/models/RespVersions.js +35 -21
  108. package/dist/models/ResultAuthorized.d.ts +8 -3
  109. package/dist/models/ResultAuthorized.js +23 -15
  110. package/dist/models/ResultBoolean.d.ts +32 -0
  111. package/dist/models/ResultBoolean.js +49 -0
  112. package/dist/models/ResultChangeCount.d.ts +8 -3
  113. package/dist/models/ResultChangeCount.js +23 -15
  114. package/dist/models/ResultName.d.ts +8 -3
  115. package/dist/models/ResultName.js +23 -15
  116. package/dist/models/ResultNameArray.d.ts +8 -3
  117. package/dist/models/ResultNameArray.js +23 -15
  118. package/dist/models/ResultResourceUrl.d.ts +8 -3
  119. package/dist/models/ResultResourceUrl.js +23 -15
  120. package/dist/models/RoleTypeEnum.d.ts +28 -0
  121. package/dist/models/RoleTypeEnum.js +54 -0
  122. package/dist/models/SkProbe.d.ts +8 -21
  123. package/dist/models/SkProbe.js +23 -21
  124. package/dist/models/SkRole.d.ts +19 -7
  125. package/dist/models/SkRole.js +48 -37
  126. package/dist/models/SkSecret.d.ts +9 -4
  127. package/dist/models/SkSecret.js +26 -18
  128. package/dist/models/SkSecretList.d.ts +8 -3
  129. package/dist/models/SkSecretList.js +25 -17
  130. package/dist/models/SkSecretMetadata.d.ts +8 -3
  131. package/dist/models/SkSecretMetadata.js +29 -21
  132. package/dist/models/SkSecretVersion.d.ts +8 -3
  133. package/dist/models/SkSecretVersion.js +29 -21
  134. package/dist/models/SkSecretVersionMetadata.d.ts +9 -4
  135. package/dist/models/SkSecretVersionMetadata.js +34 -26
  136. package/dist/models/SkShare.d.ts +92 -0
  137. package/dist/models/SkShare.js +69 -0
  138. package/dist/models/SkShareList.d.ts +33 -0
  139. package/dist/models/SkShareList.js +50 -0
  140. package/dist/models/Transformation.d.ts +8 -3
  141. package/dist/models/Transformation.js +27 -19
  142. package/dist/models/index.d.ts +14 -6
  143. package/dist/models/index.js +75 -56
  144. package/dist/runtime.d.ts +80 -38
  145. package/dist/runtime.js +313 -171
  146. package/package.json +6 -2
  147. package/src/apis/AdminApi.ts +63 -0
  148. package/src/apis/GeneralApi.ts +48 -24
  149. package/src/apis/RoleApi.ts +374 -220
  150. package/src/apis/ShareApi.ts +418 -0
  151. package/src/apis/UserApi.ts +258 -383
  152. package/src/apis/VaultApi.ts +347 -275
  153. package/src/apis/index.ts +2 -0
  154. package/src/index.ts +2 -2
  155. package/src/models/Options.ts +21 -12
  156. package/src/models/ReqAddChildRole.ts +31 -19
  157. package/src/models/ReqAddRolePermission.ts +49 -19
  158. package/src/models/ReqCreateRole.ts +49 -19
  159. package/src/models/ReqGrantRole.ts +102 -0
  160. package/src/models/ReqGrantRoleWithPermission.ts +111 -0
  161. package/src/models/ReqGrantUserPermission.ts +31 -19
  162. package/src/models/ReqPreviewPathPrefix.ts +59 -28
  163. package/src/models/ReqRemoveChildRole.ts +31 -19
  164. package/src/models/ReqRemovePermissionFromAllRoles.ts +75 -0
  165. package/src/models/ReqRemoveRolePermission.ts +49 -19
  166. package/src/models/ReqReplacePathPrefix.ts +59 -28
  167. package/src/models/ReqRevokeRole.ts +102 -0
  168. package/src/models/ReqRevokeUserPermission.ts +31 -19
  169. package/src/models/ReqRolePermits.ts +94 -0
  170. package/src/models/ReqShareResource.ts +119 -0
  171. package/src/models/ReqUpdateRoleDescription.ts +45 -16
  172. package/src/models/ReqUpdateRoleName.ts +45 -16
  173. package/src/models/ReqUpdateRoleOwner.ts +47 -18
  174. package/src/models/ReqUserHasRole.ts +51 -21
  175. package/src/models/ReqUserHasRoleMulti.ts +33 -21
  176. package/src/models/ReqUserIsAdmin.ts +27 -16
  177. package/src/models/ReqUserIsPermitted.ts +33 -21
  178. package/src/models/ReqUserIsPermittedMulti.ts +33 -21
  179. package/src/models/ReqValidatePwd.ts +84 -0
  180. package/src/models/ReqVersions.ts +31 -19
  181. package/src/models/ReqWriteSecret.ts +36 -23
  182. package/src/models/RespAuthorized.ts +54 -20
  183. package/src/models/RespBasic.ts +51 -18
  184. package/src/models/RespBoolean.ts +121 -0
  185. package/src/models/RespChangeCount.ts +54 -20
  186. package/src/models/RespName.ts +54 -20
  187. package/src/models/RespNameArray.ts +54 -20
  188. package/src/models/RespPathPrefixes.ts +54 -20
  189. package/src/models/RespProbe.ts +54 -20
  190. package/src/models/RespResourceUrl.ts +54 -20
  191. package/src/models/RespRole.ts +54 -20
  192. package/src/models/RespSecret.ts +54 -20
  193. package/src/models/RespSecretList.ts +54 -20
  194. package/src/models/RespSecretMeta.ts +54 -20
  195. package/src/models/RespSecretVersionMetadata.ts +54 -20
  196. package/src/models/RespShare.ts +121 -0
  197. package/src/models/RespShareList.ts +121 -0
  198. package/src/models/RespVersions.ts +51 -18
  199. package/src/models/ResultAuthorized.ts +21 -12
  200. package/src/models/ResultBoolean.ts +65 -0
  201. package/src/models/ResultChangeCount.ts +21 -12
  202. package/src/models/ResultName.ts +21 -12
  203. package/src/models/ResultNameArray.ts +21 -12
  204. package/src/models/ResultResourceUrl.ts +21 -12
  205. package/src/models/RoleTypeEnum.ts +56 -0
  206. package/src/models/SkProbe.ts +21 -36
  207. package/src/models/SkRole.ts +65 -38
  208. package/src/models/SkSecret.ts +26 -16
  209. package/src/models/SkSecretList.ts +23 -14
  210. package/src/models/SkSecretMetadata.ts +27 -18
  211. package/src/models/SkSecretVersion.ts +27 -18
  212. package/src/models/SkSecretVersionMetadata.ts +34 -24
  213. package/src/models/SkShare.ts +145 -0
  214. package/src/models/SkShareList.ts +73 -0
  215. package/src/models/Transformation.ts +25 -16
  216. package/src/models/index.ts +14 -6
  217. package/src/runtime.ts +219 -108
  218. package/dist/models/ReqGrantAdminRole.d.ts +0 -33
  219. package/dist/models/ReqGrantAdminRole.js +0 -43
  220. package/dist/models/ReqGrantUserRole.d.ts +0 -39
  221. package/dist/models/ReqGrantUserRole.js +0 -45
  222. package/dist/models/ReqGrantUserRoleWithPermission.d.ts +0 -45
  223. package/dist/models/ReqGrantUserRoleWithPermission.js +0 -47
  224. package/dist/models/ReqRevokeAdminRole.d.ts +0 -33
  225. package/dist/models/ReqRevokeAdminRole.js +0 -43
  226. package/dist/models/ReqRevokeUserRole.d.ts +0 -39
  227. package/dist/models/ReqRevokeUserRole.js +0 -45
  228. package/dist/models/ReqValidateServicePwd.d.ts +0 -39
  229. package/dist/models/ReqValidateServicePwd.js +0 -45
  230. package/src/models/ReqGrantAdminRole.ts +0 -64
  231. package/src/models/ReqGrantUserRole.ts +0 -72
  232. package/src/models/ReqGrantUserRoleWithPermission.ts +0 -80
  233. package/src/models/ReqRevokeAdminRole.ts +0 -64
  234. package/src/models/ReqRevokeUserRole.ts +0 -72
  235. package/src/models/ReqValidateServicePwd.ts +0 -72
@@ -3,9 +3,9 @@
3
3
  /* eslint-disable */
4
4
  /**
5
5
  * Tapis Security API
6
- * The Tapis Security API provides access to the Tapis Security Kernel authorization and secrets facilities.
6
+ * The Tapis Security API provides for management of Security Kernel (SK) role-based authorization and secrets resources.
7
7
  *
8
- * The version of the OpenAPI document: 0.1
8
+ * The version of the OpenAPI document: 1.8.2
9
9
  * Contact: cicsupport@tacc.utexas.edu
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,30 +13,36 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  var __extends = (this && this.__extends) || (function () {
16
- var extendStatics = Object.setPrototypeOf ||
17
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
19
22
  return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
20
25
  extendStatics(d, b);
21
26
  function __() { this.constructor = d; }
22
27
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23
28
  };
24
29
  })();
25
30
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
32
  return new (P || (P = Promise))(function (resolve, reject) {
27
33
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
34
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
36
  step((generator = generator.apply(thisArg, _arguments || [])).next());
31
37
  });
32
38
  };
33
39
  var __generator = (this && this.__generator) || function (thisArg, body) {
34
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
35
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
42
  function verb(n) { return function (v) { return step([n, v]); }; }
37
43
  function step(op) {
38
44
  if (f) throw new TypeError("Generator is already executing.");
39
- while (_) try {
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
40
46
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
47
  if (y = 0, t) op = [op[0] & 2, t.value];
42
48
  switch (op[0]) {
@@ -58,8 +64,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
58
64
  }
59
65
  };
60
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.RoleApi = void 0;
61
68
  var runtime = require("../runtime");
62
- var models_1 = require("../models");
69
+ var index_1 = require("../models/index");
63
70
  /**
64
71
  *
65
72
  */
@@ -69,42 +76,43 @@ var RoleApi = /** @class */ (function (_super) {
69
76
  return _super !== null && _super.apply(this, arguments) || this;
70
77
  }
71
78
  /**
72
- * Add a child role to another role using a request body. If the child already exists, then the request has no effect and the change count returned is zero. Otherwise, the child is added and the change count is one. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if the user owns both the parent and child roles.
79
+ * Add a child role to another role using a request body. If the child already exists, then the request has no effect and the change count returned is zero. Otherwise, the child is added and the change count is one. Supported only for roles of type *USER*. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if the user owns both the parent and child roles.
73
80
  */
74
81
  RoleApi.prototype.addChildRoleRaw = function (requestParameters, initOverrides) {
75
82
  return __awaiter(this, void 0, void 0, function () {
76
- var queryParameters, headerParameters, response;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
83
+ var queryParameters, headerParameters, _a, _b, response;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
79
86
  case 0:
80
- if (requestParameters.reqAddChildRole === null || requestParameters.reqAddChildRole === undefined) {
81
- throw new runtime.RequiredError('reqAddChildRole', 'Required parameter requestParameters.reqAddChildRole was null or undefined when calling addChildRole.');
87
+ if (requestParameters['reqAddChildRole'] == null) {
88
+ throw new runtime.RequiredError('reqAddChildRole', 'Required parameter "reqAddChildRole" was null or undefined when calling addChildRole().');
82
89
  }
83
90
  queryParameters = {};
84
- if (requestParameters.pretty !== undefined) {
85
- queryParameters['pretty'] = requestParameters.pretty;
86
- }
87
91
  headerParameters = {};
88
92
  headerParameters['Content-Type'] = 'application/json';
89
- if (this.configuration && this.configuration.apiKey) {
90
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
91
- }
92
- return [4 /*yield*/, this.request({
93
- path: "/security/role/addChild",
94
- method: 'POST',
95
- headers: headerParameters,
96
- query: queryParameters,
97
- body: models_1.ReqAddChildRoleToJSON(requestParameters.reqAddChildRole),
98
- }, initOverrides)];
93
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
94
+ _a = headerParameters;
95
+ _b = "X-Tapis-Token";
96
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
99
97
  case 1:
100
- response = _a.sent();
101
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
98
+ _a[_b] = _c.sent(); // TapisJWT authentication
99
+ _c.label = 2;
100
+ case 2: return [4 /*yield*/, this.request({
101
+ path: "/security/role/addChild",
102
+ method: 'POST',
103
+ headers: headerParameters,
104
+ query: queryParameters,
105
+ body: (0, index_1.ReqAddChildRoleToJSON)(requestParameters['reqAddChildRole']),
106
+ }, initOverrides)];
107
+ case 3:
108
+ response = _c.sent();
109
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
102
110
  }
103
111
  });
104
112
  });
105
113
  };
106
114
  /**
107
- * Add a child role to another role using a request body. If the child already exists, then the request has no effect and the change count returned is zero. Otherwise, the child is added and the change count is one. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if the user owns both the parent and child roles.
115
+ * Add a child role to another role using a request body. If the child already exists, then the request has no effect and the change count returned is zero. Otherwise, the child is added and the change count is one. Supported only for roles of type *USER*. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if the user owns both the parent and child roles.
108
116
  */
109
117
  RoleApi.prototype.addChildRole = function (requestParameters, initOverrides) {
110
118
  return __awaiter(this, void 0, void 0, function () {
@@ -121,42 +129,43 @@ var RoleApi = /** @class */ (function (_super) {
121
129
  });
122
130
  };
123
131
  /**
124
- * Add a permission to an existing role using a request body. If the permission already exists, then the request has no effect and the change count returned is zero. Otherwise, the permission is added and the change count is one. Permissions are case-sensitive strings that follow the format defined by Apache Shiro (https://shiro.apache.org/permissions.html). This format defines any number of colon-separated (:) parts, with the possible use of asterisks (*) as wildcards and commas (,) as aggregators. Here are two example permission strings: system:MyTenant:read,write:system1 system:MyTenant:create,read,write,delete:* See the Shiro documentation for further details. Note that the three reserved characters, [: * ,], cannot appear in the text of any part. It\'s the application\'s responsibility to escape those characters in a manner that is safe in the application\'s domain. This request is authorized only if the authenticated user is either the role owner or an administrator.
132
+ * Add a permission to an existing role using a request body. If the permission already exists, then the request has no effect and the change count returned is zero. Otherwise, the permission is added and the change count is one. Permissions are case-sensitive strings that follow the format defined by Apache Shiro (https://shiro.apache.org/permissions.html). This format defines any number of colon-separated (:) parts, with the possible use of asterisks (*) as wildcards and commas (,) as aggregators. Here are two example permission strings: system:MyTenant:read,write:system1 system:MyTenant:create,read,write,delete:* See the Shiro documentation for further details. Note that the three reserved characters, [: * ,], cannot appear in the text of any part. It\'s the application\'s responsibility to escape those characters in a manner that is safe in the application\'s domain. ### Extended Permissions Tapis extends Shiro permission checking with *path semantics*. Path semantics allows the last part of pre-configured permissions to be treated as hierarchical path names, such as the paths used in POSIX file systems. Currently, only permissions that start with *files:* have their last (5th) component configured with path semantics. Path semantics treat the extended permission part as the root of the subtree to which the permission is applied recursively. Grantees assigned the permission will have the permission on the path itself and on all its children. As an example, consider a role that\'s assigned the following permission: files:iplantc.org:read:stampede2:/home/bud Users granted the role have read permission on the following file system resources on stampede2: /home/bud /home/bud/ /home/bud/myfile /home/bud/mydir/myfile Those users, however, will not have access to /home. When an extended permission part ends with a slash, such as /home/bud/, then that part is interpreted as a directory or, more generally, some type of container. In such cases, the permission applies to the children of the path and to the path as written with a slash. For instance, for the file permission path /home/bud/, the permission allows access to /home/bud/ and /home/bud/myfile, but not to /home/bud. When an extended permission part does not end with a slash, such as /home/bud, then the permission applies to the children of the path and to the path written with or without a trailing slash. For instance, for the file permission path /home/bud, the permission allows access to /home/bud, /home/bud/ and /home/bud/myfile. In the previous examples, we assumed /home/bud was a directory. If /home/bud is a file (or more generally a leaf), then specifying the permission path /home/bud/ will not work as intended. Permissions with paths that have trailing slashes should only be used for directories, and they require a trailing slash whenever refering to the root directory. Permissions that don\'t have a trailing slash can represent directories or files, and thus are more general. Extended permission checking avoids *false capture*. Whether a path has a trailing slash or not, permission checking will not capture similarly named sibling paths. For example, using the file permission path /home/bud, grantees are allowed access to /home/bud and all its children (if it\'s a directory), but not to the file /home/buddy.txt nor the directory /home/bud2. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
125
133
  */
126
134
  RoleApi.prototype.addRolePermissionRaw = function (requestParameters, initOverrides) {
127
135
  return __awaiter(this, void 0, void 0, function () {
128
- var queryParameters, headerParameters, response;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
136
+ var queryParameters, headerParameters, _a, _b, response;
137
+ return __generator(this, function (_c) {
138
+ switch (_c.label) {
131
139
  case 0:
132
- if (requestParameters.reqAddRolePermission === null || requestParameters.reqAddRolePermission === undefined) {
133
- throw new runtime.RequiredError('reqAddRolePermission', 'Required parameter requestParameters.reqAddRolePermission was null or undefined when calling addRolePermission.');
140
+ if (requestParameters['reqAddRolePermission'] == null) {
141
+ throw new runtime.RequiredError('reqAddRolePermission', 'Required parameter "reqAddRolePermission" was null or undefined when calling addRolePermission().');
134
142
  }
135
143
  queryParameters = {};
136
- if (requestParameters.pretty !== undefined) {
137
- queryParameters['pretty'] = requestParameters.pretty;
138
- }
139
144
  headerParameters = {};
140
145
  headerParameters['Content-Type'] = 'application/json';
141
- if (this.configuration && this.configuration.apiKey) {
142
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
143
- }
144
- return [4 /*yield*/, this.request({
145
- path: "/security/role/addPerm",
146
- method: 'POST',
147
- headers: headerParameters,
148
- query: queryParameters,
149
- body: models_1.ReqAddRolePermissionToJSON(requestParameters.reqAddRolePermission),
150
- }, initOverrides)];
146
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
147
+ _a = headerParameters;
148
+ _b = "X-Tapis-Token";
149
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
151
150
  case 1:
152
- response = _a.sent();
153
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
151
+ _a[_b] = _c.sent(); // TapisJWT authentication
152
+ _c.label = 2;
153
+ case 2: return [4 /*yield*/, this.request({
154
+ path: "/security/role/addPerm",
155
+ method: 'POST',
156
+ headers: headerParameters,
157
+ query: queryParameters,
158
+ body: (0, index_1.ReqAddRolePermissionToJSON)(requestParameters['reqAddRolePermission']),
159
+ }, initOverrides)];
160
+ case 3:
161
+ response = _c.sent();
162
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
154
163
  }
155
164
  });
156
165
  });
157
166
  };
158
167
  /**
159
- * Add a permission to an existing role using a request body. If the permission already exists, then the request has no effect and the change count returned is zero. Otherwise, the permission is added and the change count is one. Permissions are case-sensitive strings that follow the format defined by Apache Shiro (https://shiro.apache.org/permissions.html). This format defines any number of colon-separated (:) parts, with the possible use of asterisks (*) as wildcards and commas (,) as aggregators. Here are two example permission strings: system:MyTenant:read,write:system1 system:MyTenant:create,read,write,delete:* See the Shiro documentation for further details. Note that the three reserved characters, [: * ,], cannot appear in the text of any part. It\'s the application\'s responsibility to escape those characters in a manner that is safe in the application\'s domain. This request is authorized only if the authenticated user is either the role owner or an administrator.
168
+ * Add a permission to an existing role using a request body. If the permission already exists, then the request has no effect and the change count returned is zero. Otherwise, the permission is added and the change count is one. Permissions are case-sensitive strings that follow the format defined by Apache Shiro (https://shiro.apache.org/permissions.html). This format defines any number of colon-separated (:) parts, with the possible use of asterisks (*) as wildcards and commas (,) as aggregators. Here are two example permission strings: system:MyTenant:read,write:system1 system:MyTenant:create,read,write,delete:* See the Shiro documentation for further details. Note that the three reserved characters, [: * ,], cannot appear in the text of any part. It\'s the application\'s responsibility to escape those characters in a manner that is safe in the application\'s domain. ### Extended Permissions Tapis extends Shiro permission checking with *path semantics*. Path semantics allows the last part of pre-configured permissions to be treated as hierarchical path names, such as the paths used in POSIX file systems. Currently, only permissions that start with *files:* have their last (5th) component configured with path semantics. Path semantics treat the extended permission part as the root of the subtree to which the permission is applied recursively. Grantees assigned the permission will have the permission on the path itself and on all its children. As an example, consider a role that\'s assigned the following permission: files:iplantc.org:read:stampede2:/home/bud Users granted the role have read permission on the following file system resources on stampede2: /home/bud /home/bud/ /home/bud/myfile /home/bud/mydir/myfile Those users, however, will not have access to /home. When an extended permission part ends with a slash, such as /home/bud/, then that part is interpreted as a directory or, more generally, some type of container. In such cases, the permission applies to the children of the path and to the path as written with a slash. For instance, for the file permission path /home/bud/, the permission allows access to /home/bud/ and /home/bud/myfile, but not to /home/bud. When an extended permission part does not end with a slash, such as /home/bud, then the permission applies to the children of the path and to the path written with or without a trailing slash. For instance, for the file permission path /home/bud, the permission allows access to /home/bud, /home/bud/ and /home/bud/myfile. In the previous examples, we assumed /home/bud was a directory. If /home/bud is a file (or more generally a leaf), then specifying the permission path /home/bud/ will not work as intended. Permissions with paths that have trailing slashes should only be used for directories, and they require a trailing slash whenever refering to the root directory. Permissions that don\'t have a trailing slash can represent directories or files, and thus are more general. Extended permission checking avoids *false capture*. Whether a path has a trailing slash or not, permission checking will not capture similarly named sibling paths. For example, using the file permission path /home/bud, grantees are allowed access to /home/bud and all its children (if it\'s a directory), but not to the file /home/buddy.txt nor the directory /home/bud2. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
160
169
  */
161
170
  RoleApi.prototype.addRolePermission = function (requestParameters, initOverrides) {
162
171
  return __awaiter(this, void 0, void 0, function () {
@@ -173,42 +182,43 @@ var RoleApi = /** @class */ (function (_super) {
173
182
  });
174
183
  };
175
184
  /**
176
- * Create a role using a request body. Role names are case sensitive, alpha-numeric strings that can also contain underscores. Role names must start with an alphbetic character and can be no more than 58 characters in length. The desciption can be no more than 2048 characters long. If the role already exists, this request has no effect. For the request to be authorized, the requestor must be either an administrator or a service allowed to perform updates in the new role\'s tenant.
185
+ * Create a role using a request body. Role names are case sensitive, alpha-numeric strings that can also contain underscores. Role names must start with an alphbetic character and can be no more than 58 characters in length. The desciption can be no more than 2048 characters long. If the role already exists, this request has no effect. For the request to be authorized, the requestor must be either an administrator or a service allowed to perform updates in the new role\'s tenant.
177
186
  */
178
187
  RoleApi.prototype.createRoleRaw = function (requestParameters, initOverrides) {
179
188
  return __awaiter(this, void 0, void 0, function () {
180
- var queryParameters, headerParameters, response;
181
- return __generator(this, function (_a) {
182
- switch (_a.label) {
189
+ var queryParameters, headerParameters, _a, _b, response;
190
+ return __generator(this, function (_c) {
191
+ switch (_c.label) {
183
192
  case 0:
184
- if (requestParameters.reqCreateRole === null || requestParameters.reqCreateRole === undefined) {
185
- throw new runtime.RequiredError('reqCreateRole', 'Required parameter requestParameters.reqCreateRole was null or undefined when calling createRole.');
193
+ if (requestParameters['reqCreateRole'] == null) {
194
+ throw new runtime.RequiredError('reqCreateRole', 'Required parameter "reqCreateRole" was null or undefined when calling createRole().');
186
195
  }
187
196
  queryParameters = {};
188
- if (requestParameters.pretty !== undefined) {
189
- queryParameters['pretty'] = requestParameters.pretty;
190
- }
191
197
  headerParameters = {};
192
198
  headerParameters['Content-Type'] = 'application/json';
193
- if (this.configuration && this.configuration.apiKey) {
194
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
195
- }
196
- return [4 /*yield*/, this.request({
197
- path: "/security/role",
198
- method: 'POST',
199
- headers: headerParameters,
200
- query: queryParameters,
201
- body: models_1.ReqCreateRoleToJSON(requestParameters.reqCreateRole),
202
- }, initOverrides)];
199
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
200
+ _a = headerParameters;
201
+ _b = "X-Tapis-Token";
202
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
203
203
  case 1:
204
- response = _a.sent();
205
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespResourceUrlFromJSON(jsonValue); })];
204
+ _a[_b] = _c.sent(); // TapisJWT authentication
205
+ _c.label = 2;
206
+ case 2: return [4 /*yield*/, this.request({
207
+ path: "/security/role",
208
+ method: 'POST',
209
+ headers: headerParameters,
210
+ query: queryParameters,
211
+ body: (0, index_1.ReqCreateRoleToJSON)(requestParameters['reqCreateRole']),
212
+ }, initOverrides)];
213
+ case 3:
214
+ response = _c.sent();
215
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespResourceUrlFromJSON)(jsonValue); })];
206
216
  }
207
217
  });
208
218
  });
209
219
  };
210
220
  /**
211
- * Create a role using a request body. Role names are case sensitive, alpha-numeric strings that can also contain underscores. Role names must start with an alphbetic character and can be no more than 58 characters in length. The desciption can be no more than 2048 characters long. If the role already exists, this request has no effect. For the request to be authorized, the requestor must be either an administrator or a service allowed to perform updates in the new role\'s tenant.
221
+ * Create a role using a request body. Role names are case sensitive, alpha-numeric strings that can also contain underscores. Role names must start with an alphbetic character and can be no more than 58 characters in length. The desciption can be no more than 2048 characters long. If the role already exists, this request has no effect. For the request to be authorized, the requestor must be either an administrator or a service allowed to perform updates in the new role\'s tenant.
212
222
  */
213
223
  RoleApi.prototype.createRole = function (requestParameters, initOverrides) {
214
224
  return __awaiter(this, void 0, void 0, function () {
@@ -225,43 +235,47 @@ var RoleApi = /** @class */ (function (_super) {
225
235
  });
226
236
  };
227
237
  /**
228
- * Delete the named role. A valid tenant and user must be specified as query parameters. This request is authorized only if the authenticated user is either the role owner or an administrator.
238
+ * Delete the named role. A valid tenant and user must be specified as query parameters. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
229
239
  */
230
240
  RoleApi.prototype.deleteRoleByNameRaw = function (requestParameters, initOverrides) {
231
241
  return __awaiter(this, void 0, void 0, function () {
232
- var queryParameters, headerParameters, response;
233
- return __generator(this, function (_a) {
234
- switch (_a.label) {
242
+ var queryParameters, headerParameters, _a, _b, response;
243
+ return __generator(this, function (_c) {
244
+ switch (_c.label) {
235
245
  case 0:
236
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
237
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling deleteRoleByName.');
246
+ if (requestParameters['roleName'] == null) {
247
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling deleteRoleByName().');
238
248
  }
239
249
  queryParameters = {};
240
- if (requestParameters.tenant !== undefined) {
241
- queryParameters['tenant'] = requestParameters.tenant;
250
+ if (requestParameters['tenant'] != null) {
251
+ queryParameters['tenant'] = requestParameters['tenant'];
242
252
  }
243
- if (requestParameters.pretty !== undefined) {
244
- queryParameters['pretty'] = requestParameters.pretty;
253
+ if (requestParameters['roleType'] != null) {
254
+ queryParameters['roleType'] = requestParameters['roleType'];
245
255
  }
246
256
  headerParameters = {};
247
- if (this.configuration && this.configuration.apiKey) {
248
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
249
- }
250
- return [4 /*yield*/, this.request({
251
- path: "/security/role/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
252
- method: 'DELETE',
253
- headers: headerParameters,
254
- query: queryParameters,
255
- }, initOverrides)];
257
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
258
+ _a = headerParameters;
259
+ _b = "X-Tapis-Token";
260
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
256
261
  case 1:
257
- response = _a.sent();
258
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
262
+ _a[_b] = _c.sent(); // TapisJWT authentication
263
+ _c.label = 2;
264
+ case 2: return [4 /*yield*/, this.request({
265
+ path: "/security/role/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
266
+ method: 'DELETE',
267
+ headers: headerParameters,
268
+ query: queryParameters,
269
+ }, initOverrides)];
270
+ case 3:
271
+ response = _c.sent();
272
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
259
273
  }
260
274
  });
261
275
  });
262
276
  };
263
277
  /**
264
- * Delete the named role. A valid tenant and user must be specified as query parameters. This request is authorized only if the authenticated user is either the role owner or an administrator.
278
+ * Delete the named role. A valid tenant and user must be specified as query parameters. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
265
279
  */
266
280
  RoleApi.prototype.deleteRoleByName = function (requestParameters, initOverrides) {
267
281
  return __awaiter(this, void 0, void 0, function () {
@@ -278,37 +292,41 @@ var RoleApi = /** @class */ (function (_super) {
278
292
  });
279
293
  };
280
294
  /**
281
- * 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.
295
+ * 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.
282
296
  */
283
297
  RoleApi.prototype.getDefaultUserRoleRaw = function (requestParameters, initOverrides) {
284
298
  return __awaiter(this, void 0, void 0, function () {
285
- var queryParameters, headerParameters, response;
286
- return __generator(this, function (_a) {
287
- switch (_a.label) {
299
+ var queryParameters, headerParameters, _a, _b, response;
300
+ return __generator(this, function (_c) {
301
+ switch (_c.label) {
288
302
  case 0:
289
- if (requestParameters.user === null || requestParameters.user === undefined) {
290
- throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getDefaultUserRole.');
303
+ if (requestParameters['user'] == null) {
304
+ throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getDefaultUserRole().');
291
305
  }
292
306
  queryParameters = {};
293
- if (requestParameters.pretty !== undefined) {
294
- queryParameters['pretty'] = requestParameters.pretty;
295
- }
296
307
  headerParameters = {};
297
- return [4 /*yield*/, this.request({
298
- path: "/security/role/defaultRole/{user}".replace("{" + "user" + "}", encodeURIComponent(String(requestParameters.user))),
299
- method: 'GET',
300
- headers: headerParameters,
301
- query: queryParameters,
302
- }, initOverrides)];
308
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
309
+ _a = headerParameters;
310
+ _b = "X-Tapis-Token";
311
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
303
312
  case 1:
304
- response = _a.sent();
305
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameFromJSON(jsonValue); })];
313
+ _a[_b] = _c.sent(); // TapisJWT authentication
314
+ _c.label = 2;
315
+ case 2: return [4 /*yield*/, this.request({
316
+ path: "/security/role/defaultRole/{user}".replace("{".concat("user", "}"), encodeURIComponent(String(requestParameters['user']))),
317
+ method: 'GET',
318
+ headers: headerParameters,
319
+ query: queryParameters,
320
+ }, initOverrides)];
321
+ case 3:
322
+ response = _c.sent();
323
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameFromJSON)(jsonValue); })];
306
324
  }
307
325
  });
308
326
  });
309
327
  };
310
328
  /**
311
- * 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.
329
+ * 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.
312
330
  */
313
331
  RoleApi.prototype.getDefaultUserRole = function (requestParameters, initOverrides) {
314
332
  return __awaiter(this, void 0, void 0, function () {
@@ -325,43 +343,47 @@ var RoleApi = /** @class */ (function (_super) {
325
343
  });
326
344
  };
327
345
  /**
328
- * Get the named role\'s definition. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
346
+ * Get the named role\'s definition. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
329
347
  */
330
348
  RoleApi.prototype.getRoleByNameRaw = function (requestParameters, initOverrides) {
331
349
  return __awaiter(this, void 0, void 0, function () {
332
- var queryParameters, headerParameters, response;
333
- return __generator(this, function (_a) {
334
- switch (_a.label) {
350
+ var queryParameters, headerParameters, _a, _b, response;
351
+ return __generator(this, function (_c) {
352
+ switch (_c.label) {
335
353
  case 0:
336
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
337
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling getRoleByName.');
354
+ if (requestParameters['roleName'] == null) {
355
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling getRoleByName().');
338
356
  }
339
357
  queryParameters = {};
340
- if (requestParameters.tenant !== undefined) {
341
- queryParameters['tenant'] = requestParameters.tenant;
358
+ if (requestParameters['tenant'] != null) {
359
+ queryParameters['tenant'] = requestParameters['tenant'];
342
360
  }
343
- if (requestParameters.pretty !== undefined) {
344
- queryParameters['pretty'] = requestParameters.pretty;
361
+ if (requestParameters['roleType'] != null) {
362
+ queryParameters['roleType'] = requestParameters['roleType'];
345
363
  }
346
364
  headerParameters = {};
347
- if (this.configuration && this.configuration.apiKey) {
348
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
349
- }
350
- return [4 /*yield*/, this.request({
351
- path: "/security/role/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
352
- method: 'GET',
353
- headers: headerParameters,
354
- query: queryParameters,
355
- }, initOverrides)];
365
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
366
+ _a = headerParameters;
367
+ _b = "X-Tapis-Token";
368
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
356
369
  case 1:
357
- response = _a.sent();
358
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespRoleFromJSON(jsonValue); })];
370
+ _a[_b] = _c.sent(); // TapisJWT authentication
371
+ _c.label = 2;
372
+ case 2: return [4 /*yield*/, this.request({
373
+ path: "/security/role/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
374
+ method: 'GET',
375
+ headers: headerParameters,
376
+ query: queryParameters,
377
+ }, initOverrides)];
378
+ case 3:
379
+ response = _c.sent();
380
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespRoleFromJSON)(jsonValue); })];
359
381
  }
360
382
  });
361
383
  });
362
384
  };
363
385
  /**
364
- * Get the named role\'s definition. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
386
+ * Get the named role\'s definition. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
365
387
  */
366
388
  RoleApi.prototype.getRoleByName = function (requestParameters, initOverrides) {
367
389
  return __awaiter(this, void 0, void 0, function () {
@@ -378,44 +400,49 @@ var RoleApi = /** @class */ (function (_super) {
378
400
  });
379
401
  };
380
402
  /**
381
- * Get the names of all roles in the tenant in alphabetic order. Future enhancements will include search filtering. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
403
+ * Get the names of all roles in the tenant in alphabetic order. Future enhancements will include search filtering. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
382
404
  */
383
405
  RoleApi.prototype.getRoleNamesRaw = function (requestParameters, initOverrides) {
384
406
  return __awaiter(this, void 0, void 0, function () {
385
- var queryParameters, headerParameters, response;
386
- return __generator(this, function (_a) {
387
- switch (_a.label) {
407
+ var queryParameters, headerParameters, _a, _b, response;
408
+ return __generator(this, function (_c) {
409
+ switch (_c.label) {
388
410
  case 0:
389
411
  queryParameters = {};
390
- if (requestParameters.tenant !== undefined) {
391
- queryParameters['tenant'] = requestParameters.tenant;
412
+ if (requestParameters['tenant'] != null) {
413
+ queryParameters['tenant'] = requestParameters['tenant'];
392
414
  }
393
- if (requestParameters.pretty !== undefined) {
394
- queryParameters['pretty'] = requestParameters.pretty;
415
+ if (requestParameters['roleType'] != null) {
416
+ queryParameters['roleType'] = requestParameters['roleType'];
395
417
  }
396
418
  headerParameters = {};
397
- if (this.configuration && this.configuration.apiKey) {
398
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
399
- }
400
- return [4 /*yield*/, this.request({
401
- path: "/security/role",
402
- method: 'GET',
403
- headers: headerParameters,
404
- query: queryParameters,
405
- }, initOverrides)];
419
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
420
+ _a = headerParameters;
421
+ _b = "X-Tapis-Token";
422
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
406
423
  case 1:
407
- response = _a.sent();
408
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
424
+ _a[_b] = _c.sent(); // TapisJWT authentication
425
+ _c.label = 2;
426
+ case 2: return [4 /*yield*/, this.request({
427
+ path: "/security/role",
428
+ method: 'GET',
429
+ headers: headerParameters,
430
+ query: queryParameters,
431
+ }, initOverrides)];
432
+ case 3:
433
+ response = _c.sent();
434
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
409
435
  }
410
436
  });
411
437
  });
412
438
  };
413
439
  /**
414
- * Get the names of all roles in the tenant in alphabetic order. Future enhancements will include search filtering. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
440
+ * Get the names of all roles in the tenant in alphabetic order. Future enhancements will include search filtering. A valid tenant must be specified as a query parameter. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
415
441
  */
416
- RoleApi.prototype.getRoleNames = function (requestParameters, initOverrides) {
417
- return __awaiter(this, void 0, void 0, function () {
442
+ RoleApi.prototype.getRoleNames = function () {
443
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
418
444
  var response;
445
+ if (requestParameters === void 0) { requestParameters = {}; }
419
446
  return __generator(this, function (_a) {
420
447
  switch (_a.label) {
421
448
  case 0: return [4 /*yield*/, this.getRoleNamesRaw(requestParameters, initOverrides)];
@@ -428,46 +455,47 @@ var RoleApi = /** @class */ (function (_super) {
428
455
  });
429
456
  };
430
457
  /**
431
- * Get the named role\'s permissions. By default, all permissions assigned to the role, whether directly and transitively through child roles, are returned. Set the immediate query parameter to only retrieve permissions directly assigned to the role. A valid tenant must be specified. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
458
+ * Get the named role\'s permissions. By default, all permissions assigned to the role, whether directly and transitively through child roles, are returned. Set the immediate query parameter to only retrieve permissions directly assigned to the role. A valid tenant must be specified. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
432
459
  */
433
460
  RoleApi.prototype.getRolePermissionsRaw = function (requestParameters, initOverrides) {
434
461
  return __awaiter(this, void 0, void 0, function () {
435
- var queryParameters, headerParameters, response;
436
- return __generator(this, function (_a) {
437
- switch (_a.label) {
462
+ var queryParameters, headerParameters, _a, _b, response;
463
+ return __generator(this, function (_c) {
464
+ switch (_c.label) {
438
465
  case 0:
439
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
440
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling getRolePermissions.');
466
+ if (requestParameters['roleName'] == null) {
467
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling getRolePermissions().');
441
468
  }
442
469
  queryParameters = {};
443
- if (requestParameters.tenant !== undefined) {
444
- queryParameters['tenant'] = requestParameters.tenant;
445
- }
446
- if (requestParameters.immediate !== undefined) {
447
- queryParameters['immediate'] = requestParameters.immediate;
470
+ if (requestParameters['tenant'] != null) {
471
+ queryParameters['tenant'] = requestParameters['tenant'];
448
472
  }
449
- if (requestParameters.pretty !== undefined) {
450
- queryParameters['pretty'] = requestParameters.pretty;
473
+ if (requestParameters['immediate'] != null) {
474
+ queryParameters['immediate'] = requestParameters['immediate'];
451
475
  }
452
476
  headerParameters = {};
453
- if (this.configuration && this.configuration.apiKey) {
454
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
455
- }
456
- return [4 /*yield*/, this.request({
457
- path: "/security/role/{roleName}/perms".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
458
- method: 'GET',
459
- headers: headerParameters,
460
- query: queryParameters,
461
- }, initOverrides)];
477
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
478
+ _a = headerParameters;
479
+ _b = "X-Tapis-Token";
480
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
462
481
  case 1:
463
- response = _a.sent();
464
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespNameArrayFromJSON(jsonValue); })];
482
+ _a[_b] = _c.sent(); // TapisJWT authentication
483
+ _c.label = 2;
484
+ case 2: return [4 /*yield*/, this.request({
485
+ path: "/security/role/{roleName}/perms".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
486
+ method: 'GET',
487
+ headers: headerParameters,
488
+ query: queryParameters,
489
+ }, initOverrides)];
490
+ case 3:
491
+ response = _c.sent();
492
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespNameArrayFromJSON)(jsonValue); })];
465
493
  }
466
494
  });
467
495
  });
468
496
  };
469
497
  /**
470
- * Get the named role\'s permissions. By default, all permissions assigned to the role, whether directly and transitively through child roles, are returned. Set the immediate query parameter to only retrieve permissions directly assigned to the role. A valid tenant must be specified. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
498
+ * Get the named role\'s permissions. By default, all permissions assigned to the role, whether directly and transitively through child roles, are returned. Set the immediate query parameter to only retrieve permissions directly assigned to the role. A valid tenant must be specified. This request is authorized if the requestor is a user that has access to the specified tenant or if the requestor is a service.
471
499
  */
472
500
  RoleApi.prototype.getRolePermissions = function (requestParameters, initOverrides) {
473
501
  return __awaiter(this, void 0, void 0, function () {
@@ -484,42 +512,43 @@ var RoleApi = /** @class */ (function (_super) {
484
512
  });
485
513
  };
486
514
  /**
487
- * This read-only endpoint previews the transformations that would take place if the same input was used on a replacePathPrefix POST call. This call is also implemented as a POST so that the same input as used on replacePathPrefix can be used here, but this call changes nothing. This endpoint can be used to get an accounting of existing system/path combinations that match the input specification. Such information is useful when trying to duplicate a set of permissions. For example, one may want to copy a file subtree to another location and assign the same permissions to the new subtree as currently exist on the original subtree. One could use this call to calculate the users that should be granted permission on the new subtree. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The result object contains an array of transformation objects, each of which contains the unique permission sequence number, the existing permission that matched the search criteria and the new permission if the specified transformations were applied. A valid tenant and user must be 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.
515
+ * This read-only endpoint previews the transformations that would take place if the same input was used on a replacePathPrefix POST call. This call is also implemented as a POST so that the same input as used on replacePathPrefix can be used here, but this call changes nothing. This endpoint can be used to get an accounting of existing system/path combinations that match the input specification. Such information is useful when trying to duplicate a set of permissions. For example, one may want to copy a file subtree to another location and assign the same permissions to the new subtree as currently exist on the original subtree. One could use this call to calculate the users that should be granted permission on the new subtree. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The result object contains an array of transformation objects, each of which contains the unique permission sequence number, the existing permission that matched the search criteria and the new permission if the specified transformations were applied. A valid tenant and user must be 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.
488
516
  */
489
517
  RoleApi.prototype.previewPathPrefixRaw = function (requestParameters, initOverrides) {
490
518
  return __awaiter(this, void 0, void 0, function () {
491
- var queryParameters, headerParameters, response;
492
- return __generator(this, function (_a) {
493
- switch (_a.label) {
519
+ var queryParameters, headerParameters, _a, _b, response;
520
+ return __generator(this, function (_c) {
521
+ switch (_c.label) {
494
522
  case 0:
495
- if (requestParameters.reqPreviewPathPrefix === null || requestParameters.reqPreviewPathPrefix === undefined) {
496
- throw new runtime.RequiredError('reqPreviewPathPrefix', 'Required parameter requestParameters.reqPreviewPathPrefix was null or undefined when calling previewPathPrefix.');
523
+ if (requestParameters['reqPreviewPathPrefix'] == null) {
524
+ throw new runtime.RequiredError('reqPreviewPathPrefix', 'Required parameter "reqPreviewPathPrefix" was null or undefined when calling previewPathPrefix().');
497
525
  }
498
526
  queryParameters = {};
499
- if (requestParameters.pretty !== undefined) {
500
- queryParameters['pretty'] = requestParameters.pretty;
501
- }
502
527
  headerParameters = {};
503
528
  headerParameters['Content-Type'] = 'application/json';
504
- if (this.configuration && this.configuration.apiKey) {
505
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
506
- }
507
- return [4 /*yield*/, this.request({
508
- path: "/security/role/previewPathPrefix",
509
- method: 'POST',
510
- headers: headerParameters,
511
- query: queryParameters,
512
- body: models_1.ReqPreviewPathPrefixToJSON(requestParameters.reqPreviewPathPrefix),
513
- }, initOverrides)];
529
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
530
+ _a = headerParameters;
531
+ _b = "X-Tapis-Token";
532
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
514
533
  case 1:
515
- response = _a.sent();
516
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespPathPrefixesFromJSON(jsonValue); })];
534
+ _a[_b] = _c.sent(); // TapisJWT authentication
535
+ _c.label = 2;
536
+ case 2: return [4 /*yield*/, this.request({
537
+ path: "/security/role/previewPathPrefix",
538
+ method: 'POST',
539
+ headers: headerParameters,
540
+ query: queryParameters,
541
+ body: (0, index_1.ReqPreviewPathPrefixToJSON)(requestParameters['reqPreviewPathPrefix']),
542
+ }, initOverrides)];
543
+ case 3:
544
+ response = _c.sent();
545
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespPathPrefixesFromJSON)(jsonValue); })];
517
546
  }
518
547
  });
519
548
  });
520
549
  };
521
550
  /**
522
- * This read-only endpoint previews the transformations that would take place if the same input was used on a replacePathPrefix POST call. This call is also implemented as a POST so that the same input as used on replacePathPrefix can be used here, but this call changes nothing. This endpoint can be used to get an accounting of existing system/path combinations that match the input specification. Such information is useful when trying to duplicate a set of permissions. For example, one may want to copy a file subtree to another location and assign the same permissions to the new subtree as currently exist on the original subtree. One could use this call to calculate the users that should be granted permission on the new subtree. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The result object contains an array of transformation objects, each of which contains the unique permission sequence number, the existing permission that matched the search criteria and the new permission if the specified transformations were applied. A valid tenant and user must be 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.
551
+ * This read-only endpoint previews the transformations that would take place if the same input was used on a replacePathPrefix POST call. This call is also implemented as a POST so that the same input as used on replacePathPrefix can be used here, but this call changes nothing. This endpoint can be used to get an accounting of existing system/path combinations that match the input specification. Such information is useful when trying to duplicate a set of permissions. For example, one may want to copy a file subtree to another location and assign the same permissions to the new subtree as currently exist on the original subtree. One could use this call to calculate the users that should be granted permission on the new subtree. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The result object contains an array of transformation objects, each of which contains the unique permission sequence number, the existing permission that matched the search criteria and the new permission if the specified transformations were applied. A valid tenant and user must be 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.
523
552
  */
524
553
  RoleApi.prototype.previewPathPrefix = function (requestParameters, initOverrides) {
525
554
  return __awaiter(this, void 0, void 0, function () {
@@ -536,42 +565,43 @@ var RoleApi = /** @class */ (function (_super) {
536
565
  });
537
566
  };
538
567
  /**
539
- * Remove a child role from a parent role using a request body. A valid tenant and user must be specified in the request body. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if they own the parent role.
568
+ * Remove a child role from a parent role using a request body. A valid tenant and user must be specified in the request body. Supported only for roles of type *USER*. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if they own the parent role.
540
569
  */
541
570
  RoleApi.prototype.removeChildRoleRaw = function (requestParameters, initOverrides) {
542
571
  return __awaiter(this, void 0, void 0, function () {
543
- var queryParameters, headerParameters, response;
544
- return __generator(this, function (_a) {
545
- switch (_a.label) {
572
+ var queryParameters, headerParameters, _a, _b, response;
573
+ return __generator(this, function (_c) {
574
+ switch (_c.label) {
546
575
  case 0:
547
- if (requestParameters.reqRemoveChildRole === null || requestParameters.reqRemoveChildRole === undefined) {
548
- throw new runtime.RequiredError('reqRemoveChildRole', 'Required parameter requestParameters.reqRemoveChildRole was null or undefined when calling removeChildRole.');
576
+ if (requestParameters['reqRemoveChildRole'] == null) {
577
+ throw new runtime.RequiredError('reqRemoveChildRole', 'Required parameter "reqRemoveChildRole" was null or undefined when calling removeChildRole().');
549
578
  }
550
579
  queryParameters = {};
551
- if (requestParameters.pretty !== undefined) {
552
- queryParameters['pretty'] = requestParameters.pretty;
553
- }
554
580
  headerParameters = {};
555
581
  headerParameters['Content-Type'] = 'application/json';
556
- if (this.configuration && this.configuration.apiKey) {
557
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
558
- }
559
- return [4 /*yield*/, this.request({
560
- path: "/security/role/removeChild",
561
- method: 'POST',
562
- headers: headerParameters,
563
- query: queryParameters,
564
- body: models_1.ReqRemoveChildRoleToJSON(requestParameters.reqRemoveChildRole),
565
- }, initOverrides)];
582
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
583
+ _a = headerParameters;
584
+ _b = "X-Tapis-Token";
585
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
566
586
  case 1:
567
- response = _a.sent();
568
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
587
+ _a[_b] = _c.sent(); // TapisJWT authentication
588
+ _c.label = 2;
589
+ case 2: return [4 /*yield*/, this.request({
590
+ path: "/security/role/removeChild",
591
+ method: 'POST',
592
+ headers: headerParameters,
593
+ query: queryParameters,
594
+ body: (0, index_1.ReqRemoveChildRoleToJSON)(requestParameters['reqRemoveChildRole']),
595
+ }, initOverrides)];
596
+ case 3:
597
+ response = _c.sent();
598
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
569
599
  }
570
600
  });
571
601
  });
572
602
  };
573
603
  /**
574
- * Remove a child role from a parent role using a request body. A valid tenant and user must be specified in the request body. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if they own the parent role.
604
+ * Remove a child role from a parent role using a request body. A valid tenant and user must be specified in the request body. Supported only for roles of type *USER*. The user@tenant identity specified in JWT is authorized to make this request only if that user is an administrator or if they own the parent role.
575
605
  */
576
606
  RoleApi.prototype.removeChildRole = function (requestParameters, initOverrides) {
577
607
  return __awaiter(this, void 0, void 0, function () {
@@ -588,42 +618,149 @@ var RoleApi = /** @class */ (function (_super) {
588
618
  });
589
619
  };
590
620
  /**
591
- * Remove a permission from a role using a request body. A valid role, roleTenant and permission must be specified in the request body. Only the role owner or administrators are authorized to make this call.
621
+ * Remove an extended permission from all roles in a tenant using a request body. The tenant and permission must be specified in the request body. Each role in the tenant is searched for the extended permission string and, where found, that permission is removed. The matching algorithm is string comparison with wildcard semantics on the path component. This is the same as an exact string match for all parts of the permission specification up to the path part. A match on the path part, however, occurs when its path is a prefix of a role permission\'s path. Consider the following permission specification: files:mytenant:read:mysystem:/my/dir which will match both of the following role permissions: files:mytenant:read:mysystem:/my/dir/subdir/myfile files:mytenant:read:mysystem:/my/dir33/yourfile Note that a match to the second role permission might be a *false capture* if the intension was to remove all permissions to resources in the /my/dir subtree, but not those in other directories. To avoid this potential problem, callers can make two calls, one to this endpoint with a permSpec that ends with a slash (\"/\") and one to the removePermissionFromeAllRoles endpoint with no trailing slash. The former removes all children from the directory subtree, the latter removes the directory itself. Only the Files service is authorized to make this call.
592
622
  */
593
- RoleApi.prototype.removeRolePermissionRaw = function (requestParameters, initOverrides) {
623
+ RoleApi.prototype.removePathPermissionFromAllRolesRaw = function (requestParameters, initOverrides) {
594
624
  return __awaiter(this, void 0, void 0, function () {
595
- var queryParameters, headerParameters, response;
625
+ var queryParameters, headerParameters, _a, _b, response;
626
+ return __generator(this, function (_c) {
627
+ switch (_c.label) {
628
+ case 0:
629
+ if (requestParameters['reqRemovePermissionFromAllRoles'] == null) {
630
+ throw new runtime.RequiredError('reqRemovePermissionFromAllRoles', 'Required parameter "reqRemovePermissionFromAllRoles" was null or undefined when calling removePathPermissionFromAllRoles().');
631
+ }
632
+ queryParameters = {};
633
+ headerParameters = {};
634
+ headerParameters['Content-Type'] = 'application/json';
635
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
636
+ _a = headerParameters;
637
+ _b = "X-Tapis-Token";
638
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
639
+ case 1:
640
+ _a[_b] = _c.sent(); // TapisJWT authentication
641
+ _c.label = 2;
642
+ case 2: return [4 /*yield*/, this.request({
643
+ path: "/security/role/removePathPermFromAllRoles",
644
+ method: 'POST',
645
+ headers: headerParameters,
646
+ query: queryParameters,
647
+ body: (0, index_1.ReqRemovePermissionFromAllRolesToJSON)(requestParameters['reqRemovePermissionFromAllRoles']),
648
+ }, initOverrides)];
649
+ case 3:
650
+ response = _c.sent();
651
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
652
+ }
653
+ });
654
+ });
655
+ };
656
+ /**
657
+ * Remove an extended permission from all roles in a tenant using a request body. The tenant and permission must be specified in the request body. Each role in the tenant is searched for the extended permission string and, where found, that permission is removed. The matching algorithm is string comparison with wildcard semantics on the path component. This is the same as an exact string match for all parts of the permission specification up to the path part. A match on the path part, however, occurs when its path is a prefix of a role permission\'s path. Consider the following permission specification: files:mytenant:read:mysystem:/my/dir which will match both of the following role permissions: files:mytenant:read:mysystem:/my/dir/subdir/myfile files:mytenant:read:mysystem:/my/dir33/yourfile Note that a match to the second role permission might be a *false capture* if the intension was to remove all permissions to resources in the /my/dir subtree, but not those in other directories. To avoid this potential problem, callers can make two calls, one to this endpoint with a permSpec that ends with a slash (\"/\") and one to the removePermissionFromeAllRoles endpoint with no trailing slash. The former removes all children from the directory subtree, the latter removes the directory itself. Only the Files service is authorized to make this call.
658
+ */
659
+ RoleApi.prototype.removePathPermissionFromAllRoles = function (requestParameters, initOverrides) {
660
+ return __awaiter(this, void 0, void 0, function () {
661
+ var response;
596
662
  return __generator(this, function (_a) {
597
663
  switch (_a.label) {
664
+ case 0: return [4 /*yield*/, this.removePathPermissionFromAllRolesRaw(requestParameters, initOverrides)];
665
+ case 1:
666
+ response = _a.sent();
667
+ return [4 /*yield*/, response.value()];
668
+ case 2: return [2 /*return*/, _a.sent()];
669
+ }
670
+ });
671
+ });
672
+ };
673
+ /**
674
+ * Remove a permission from all roles in a tenant using a request body. The tenant and permission must be specified in the request body. Each role in the tenant is searched for the *exact* permission string and, where found, that permission is removed. The matching algorithm is simple, character by character, string comparison. Permissions are not interpreted. For example, a permission that contains a wildcard (*) will only match a role\'s permission when the same wildcard is found in the exact same position. The same rule applies to permission segments with multiple, comma separated components: a match requires the exact same ordering and spacing of components. Only services are authorized to make this call.
675
+ */
676
+ RoleApi.prototype.removePermissionFromAllRolesRaw = function (requestParameters, initOverrides) {
677
+ return __awaiter(this, void 0, void 0, function () {
678
+ var queryParameters, headerParameters, _a, _b, response;
679
+ return __generator(this, function (_c) {
680
+ switch (_c.label) {
598
681
  case 0:
599
- if (requestParameters.reqRemoveRolePermission === null || requestParameters.reqRemoveRolePermission === undefined) {
600
- throw new runtime.RequiredError('reqRemoveRolePermission', 'Required parameter requestParameters.reqRemoveRolePermission was null or undefined when calling removeRolePermission.');
682
+ if (requestParameters['reqRemovePermissionFromAllRoles'] == null) {
683
+ throw new runtime.RequiredError('reqRemovePermissionFromAllRoles', 'Required parameter "reqRemovePermissionFromAllRoles" was null or undefined when calling removePermissionFromAllRoles().');
601
684
  }
602
685
  queryParameters = {};
603
- if (requestParameters.pretty !== undefined) {
604
- queryParameters['pretty'] = requestParameters.pretty;
605
- }
606
686
  headerParameters = {};
607
687
  headerParameters['Content-Type'] = 'application/json';
608
- if (this.configuration && this.configuration.apiKey) {
609
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
610
- }
611
- return [4 /*yield*/, this.request({
612
- path: "/security/role/removePerm",
613
- method: 'POST',
614
- headers: headerParameters,
615
- query: queryParameters,
616
- body: models_1.ReqRemoveRolePermissionToJSON(requestParameters.reqRemoveRolePermission),
617
- }, initOverrides)];
688
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
689
+ _a = headerParameters;
690
+ _b = "X-Tapis-Token";
691
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
692
+ case 1:
693
+ _a[_b] = _c.sent(); // TapisJWT authentication
694
+ _c.label = 2;
695
+ case 2: return [4 /*yield*/, this.request({
696
+ path: "/security/role/removePermFromAllRoles",
697
+ method: 'POST',
698
+ headers: headerParameters,
699
+ query: queryParameters,
700
+ body: (0, index_1.ReqRemovePermissionFromAllRolesToJSON)(requestParameters['reqRemovePermissionFromAllRoles']),
701
+ }, initOverrides)];
702
+ case 3:
703
+ response = _c.sent();
704
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
705
+ }
706
+ });
707
+ });
708
+ };
709
+ /**
710
+ * Remove a permission from all roles in a tenant using a request body. The tenant and permission must be specified in the request body. Each role in the tenant is searched for the *exact* permission string and, where found, that permission is removed. The matching algorithm is simple, character by character, string comparison. Permissions are not interpreted. For example, a permission that contains a wildcard (*) will only match a role\'s permission when the same wildcard is found in the exact same position. The same rule applies to permission segments with multiple, comma separated components: a match requires the exact same ordering and spacing of components. Only services are authorized to make this call.
711
+ */
712
+ RoleApi.prototype.removePermissionFromAllRoles = function (requestParameters, initOverrides) {
713
+ return __awaiter(this, void 0, void 0, function () {
714
+ var response;
715
+ return __generator(this, function (_a) {
716
+ switch (_a.label) {
717
+ case 0: return [4 /*yield*/, this.removePermissionFromAllRolesRaw(requestParameters, initOverrides)];
618
718
  case 1:
619
719
  response = _a.sent();
620
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
720
+ return [4 /*yield*/, response.value()];
721
+ case 2: return [2 /*return*/, _a.sent()];
722
+ }
723
+ });
724
+ });
725
+ };
726
+ /**
727
+ * Remove a permission from a role using a request body. A valid role, roleTenant and permission must be specified in the request body. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
728
+ */
729
+ RoleApi.prototype.removeRolePermissionRaw = function (requestParameters, initOverrides) {
730
+ return __awaiter(this, void 0, void 0, function () {
731
+ var queryParameters, headerParameters, _a, _b, response;
732
+ return __generator(this, function (_c) {
733
+ switch (_c.label) {
734
+ case 0:
735
+ if (requestParameters['reqRemoveRolePermission'] == null) {
736
+ throw new runtime.RequiredError('reqRemoveRolePermission', 'Required parameter "reqRemoveRolePermission" was null or undefined when calling removeRolePermission().');
737
+ }
738
+ queryParameters = {};
739
+ headerParameters = {};
740
+ headerParameters['Content-Type'] = 'application/json';
741
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
742
+ _a = headerParameters;
743
+ _b = "X-Tapis-Token";
744
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
745
+ case 1:
746
+ _a[_b] = _c.sent(); // TapisJWT authentication
747
+ _c.label = 2;
748
+ case 2: return [4 /*yield*/, this.request({
749
+ path: "/security/role/removePerm",
750
+ method: 'POST',
751
+ headers: headerParameters,
752
+ query: queryParameters,
753
+ body: (0, index_1.ReqRemoveRolePermissionToJSON)(requestParameters['reqRemoveRolePermission']),
754
+ }, initOverrides)];
755
+ case 3:
756
+ response = _c.sent();
757
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
621
758
  }
622
759
  });
623
760
  });
624
761
  };
625
762
  /**
626
- * Remove a permission from a role using a request body. A valid role, roleTenant and permission must be specified in the request body. Only the role owner or administrators are authorized to make this call.
763
+ * Remove a permission from a role using a request body. A valid role, roleTenant and permission must be specified in the request body. For roles of type USER the request is authorized only if the requestor is the role owner, a tenant administrator or a site administrator. For roles of type TENANT_ADMIN the requestor must a tenant or site administrator. For roles of type RESTRICTED_SVC the requestor must a site administrator.
627
764
  */
628
765
  RoleApi.prototype.removeRolePermission = function (requestParameters, initOverrides) {
629
766
  return __awaiter(this, void 0, void 0, function () {
@@ -640,42 +777,43 @@ var RoleApi = /** @class */ (function (_super) {
640
777
  });
641
778
  };
642
779
  /**
643
- * Replace the text in a permission specification when its last component defines an *extended path attribute*. Extended path attributes enhance the standard Shiro matching algorithm with one that treats designated components in a permission specification as a path name, such as a posix file or directory path name. This request is useful when files or directories have been renamed or moved and their authorizations need to be adjusted. Consider, for example, permissions that conform to the following specification: files:tenantId:op:systemId:path By definition, the last component is an extended path attribute whose content can be changed by replacePathPrefix requests. Specifically, paths that begin with the oldPrefix will have that prefix replaced with the newPrefix value. Replacement only occurs on permissions that also match the schema and oldSystemId parameter values. The systemId attribute is required to immediately precede the path attribute, which must be the last attribute. Additionally, the oldSystemId is replaced with the newSystemId when a match is found. If a roleName is provided, then replacement is limited to permissions defined only in that role. Otherwise, permissions in all roles that meet the other matching criteria will be considered. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The previewPathPrefix request provides a way to do a dry run using the same input as this request. The preview call calculates the permissions that would change and what their new values would be, but it does not actually change those permissions as replacePathPrefix does. The input parameters are passed in the payload of this request. The response indicates the number of changed permission specifications. The path prefix replacement operation is authorized if the user@tenant in the JWT represents a tenant administrator or the Files service.
780
+ * Replace the text in a permission specification when its last component defines an *extended path attribute*. Extended path attributes enhance the standard Shiro matching algorithm with one that treats designated components in a permission specification as a path name, such as a posix file or directory path name. This request is useful when files or directories have been renamed or moved and their authorizations need to be adjusted. Consider, for example, permissions that conform to the following specification: files:tenantId:op:systemId:path By definition, the last component is an extended path attribute whose content can be changed by replacePathPrefix requests. Specifically, paths that begin with the oldPrefix will have that prefix replaced with the newPrefix value. Replacement only occurs on permissions that also match the schema and oldSystemId parameter values. The systemId attribute is required to immediately precede the path attribute, which must be the last attribute. Additionally, the oldSystemId is replaced with the newSystemId when a match is found. If a roleName is provided, then replacement is limited to permissions defined only in that role. Otherwise, permissions in all roles that meet the other matching criteria will be considered. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The previewPathPrefix request provides a way to do a dry run using the same input as this request. The preview call calculates the permissions that would change and what their new values would be, but it does not actually change those permissions as replacePathPrefix does. The input parameters are passed in the payload of this request. The response indicates the number of changed permission specifications. The path prefix replacement operation is authorized if the user@tenant in the JWT represents a tenant administrator or the Files service.
644
781
  */
645
782
  RoleApi.prototype.replacePathPrefixRaw = function (requestParameters, initOverrides) {
646
783
  return __awaiter(this, void 0, void 0, function () {
647
- var queryParameters, headerParameters, response;
648
- return __generator(this, function (_a) {
649
- switch (_a.label) {
784
+ var queryParameters, headerParameters, _a, _b, response;
785
+ return __generator(this, function (_c) {
786
+ switch (_c.label) {
650
787
  case 0:
651
- if (requestParameters.reqReplacePathPrefix === null || requestParameters.reqReplacePathPrefix === undefined) {
652
- throw new runtime.RequiredError('reqReplacePathPrefix', 'Required parameter requestParameters.reqReplacePathPrefix was null or undefined when calling replacePathPrefix.');
788
+ if (requestParameters['reqReplacePathPrefix'] == null) {
789
+ throw new runtime.RequiredError('reqReplacePathPrefix', 'Required parameter "reqReplacePathPrefix" was null or undefined when calling replacePathPrefix().');
653
790
  }
654
791
  queryParameters = {};
655
- if (requestParameters.pretty !== undefined) {
656
- queryParameters['pretty'] = requestParameters.pretty;
657
- }
658
792
  headerParameters = {};
659
793
  headerParameters['Content-Type'] = 'application/json';
660
- if (this.configuration && this.configuration.apiKey) {
661
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
662
- }
663
- return [4 /*yield*/, this.request({
664
- path: "/security/role/replacePathPrefix",
665
- method: 'POST',
666
- headers: headerParameters,
667
- query: queryParameters,
668
- body: models_1.ReqReplacePathPrefixToJSON(requestParameters.reqReplacePathPrefix),
669
- }, initOverrides)];
794
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
795
+ _a = headerParameters;
796
+ _b = "X-Tapis-Token";
797
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
670
798
  case 1:
671
- response = _a.sent();
672
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespChangeCountFromJSON(jsonValue); })];
799
+ _a[_b] = _c.sent(); // TapisJWT authentication
800
+ _c.label = 2;
801
+ case 2: return [4 /*yield*/, this.request({
802
+ path: "/security/role/replacePathPrefix",
803
+ method: 'POST',
804
+ headers: headerParameters,
805
+ query: queryParameters,
806
+ body: (0, index_1.ReqReplacePathPrefixToJSON)(requestParameters['reqReplacePathPrefix']),
807
+ }, initOverrides)];
808
+ case 3:
809
+ response = _c.sent();
810
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
673
811
  }
674
812
  });
675
813
  });
676
814
  };
677
815
  /**
678
- * Replace the text in a permission specification when its last component defines an *extended path attribute*. Extended path attributes enhance the standard Shiro matching algorithm with one that treats designated components in a permission specification as a path name, such as a posix file or directory path name. This request is useful when files or directories have been renamed or moved and their authorizations need to be adjusted. Consider, for example, permissions that conform to the following specification: files:tenantId:op:systemId:path By definition, the last component is an extended path attribute whose content can be changed by replacePathPrefix requests. Specifically, paths that begin with the oldPrefix will have that prefix replaced with the newPrefix value. Replacement only occurs on permissions that also match the schema and oldSystemId parameter values. The systemId attribute is required to immediately precede the path attribute, which must be the last attribute. Additionally, the oldSystemId is replaced with the newSystemId when a match is found. If a roleName is provided, then replacement is limited to permissions defined only in that role. Otherwise, permissions in all roles that meet the other matching criteria will be considered. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The previewPathPrefix request provides a way to do a dry run using the same input as this request. The preview call calculates the permissions that would change and what their new values would be, but it does not actually change those permissions as replacePathPrefix does. The input parameters are passed in the payload of this request. The response indicates the number of changed permission specifications. The path prefix replacement operation is authorized if the user@tenant in the JWT represents a tenant administrator or the Files service.
816
+ * Replace the text in a permission specification when its last component defines an *extended path attribute*. Extended path attributes enhance the standard Shiro matching algorithm with one that treats designated components in a permission specification as a path name, such as a posix file or directory path name. This request is useful when files or directories have been renamed or moved and their authorizations need to be adjusted. Consider, for example, permissions that conform to the following specification: files:tenantId:op:systemId:path By definition, the last component is an extended path attribute whose content can be changed by replacePathPrefix requests. Specifically, paths that begin with the oldPrefix will have that prefix replaced with the newPrefix value. Replacement only occurs on permissions that also match the schema and oldSystemId parameter values. The systemId attribute is required to immediately precede the path attribute, which must be the last attribute. Additionally, the oldSystemId is replaced with the newSystemId when a match is found. If a roleName is provided, then replacement is limited to permissions defined only in that role. Otherwise, permissions in all roles that meet the other matching criteria will be considered. The optional parameters are roleName, oldPrefix and newPrefix. No wildcards are defined for the path prefix parameters. When roleName is specified then only permissions assigned to that role are considered. When the oldPrefix parameter is provided, it\'s used to filter out permissions whose paths do not begin with the specified string; when not provided, no path prefix filtering occurs. When the newPrefix parameter is not provided no new characters are prepended to the new path, effectively just removing the oldPrefix from the new path. When neither oldPrefix nor newPrefix are provided, no path transformation occurs, though system IDs can still be transformed. The previewPathPrefix request provides a way to do a dry run using the same input as this request. The preview call calculates the permissions that would change and what their new values would be, but it does not actually change those permissions as replacePathPrefix does. The input parameters are passed in the payload of this request. The response indicates the number of changed permission specifications. The path prefix replacement operation is authorized if the user@tenant in the JWT represents a tenant administrator or the Files service.
679
817
  */
680
818
  RoleApi.prototype.replacePathPrefix = function (requestParameters, initOverrides) {
681
819
  return __awaiter(this, void 0, void 0, function () {
@@ -692,45 +830,105 @@ var RoleApi = /** @class */ (function (_super) {
692
830
  });
693
831
  };
694
832
  /**
695
- * Update an existing role\'s decription using a request body. The size limit on a description is 2048 characters. This request is authorized if the requestor is the role owner or an administrator.
833
+ * Check to see if the specified role allows the specified permission. Any authenticated user may make this request.
696
834
  */
697
- RoleApi.prototype.updateRoleDescriptionRaw = function (requestParameters, initOverrides) {
835
+ RoleApi.prototype.rolePermitsRaw = function (requestParameters, initOverrides) {
698
836
  return __awaiter(this, void 0, void 0, function () {
699
- var queryParameters, headerParameters, response;
700
- return __generator(this, function (_a) {
701
- switch (_a.label) {
837
+ var queryParameters, headerParameters, _a, _b, response;
838
+ return __generator(this, function (_c) {
839
+ switch (_c.label) {
702
840
  case 0:
703
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
704
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling updateRoleDescription.');
841
+ if (requestParameters['roleName'] == null) {
842
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling rolePermits().');
705
843
  }
706
- if (requestParameters.reqUpdateRoleDescription === null || requestParameters.reqUpdateRoleDescription === undefined) {
707
- throw new runtime.RequiredError('reqUpdateRoleDescription', 'Required parameter requestParameters.reqUpdateRoleDescription was null or undefined when calling updateRoleDescription.');
844
+ if (requestParameters['reqRolePermits'] == null) {
845
+ throw new runtime.RequiredError('reqRolePermits', 'Required parameter "reqRolePermits" was null or undefined when calling rolePermits().');
708
846
  }
709
847
  queryParameters = {};
710
- if (requestParameters.pretty !== undefined) {
711
- queryParameters['pretty'] = requestParameters.pretty;
848
+ if (requestParameters['immediate'] != null) {
849
+ queryParameters['immediate'] = requestParameters['immediate'];
712
850
  }
713
851
  headerParameters = {};
714
852
  headerParameters['Content-Type'] = 'application/json';
715
- if (this.configuration && this.configuration.apiKey) {
716
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
717
- }
718
- return [4 /*yield*/, this.request({
719
- path: "/security/role/updateDesc/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
720
- method: 'POST',
721
- headers: headerParameters,
722
- query: queryParameters,
723
- body: models_1.ReqUpdateRoleDescriptionToJSON(requestParameters.reqUpdateRoleDescription),
724
- }, initOverrides)];
853
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
854
+ _a = headerParameters;
855
+ _b = "X-Tapis-Token";
856
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
857
+ case 1:
858
+ _a[_b] = _c.sent(); // TapisJWT authentication
859
+ _c.label = 2;
860
+ case 2: return [4 /*yield*/, this.request({
861
+ path: "/security/role/{roleName}/permits".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
862
+ method: 'POST',
863
+ headers: headerParameters,
864
+ query: queryParameters,
865
+ body: (0, index_1.ReqRolePermitsToJSON)(requestParameters['reqRolePermits']),
866
+ }, initOverrides)];
867
+ case 3:
868
+ response = _c.sent();
869
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespAuthorizedFromJSON)(jsonValue); })];
870
+ }
871
+ });
872
+ });
873
+ };
874
+ /**
875
+ * Check to see if the specified role allows the specified permission. Any authenticated user may make this request.
876
+ */
877
+ RoleApi.prototype.rolePermits = function (requestParameters, initOverrides) {
878
+ return __awaiter(this, void 0, void 0, function () {
879
+ var response;
880
+ return __generator(this, function (_a) {
881
+ switch (_a.label) {
882
+ case 0: return [4 /*yield*/, this.rolePermitsRaw(requestParameters, initOverrides)];
725
883
  case 1:
726
884
  response = _a.sent();
727
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespBasicFromJSON(jsonValue); })];
885
+ return [4 /*yield*/, response.value()];
886
+ case 2: return [2 /*return*/, _a.sent()];
728
887
  }
729
888
  });
730
889
  });
731
890
  };
732
891
  /**
733
- * Update an existing role\'s decription using a request body. The size limit on a description is 2048 characters. This request is authorized if the requestor is the role owner or an administrator.
892
+ * Update an existing role\'s decription using a request body. The size limit on a description is 2048 characters. This request is authorized if the requestor is the role owner or an administrator.
893
+ */
894
+ RoleApi.prototype.updateRoleDescriptionRaw = function (requestParameters, initOverrides) {
895
+ return __awaiter(this, void 0, void 0, function () {
896
+ var queryParameters, headerParameters, _a, _b, response;
897
+ return __generator(this, function (_c) {
898
+ switch (_c.label) {
899
+ case 0:
900
+ if (requestParameters['roleName'] == null) {
901
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling updateRoleDescription().');
902
+ }
903
+ if (requestParameters['reqUpdateRoleDescription'] == null) {
904
+ throw new runtime.RequiredError('reqUpdateRoleDescription', 'Required parameter "reqUpdateRoleDescription" was null or undefined when calling updateRoleDescription().');
905
+ }
906
+ queryParameters = {};
907
+ headerParameters = {};
908
+ headerParameters['Content-Type'] = 'application/json';
909
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
910
+ _a = headerParameters;
911
+ _b = "X-Tapis-Token";
912
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
913
+ case 1:
914
+ _a[_b] = _c.sent(); // TapisJWT authentication
915
+ _c.label = 2;
916
+ case 2: return [4 /*yield*/, this.request({
917
+ path: "/security/role/updateDesc/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
918
+ method: 'POST',
919
+ headers: headerParameters,
920
+ query: queryParameters,
921
+ body: (0, index_1.ReqUpdateRoleDescriptionToJSON)(requestParameters['reqUpdateRoleDescription']),
922
+ }, initOverrides)];
923
+ case 3:
924
+ response = _c.sent();
925
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespBasicFromJSON)(jsonValue); })];
926
+ }
927
+ });
928
+ });
929
+ };
930
+ /**
931
+ * Update an existing role\'s decription using a request body. The size limit on a description is 2048 characters. This request is authorized if the requestor is the role owner or an administrator.
734
932
  */
735
933
  RoleApi.prototype.updateRoleDescription = function (requestParameters, initOverrides) {
736
934
  return __awaiter(this, void 0, void 0, function () {
@@ -747,45 +945,46 @@ var RoleApi = /** @class */ (function (_super) {
747
945
  });
748
946
  };
749
947
  /**
750
- * Update an existing role\'s name using a request body. Role names are case sensitive, alphanumeric strings that can contain underscores but must begin with an alphabetic character. The limit on role name is 58 characters. This request is authorized if the requestor is the role owner or an administrator.
948
+ * Update an existing role\'s name using a request body. Role names are case sensitive, alphanumeric strings that can contain underscores but must begin with an alphabetic character. The limit on role name is 58 characters. This request is authorized if the requestor is the role owner or an administrator.
751
949
  */
752
950
  RoleApi.prototype.updateRoleNameRaw = function (requestParameters, initOverrides) {
753
951
  return __awaiter(this, void 0, void 0, function () {
754
- var queryParameters, headerParameters, response;
755
- return __generator(this, function (_a) {
756
- switch (_a.label) {
952
+ var queryParameters, headerParameters, _a, _b, response;
953
+ return __generator(this, function (_c) {
954
+ switch (_c.label) {
757
955
  case 0:
758
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
759
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling updateRoleName.');
956
+ if (requestParameters['roleName'] == null) {
957
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling updateRoleName().');
760
958
  }
761
- if (requestParameters.reqUpdateRoleName === null || requestParameters.reqUpdateRoleName === undefined) {
762
- throw new runtime.RequiredError('reqUpdateRoleName', 'Required parameter requestParameters.reqUpdateRoleName was null or undefined when calling updateRoleName.');
959
+ if (requestParameters['reqUpdateRoleName'] == null) {
960
+ throw new runtime.RequiredError('reqUpdateRoleName', 'Required parameter "reqUpdateRoleName" was null or undefined when calling updateRoleName().');
763
961
  }
764
962
  queryParameters = {};
765
- if (requestParameters.pretty !== undefined) {
766
- queryParameters['pretty'] = requestParameters.pretty;
767
- }
768
963
  headerParameters = {};
769
964
  headerParameters['Content-Type'] = 'application/json';
770
- if (this.configuration && this.configuration.apiKey) {
771
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
772
- }
773
- return [4 /*yield*/, this.request({
774
- path: "/security/role/updateName/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
775
- method: 'POST',
776
- headers: headerParameters,
777
- query: queryParameters,
778
- body: models_1.ReqUpdateRoleNameToJSON(requestParameters.reqUpdateRoleName),
779
- }, initOverrides)];
965
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
966
+ _a = headerParameters;
967
+ _b = "X-Tapis-Token";
968
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
780
969
  case 1:
781
- response = _a.sent();
782
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespBasicFromJSON(jsonValue); })];
970
+ _a[_b] = _c.sent(); // TapisJWT authentication
971
+ _c.label = 2;
972
+ case 2: return [4 /*yield*/, this.request({
973
+ path: "/security/role/updateName/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
974
+ method: 'POST',
975
+ headers: headerParameters,
976
+ query: queryParameters,
977
+ body: (0, index_1.ReqUpdateRoleNameToJSON)(requestParameters['reqUpdateRoleName']),
978
+ }, initOverrides)];
979
+ case 3:
980
+ response = _c.sent();
981
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespBasicFromJSON)(jsonValue); })];
783
982
  }
784
983
  });
785
984
  });
786
985
  };
787
986
  /**
788
- * Update an existing role\'s name using a request body. Role names are case sensitive, alphanumeric strings that can contain underscores but must begin with an alphabetic character. The limit on role name is 58 characters. This request is authorized if the requestor is the role owner or an administrator.
987
+ * Update an existing role\'s name using a request body. Role names are case sensitive, alphanumeric strings that can contain underscores but must begin with an alphabetic character. The limit on role name is 58 characters. This request is authorized if the requestor is the role owner or an administrator.
789
988
  */
790
989
  RoleApi.prototype.updateRoleName = function (requestParameters, initOverrides) {
791
990
  return __awaiter(this, void 0, void 0, function () {
@@ -806,35 +1005,36 @@ var RoleApi = /** @class */ (function (_super) {
806
1005
  */
807
1006
  RoleApi.prototype.updateRoleOwnerRaw = function (requestParameters, initOverrides) {
808
1007
  return __awaiter(this, void 0, void 0, function () {
809
- var queryParameters, headerParameters, response;
810
- return __generator(this, function (_a) {
811
- switch (_a.label) {
1008
+ var queryParameters, headerParameters, _a, _b, response;
1009
+ return __generator(this, function (_c) {
1010
+ switch (_c.label) {
812
1011
  case 0:
813
- if (requestParameters.roleName === null || requestParameters.roleName === undefined) {
814
- throw new runtime.RequiredError('roleName', 'Required parameter requestParameters.roleName was null or undefined when calling updateRoleOwner.');
1012
+ if (requestParameters['roleName'] == null) {
1013
+ throw new runtime.RequiredError('roleName', 'Required parameter "roleName" was null or undefined when calling updateRoleOwner().');
815
1014
  }
816
- if (requestParameters.reqUpdateRoleOwner === null || requestParameters.reqUpdateRoleOwner === undefined) {
817
- throw new runtime.RequiredError('reqUpdateRoleOwner', 'Required parameter requestParameters.reqUpdateRoleOwner was null or undefined when calling updateRoleOwner.');
1015
+ if (requestParameters['reqUpdateRoleOwner'] == null) {
1016
+ throw new runtime.RequiredError('reqUpdateRoleOwner', 'Required parameter "reqUpdateRoleOwner" was null or undefined when calling updateRoleOwner().');
818
1017
  }
819
1018
  queryParameters = {};
820
- if (requestParameters.pretty !== undefined) {
821
- queryParameters['pretty'] = requestParameters.pretty;
822
- }
823
1019
  headerParameters = {};
824
1020
  headerParameters['Content-Type'] = 'application/json';
825
- if (this.configuration && this.configuration.apiKey) {
826
- headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
827
- }
828
- return [4 /*yield*/, this.request({
829
- path: "/security/role/updateOwner/{roleName}".replace("{" + "roleName" + "}", encodeURIComponent(String(requestParameters.roleName))),
830
- method: 'POST',
831
- headers: headerParameters,
832
- query: queryParameters,
833
- body: models_1.ReqUpdateRoleOwnerToJSON(requestParameters.reqUpdateRoleOwner),
834
- }, initOverrides)];
1021
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
1022
+ _a = headerParameters;
1023
+ _b = "X-Tapis-Token";
1024
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
835
1025
  case 1:
836
- response = _a.sent();
837
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespBasicFromJSON(jsonValue); })];
1026
+ _a[_b] = _c.sent(); // TapisJWT authentication
1027
+ _c.label = 2;
1028
+ case 2: return [4 /*yield*/, this.request({
1029
+ path: "/security/role/updateOwner/{roleName}".replace("{".concat("roleName", "}"), encodeURIComponent(String(requestParameters['roleName']))),
1030
+ method: 'POST',
1031
+ headers: headerParameters,
1032
+ query: queryParameters,
1033
+ body: (0, index_1.ReqUpdateRoleOwnerToJSON)(requestParameters['reqUpdateRoleOwner']),
1034
+ }, initOverrides)];
1035
+ case 3:
1036
+ response = _c.sent();
1037
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespBasicFromJSON)(jsonValue); })];
838
1038
  }
839
1039
  });
840
1040
  });