@tapis/tapis-typescript-sk 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/.openapi-generator/FILES +67 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +45 -0
  5. package/dist/apis/GeneralApi.d.ts +45 -0
  6. package/dist/apis/GeneralApi.js +199 -0
  7. package/dist/apis/RoleApi.d.ts +205 -0
  8. package/dist/apis/RoleApi.js +861 -0
  9. package/dist/apis/UserApi.d.ts +276 -0
  10. package/dist/apis/UserApi.js +1166 -0
  11. package/dist/apis/VaultApi.d.ts +195 -0
  12. package/dist/apis/VaultApi.js +740 -0
  13. package/dist/apis/index.d.ts +4 -0
  14. package/dist/apis/index.js +11 -0
  15. package/dist/index.d.ts +3 -0
  16. package/dist/index.js +10 -0
  17. package/dist/models/Options.d.ts +27 -0
  18. package/dist/models/Options.js +41 -0
  19. package/dist/models/ReqAddChildRole.d.ts +39 -0
  20. package/dist/models/ReqAddChildRole.js +45 -0
  21. package/dist/models/ReqAddRolePermission.d.ts +39 -0
  22. package/dist/models/ReqAddRolePermission.js +45 -0
  23. package/dist/models/ReqCreateRole.d.ts +39 -0
  24. package/dist/models/ReqCreateRole.js +45 -0
  25. package/dist/models/ReqGrantAdminRole.d.ts +33 -0
  26. package/dist/models/ReqGrantAdminRole.js +43 -0
  27. package/dist/models/ReqGrantUserPermission.d.ts +39 -0
  28. package/dist/models/ReqGrantUserPermission.js +45 -0
  29. package/dist/models/ReqGrantUserRole.d.ts +39 -0
  30. package/dist/models/ReqGrantUserRole.js +45 -0
  31. package/dist/models/ReqGrantUserRoleWithPermission.d.ts +45 -0
  32. package/dist/models/ReqGrantUserRoleWithPermission.js +47 -0
  33. package/dist/models/ReqPreviewPathPrefix.d.ts +63 -0
  34. package/dist/models/ReqPreviewPathPrefix.js +53 -0
  35. package/dist/models/ReqRemoveChildRole.d.ts +39 -0
  36. package/dist/models/ReqRemoveChildRole.js +45 -0
  37. package/dist/models/ReqRemoveRolePermission.d.ts +39 -0
  38. package/dist/models/ReqRemoveRolePermission.js +45 -0
  39. package/dist/models/ReqReplacePathPrefix.d.ts +63 -0
  40. package/dist/models/ReqReplacePathPrefix.js +53 -0
  41. package/dist/models/ReqRevokeAdminRole.d.ts +33 -0
  42. package/dist/models/ReqRevokeAdminRole.js +43 -0
  43. package/dist/models/ReqRevokeUserPermission.d.ts +39 -0
  44. package/dist/models/ReqRevokeUserPermission.js +45 -0
  45. package/dist/models/ReqRevokeUserRole.d.ts +39 -0
  46. package/dist/models/ReqRevokeUserRole.js +45 -0
  47. package/dist/models/ReqUpdateRoleDescription.d.ts +33 -0
  48. package/dist/models/ReqUpdateRoleDescription.js +43 -0
  49. package/dist/models/ReqUpdateRoleName.d.ts +33 -0
  50. package/dist/models/ReqUpdateRoleName.js +43 -0
  51. package/dist/models/ReqUpdateRoleOwner.d.ts +39 -0
  52. package/dist/models/ReqUpdateRoleOwner.js +45 -0
  53. package/dist/models/ReqUserHasRole.d.ts +45 -0
  54. package/dist/models/ReqUserHasRole.js +47 -0
  55. package/dist/models/ReqUserHasRoleMulti.d.ts +45 -0
  56. package/dist/models/ReqUserHasRoleMulti.js +47 -0
  57. package/dist/models/ReqUserIsAdmin.d.ts +33 -0
  58. package/dist/models/ReqUserIsAdmin.js +43 -0
  59. package/dist/models/ReqUserIsPermitted.d.ts +45 -0
  60. package/dist/models/ReqUserIsPermitted.js +47 -0
  61. package/dist/models/ReqUserIsPermittedMulti.d.ts +45 -0
  62. package/dist/models/ReqUserIsPermittedMulti.js +47 -0
  63. package/dist/models/ReqValidateServicePwd.d.ts +39 -0
  64. package/dist/models/ReqValidateServicePwd.js +45 -0
  65. package/dist/models/ReqVersions.d.ts +39 -0
  66. package/dist/models/ReqVersions.js +45 -0
  67. package/dist/models/ReqWriteSecret.d.ts +48 -0
  68. package/dist/models/ReqWriteSecret.js +48 -0
  69. package/dist/models/RespAuthorized.d.ts +46 -0
  70. package/dist/models/RespAuthorized.js +48 -0
  71. package/dist/models/RespBasic.d.ts +45 -0
  72. package/dist/models/RespBasic.js +47 -0
  73. package/dist/models/RespChangeCount.d.ts +46 -0
  74. package/dist/models/RespChangeCount.js +48 -0
  75. package/dist/models/RespName.d.ts +46 -0
  76. package/dist/models/RespName.js +48 -0
  77. package/dist/models/RespNameArray.d.ts +46 -0
  78. package/dist/models/RespNameArray.js +48 -0
  79. package/dist/models/RespPathPrefixes.d.ts +46 -0
  80. package/dist/models/RespPathPrefixes.js +48 -0
  81. package/dist/models/RespProbe.d.ts +46 -0
  82. package/dist/models/RespProbe.js +48 -0
  83. package/dist/models/RespResourceUrl.d.ts +46 -0
  84. package/dist/models/RespResourceUrl.js +48 -0
  85. package/dist/models/RespRole.d.ts +46 -0
  86. package/dist/models/RespRole.js +48 -0
  87. package/dist/models/RespSecret.d.ts +46 -0
  88. package/dist/models/RespSecret.js +48 -0
  89. package/dist/models/RespSecretList.d.ts +46 -0
  90. package/dist/models/RespSecretList.js +48 -0
  91. package/dist/models/RespSecretMeta.d.ts +46 -0
  92. package/dist/models/RespSecretMeta.js +48 -0
  93. package/dist/models/RespSecretVersionMetadata.d.ts +46 -0
  94. package/dist/models/RespSecretVersionMetadata.js +48 -0
  95. package/dist/models/RespVersions.d.ts +45 -0
  96. package/dist/models/RespVersions.js +47 -0
  97. package/dist/models/ResultAuthorized.d.ts +27 -0
  98. package/dist/models/ResultAuthorized.js +41 -0
  99. package/dist/models/ResultChangeCount.d.ts +27 -0
  100. package/dist/models/ResultChangeCount.js +41 -0
  101. package/dist/models/ResultName.d.ts +27 -0
  102. package/dist/models/ResultName.js +41 -0
  103. package/dist/models/ResultNameArray.d.ts +27 -0
  104. package/dist/models/ResultNameArray.js +41 -0
  105. package/dist/models/ResultResourceUrl.d.ts +27 -0
  106. package/dist/models/ResultResourceUrl.js +41 -0
  107. package/dist/models/SkProbe.d.ts +45 -0
  108. package/dist/models/SkProbe.js +47 -0
  109. package/dist/models/SkRole.d.ts +93 -0
  110. package/dist/models/SkRole.js +63 -0
  111. package/dist/models/SkSecret.d.ts +36 -0
  112. package/dist/models/SkSecret.js +44 -0
  113. package/dist/models/SkSecretList.d.ts +33 -0
  114. package/dist/models/SkSecretList.js +43 -0
  115. package/dist/models/SkSecretMetadata.d.ts +45 -0
  116. package/dist/models/SkSecretMetadata.js +47 -0
  117. package/dist/models/SkSecretVersion.d.ts +45 -0
  118. package/dist/models/SkSecretVersion.js +47 -0
  119. package/dist/models/SkSecretVersionMetadata.d.ts +58 -0
  120. package/dist/models/SkSecretVersionMetadata.js +52 -0
  121. package/dist/models/Transformation.d.ts +39 -0
  122. package/dist/models/Transformation.js +45 -0
  123. package/dist/models/index.d.ts +53 -0
  124. package/dist/models/index.js +60 -0
  125. package/dist/runtime.d.ts +140 -0
  126. package/dist/runtime.js +420 -0
  127. package/package.json +15 -0
  128. package/src/apis/GeneralApi.ts +117 -0
  129. package/src/apis/RoleApi.ts +782 -0
  130. package/src/apis/UserApi.ts +1047 -0
  131. package/src/apis/VaultApi.ts +802 -0
  132. package/src/apis/index.ts +6 -0
  133. package/src/index.ts +5 -0
  134. package/src/models/Options.ts +56 -0
  135. package/src/models/ReqAddChildRole.ts +72 -0
  136. package/src/models/ReqAddRolePermission.ts +72 -0
  137. package/src/models/ReqCreateRole.ts +72 -0
  138. package/src/models/ReqGrantAdminRole.ts +64 -0
  139. package/src/models/ReqGrantUserPermission.ts +72 -0
  140. package/src/models/ReqGrantUserRole.ts +72 -0
  141. package/src/models/ReqGrantUserRoleWithPermission.ts +80 -0
  142. package/src/models/ReqPreviewPathPrefix.ts +104 -0
  143. package/src/models/ReqRemoveChildRole.ts +72 -0
  144. package/src/models/ReqRemoveRolePermission.ts +72 -0
  145. package/src/models/ReqReplacePathPrefix.ts +104 -0
  146. package/src/models/ReqRevokeAdminRole.ts +64 -0
  147. package/src/models/ReqRevokeUserPermission.ts +72 -0
  148. package/src/models/ReqRevokeUserRole.ts +72 -0
  149. package/src/models/ReqUpdateRoleDescription.ts +64 -0
  150. package/src/models/ReqUpdateRoleName.ts +64 -0
  151. package/src/models/ReqUpdateRoleOwner.ts +72 -0
  152. package/src/models/ReqUserHasRole.ts +80 -0
  153. package/src/models/ReqUserHasRoleMulti.ts +80 -0
  154. package/src/models/ReqUserIsAdmin.ts +64 -0
  155. package/src/models/ReqUserIsPermitted.ts +80 -0
  156. package/src/models/ReqUserIsPermittedMulti.ts +80 -0
  157. package/src/models/ReqValidateServicePwd.ts +72 -0
  158. package/src/models/ReqVersions.ts +72 -0
  159. package/src/models/ReqWriteSecret.ts +87 -0
  160. package/src/models/RespAuthorized.ts +87 -0
  161. package/src/models/RespBasic.ts +80 -0
  162. package/src/models/RespChangeCount.ts +87 -0
  163. package/src/models/RespName.ts +87 -0
  164. package/src/models/RespNameArray.ts +87 -0
  165. package/src/models/RespPathPrefixes.ts +87 -0
  166. package/src/models/RespProbe.ts +87 -0
  167. package/src/models/RespResourceUrl.ts +87 -0
  168. package/src/models/RespRole.ts +87 -0
  169. package/src/models/RespSecret.ts +87 -0
  170. package/src/models/RespSecretList.ts +87 -0
  171. package/src/models/RespSecretMeta.ts +87 -0
  172. package/src/models/RespSecretVersionMetadata.ts +87 -0
  173. package/src/models/RespVersions.ts +80 -0
  174. package/src/models/ResultAuthorized.ts +56 -0
  175. package/src/models/ResultChangeCount.ts +56 -0
  176. package/src/models/ResultName.ts +56 -0
  177. package/src/models/ResultNameArray.ts +56 -0
  178. package/src/models/ResultResourceUrl.ts +56 -0
  179. package/src/models/SkProbe.ts +80 -0
  180. package/src/models/SkRole.ts +144 -0
  181. package/src/models/SkSecret.ts +71 -0
  182. package/src/models/SkSecretList.ts +64 -0
  183. package/src/models/SkSecretMetadata.ts +80 -0
  184. package/src/models/SkSecretVersion.ts +80 -0
  185. package/src/models/SkSecretVersionMetadata.ts +103 -0
  186. package/src/models/Transformation.ts +72 -0
  187. package/src/models/index.ts +55 -0
  188. package/src/runtime.ts +320 -0
  189. package/tsconfig.json +20 -0
@@ -0,0 +1,740 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Tapis Security API
6
+ * The Tapis Security API provides access to the Tapis Security Kernel authorization and secrets facilities.
7
+ *
8
+ * The version of the OpenAPI document: 0.1
9
+ * Contact: cicsupport@tacc.utexas.edu
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
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]; };
19
+ return function (d, b) {
20
+ extendStatics(d, b);
21
+ function __() { this.constructor = d; }
22
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23
+ };
24
+ })();
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ return new (P || (P = Promise))(function (resolve, reject) {
27
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
+ 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); }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ 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;
36
+ function verb(n) { return function (v) { return step([n, v]); }; }
37
+ function step(op) {
38
+ if (f) throw new TypeError("Generator is already executing.");
39
+ while (_) try {
40
+ 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
+ if (y = 0, t) op = [op[0] & 2, t.value];
42
+ switch (op[0]) {
43
+ case 0: case 1: t = op; break;
44
+ case 4: _.label++; return { value: op[1], done: false };
45
+ case 5: _.label++; y = op[1]; op = [0]; continue;
46
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
47
+ default:
48
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
49
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
50
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
51
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
52
+ if (t[2]) _.ops.pop();
53
+ _.trys.pop(); continue;
54
+ }
55
+ op = body.call(thisArg, _);
56
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
57
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
58
+ }
59
+ };
60
+ Object.defineProperty(exports, "__esModule", { value: true });
61
+ var runtime = require("../runtime");
62
+ var models_1 = require("../models");
63
+ /**
64
+ *
65
+ */
66
+ var VaultApi = /** @class */ (function (_super) {
67
+ __extends(VaultApi, _super);
68
+ function VaultApi() {
69
+ return _super !== null && _super.apply(this, arguments) || this;
70
+ }
71
+ /**
72
+ * Soft delete one or more versions of a secret. Each version can be deleted individually or as part of a group specified in the input array. Deletion can be reversed using the *secret/undelete/{secretName}* endpoint, which make this a _soft_ deletion operation. The input versions array is interpreted as follows: * [-] - empty = delete all versions * [0] - zero = delete only the latest version * [1, 3, ...] - list = delete the specified versions A valid tenant and user must also be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
73
+ */
74
+ VaultApi.prototype.deleteSecretRaw = function (requestParameters, initOverrides) {
75
+ return __awaiter(this, void 0, void 0, function () {
76
+ var queryParameters, headerParameters, response;
77
+ return __generator(this, function (_a) {
78
+ switch (_a.label) {
79
+ case 0:
80
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
81
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling deleteSecret.');
82
+ }
83
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
84
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling deleteSecret.');
85
+ }
86
+ if (requestParameters.reqVersions === null || requestParameters.reqVersions === undefined) {
87
+ throw new runtime.RequiredError('reqVersions', 'Required parameter requestParameters.reqVersions was null or undefined when calling deleteSecret.');
88
+ }
89
+ queryParameters = {};
90
+ if (requestParameters.pretty !== undefined) {
91
+ queryParameters['pretty'] = requestParameters.pretty;
92
+ }
93
+ if (requestParameters.sysid !== undefined) {
94
+ queryParameters['sysid'] = requestParameters.sysid;
95
+ }
96
+ if (requestParameters.sysuser !== undefined) {
97
+ queryParameters['sysuser'] = requestParameters.sysuser;
98
+ }
99
+ if (requestParameters.keytype !== undefined) {
100
+ queryParameters['keytype'] = requestParameters.keytype;
101
+ }
102
+ if (requestParameters.dbhost !== undefined) {
103
+ queryParameters['dbhost'] = requestParameters.dbhost;
104
+ }
105
+ if (requestParameters.dbname !== undefined) {
106
+ queryParameters['dbname'] = requestParameters.dbname;
107
+ }
108
+ if (requestParameters.dbservice !== undefined) {
109
+ queryParameters['dbservice'] = requestParameters.dbservice;
110
+ }
111
+ headerParameters = {};
112
+ headerParameters['Content-Type'] = 'application/json';
113
+ if (this.configuration && this.configuration.apiKey) {
114
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
115
+ }
116
+ return [4 /*yield*/, this.request({
117
+ path: "/security/vault/secret/delete/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
118
+ method: 'POST',
119
+ headers: headerParameters,
120
+ query: queryParameters,
121
+ body: models_1.ReqVersionsToJSON(requestParameters.reqVersions),
122
+ }, initOverrides)];
123
+ case 1:
124
+ response = _a.sent();
125
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespVersionsFromJSON(jsonValue); })];
126
+ }
127
+ });
128
+ });
129
+ };
130
+ /**
131
+ * Soft delete one or more versions of a secret. Each version can be deleted individually or as part of a group specified in the input array. Deletion can be reversed using the *secret/undelete/{secretName}* endpoint, which make this a _soft_ deletion operation. The input versions array is interpreted as follows: * [-] - empty = delete all versions * [0] - zero = delete only the latest version * [1, 3, ...] - list = delete the specified versions A valid tenant and user must also be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
132
+ */
133
+ VaultApi.prototype.deleteSecret = function (requestParameters, initOverrides) {
134
+ return __awaiter(this, void 0, void 0, function () {
135
+ var response;
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0: return [4 /*yield*/, this.deleteSecretRaw(requestParameters, initOverrides)];
139
+ case 1:
140
+ response = _a.sent();
141
+ return [4 /*yield*/, response.value()];
142
+ case 2: return [2 /*return*/, _a.sent()];
143
+ }
144
+ });
145
+ });
146
+ };
147
+ /**
148
+ * Destroy one or more versions of a secret. Destroy implements a hard delete which delete that cannot be undone. It does not, however, remove any metadata associated with the secret. The input versions array is interpreted as follows: * [-] - empty = destroy all versions * [0] - zero = destroy only the latest version * [1, 3, ...] - list = destroy the specified versions A valid tenant and user must be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
149
+ */
150
+ VaultApi.prototype.destroySecretRaw = function (requestParameters, initOverrides) {
151
+ return __awaiter(this, void 0, void 0, function () {
152
+ var queryParameters, headerParameters, response;
153
+ return __generator(this, function (_a) {
154
+ switch (_a.label) {
155
+ case 0:
156
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
157
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling destroySecret.');
158
+ }
159
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
160
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling destroySecret.');
161
+ }
162
+ if (requestParameters.reqVersions === null || requestParameters.reqVersions === undefined) {
163
+ throw new runtime.RequiredError('reqVersions', 'Required parameter requestParameters.reqVersions was null or undefined when calling destroySecret.');
164
+ }
165
+ queryParameters = {};
166
+ if (requestParameters.pretty !== undefined) {
167
+ queryParameters['pretty'] = requestParameters.pretty;
168
+ }
169
+ if (requestParameters.sysid !== undefined) {
170
+ queryParameters['sysid'] = requestParameters.sysid;
171
+ }
172
+ if (requestParameters.sysuser !== undefined) {
173
+ queryParameters['sysuser'] = requestParameters.sysuser;
174
+ }
175
+ if (requestParameters.keytype !== undefined) {
176
+ queryParameters['keytype'] = requestParameters.keytype;
177
+ }
178
+ if (requestParameters.dbhost !== undefined) {
179
+ queryParameters['dbhost'] = requestParameters.dbhost;
180
+ }
181
+ if (requestParameters.dbname !== undefined) {
182
+ queryParameters['dbname'] = requestParameters.dbname;
183
+ }
184
+ if (requestParameters.dbservice !== undefined) {
185
+ queryParameters['dbservice'] = requestParameters.dbservice;
186
+ }
187
+ headerParameters = {};
188
+ headerParameters['Content-Type'] = 'application/json';
189
+ if (this.configuration && this.configuration.apiKey) {
190
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
191
+ }
192
+ return [4 /*yield*/, this.request({
193
+ path: "/security/vault/secret/destroy/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
194
+ method: 'POST',
195
+ headers: headerParameters,
196
+ query: queryParameters,
197
+ body: models_1.ReqVersionsToJSON(requestParameters.reqVersions),
198
+ }, initOverrides)];
199
+ case 1:
200
+ response = _a.sent();
201
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespVersionsFromJSON(jsonValue); })];
202
+ }
203
+ });
204
+ });
205
+ };
206
+ /**
207
+ * Destroy one or more versions of a secret. Destroy implements a hard delete which delete that cannot be undone. It does not, however, remove any metadata associated with the secret. The input versions array is interpreted as follows: * [-] - empty = destroy all versions * [0] - zero = destroy only the latest version * [1, 3, ...] - list = destroy the specified versions A valid tenant and user must be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
208
+ */
209
+ VaultApi.prototype.destroySecret = function (requestParameters, initOverrides) {
210
+ return __awaiter(this, void 0, void 0, function () {
211
+ var response;
212
+ return __generator(this, function (_a) {
213
+ switch (_a.label) {
214
+ case 0: return [4 /*yield*/, this.destroySecretRaw(requestParameters, initOverrides)];
215
+ case 1:
216
+ response = _a.sent();
217
+ return [4 /*yield*/, response.value()];
218
+ case 2: return [2 /*return*/, _a.sent()];
219
+ }
220
+ });
221
+ });
222
+ };
223
+ /**
224
+ * Erase all traces of a secret: its key, all versions of its value and all its metadata. Specifying a folder erases all secrets in that folder. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
225
+ */
226
+ VaultApi.prototype.destroySecretMetaRaw = function (requestParameters, initOverrides) {
227
+ return __awaiter(this, void 0, void 0, function () {
228
+ var queryParameters, headerParameters, response;
229
+ return __generator(this, function (_a) {
230
+ switch (_a.label) {
231
+ case 0:
232
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
233
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling destroySecretMeta.');
234
+ }
235
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
236
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling destroySecretMeta.');
237
+ }
238
+ queryParameters = {};
239
+ if (requestParameters.tenant !== undefined) {
240
+ queryParameters['tenant'] = requestParameters.tenant;
241
+ }
242
+ if (requestParameters.user !== undefined) {
243
+ queryParameters['user'] = requestParameters.user;
244
+ }
245
+ if (requestParameters.pretty !== undefined) {
246
+ queryParameters['pretty'] = requestParameters.pretty;
247
+ }
248
+ if (requestParameters.sysid !== undefined) {
249
+ queryParameters['sysid'] = requestParameters.sysid;
250
+ }
251
+ if (requestParameters.sysuser !== undefined) {
252
+ queryParameters['sysuser'] = requestParameters.sysuser;
253
+ }
254
+ if (requestParameters.keytype !== undefined) {
255
+ queryParameters['keytype'] = requestParameters.keytype;
256
+ }
257
+ if (requestParameters.dbhost !== undefined) {
258
+ queryParameters['dbhost'] = requestParameters.dbhost;
259
+ }
260
+ if (requestParameters.dbname !== undefined) {
261
+ queryParameters['dbname'] = requestParameters.dbname;
262
+ }
263
+ if (requestParameters.dbservice !== undefined) {
264
+ queryParameters['dbservice'] = requestParameters.dbservice;
265
+ }
266
+ headerParameters = {};
267
+ if (this.configuration && this.configuration.apiKey) {
268
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
269
+ }
270
+ return [4 /*yield*/, this.request({
271
+ path: "/security/vault/secret/destroy/meta/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
272
+ method: 'DELETE',
273
+ headers: headerParameters,
274
+ query: queryParameters,
275
+ }, initOverrides)];
276
+ case 1:
277
+ response = _a.sent();
278
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespBasicFromJSON(jsonValue); })];
279
+ }
280
+ });
281
+ });
282
+ };
283
+ /**
284
+ * Erase all traces of a secret: its key, all versions of its value and all its metadata. Specifying a folder erases all secrets in that folder. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
285
+ */
286
+ VaultApi.prototype.destroySecretMeta = function (requestParameters, initOverrides) {
287
+ return __awaiter(this, void 0, void 0, function () {
288
+ var response;
289
+ return __generator(this, function (_a) {
290
+ switch (_a.label) {
291
+ case 0: return [4 /*yield*/, this.destroySecretMetaRaw(requestParameters, initOverrides)];
292
+ case 1:
293
+ response = _a.sent();
294
+ return [4 /*yield*/, response.value()];
295
+ case 2: return [2 /*return*/, _a.sent()];
296
+ }
297
+ });
298
+ });
299
+ };
300
+ /**
301
+ * List the secret names at the specified path. The path must represent a folder, not an actual secret name. If the path does not have a trailing slash one will be inserted. Secret names should not encode private information. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the secret name. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* path parameter and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
302
+ */
303
+ VaultApi.prototype.listSecretMetaRaw = function (requestParameters, initOverrides) {
304
+ return __awaiter(this, void 0, void 0, function () {
305
+ var queryParameters, headerParameters, response;
306
+ return __generator(this, function (_a) {
307
+ switch (_a.label) {
308
+ case 0:
309
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
310
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling listSecretMeta.');
311
+ }
312
+ queryParameters = {};
313
+ if (requestParameters.tenant !== undefined) {
314
+ queryParameters['tenant'] = requestParameters.tenant;
315
+ }
316
+ if (requestParameters.user !== undefined) {
317
+ queryParameters['user'] = requestParameters.user;
318
+ }
319
+ if (requestParameters.pretty !== undefined) {
320
+ queryParameters['pretty'] = requestParameters.pretty;
321
+ }
322
+ if (requestParameters.sysid !== undefined) {
323
+ queryParameters['sysid'] = requestParameters.sysid;
324
+ }
325
+ if (requestParameters.sysuser !== undefined) {
326
+ queryParameters['sysuser'] = requestParameters.sysuser;
327
+ }
328
+ if (requestParameters.keytype !== undefined) {
329
+ queryParameters['keytype'] = requestParameters.keytype;
330
+ }
331
+ if (requestParameters.dbhost !== undefined) {
332
+ queryParameters['dbhost'] = requestParameters.dbhost;
333
+ }
334
+ if (requestParameters.dbname !== undefined) {
335
+ queryParameters['dbname'] = requestParameters.dbname;
336
+ }
337
+ if (requestParameters.dbservice !== undefined) {
338
+ queryParameters['dbservice'] = requestParameters.dbservice;
339
+ }
340
+ headerParameters = {};
341
+ if (this.configuration && this.configuration.apiKey) {
342
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
343
+ }
344
+ return [4 /*yield*/, this.request({
345
+ path: "/security/vault/secret/list/meta/{secretType}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))),
346
+ method: 'GET',
347
+ headers: headerParameters,
348
+ query: queryParameters,
349
+ }, initOverrides)];
350
+ case 1:
351
+ response = _a.sent();
352
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespSecretListFromJSON(jsonValue); })];
353
+ }
354
+ });
355
+ });
356
+ };
357
+ /**
358
+ * List the secret names at the specified path. The path must represent a folder, not an actual secret name. If the path does not have a trailing slash one will be inserted. Secret names should not encode private information. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the secret name. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* path parameter and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
359
+ */
360
+ VaultApi.prototype.listSecretMeta = function (requestParameters, initOverrides) {
361
+ return __awaiter(this, void 0, void 0, function () {
362
+ var response;
363
+ return __generator(this, function (_a) {
364
+ switch (_a.label) {
365
+ case 0: return [4 /*yield*/, this.listSecretMetaRaw(requestParameters, initOverrides)];
366
+ case 1:
367
+ response = _a.sent();
368
+ return [4 /*yield*/, response.value()];
369
+ case 2: return [2 /*return*/, _a.sent()];
370
+ }
371
+ });
372
+ });
373
+ };
374
+ /**
375
+ * Read a versioned secret. By default, the latest version of the secret is read. If the *version* query parameter is specified then that version of the secret is read. The *version* parameter should be passed as an integer with zero indicating the latest version of the secret. A NOT FOUND status code is returned if the secret version does not exist or if it\'s deleted or destroyed. The response object includes the map of zero or more key/value pairs and metadata that describes the secret. The metadata includes which version of the secret was returned. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
376
+ */
377
+ VaultApi.prototype.readSecretRaw = function (requestParameters, initOverrides) {
378
+ return __awaiter(this, void 0, void 0, function () {
379
+ var queryParameters, headerParameters, response;
380
+ return __generator(this, function (_a) {
381
+ switch (_a.label) {
382
+ case 0:
383
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
384
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling readSecret.');
385
+ }
386
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
387
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling readSecret.');
388
+ }
389
+ queryParameters = {};
390
+ if (requestParameters.tenant !== undefined) {
391
+ queryParameters['tenant'] = requestParameters.tenant;
392
+ }
393
+ if (requestParameters.user !== undefined) {
394
+ queryParameters['user'] = requestParameters.user;
395
+ }
396
+ if (requestParameters.version !== undefined) {
397
+ queryParameters['version'] = requestParameters.version;
398
+ }
399
+ if (requestParameters.pretty !== undefined) {
400
+ queryParameters['pretty'] = requestParameters.pretty;
401
+ }
402
+ if (requestParameters.sysid !== undefined) {
403
+ queryParameters['sysid'] = requestParameters.sysid;
404
+ }
405
+ if (requestParameters.sysuser !== undefined) {
406
+ queryParameters['sysuser'] = requestParameters.sysuser;
407
+ }
408
+ if (requestParameters.keytype !== undefined) {
409
+ queryParameters['keytype'] = requestParameters.keytype;
410
+ }
411
+ if (requestParameters.dbhost !== undefined) {
412
+ queryParameters['dbhost'] = requestParameters.dbhost;
413
+ }
414
+ if (requestParameters.dbname !== undefined) {
415
+ queryParameters['dbname'] = requestParameters.dbname;
416
+ }
417
+ if (requestParameters.dbservice !== undefined) {
418
+ queryParameters['dbservice'] = requestParameters.dbservice;
419
+ }
420
+ headerParameters = {};
421
+ if (this.configuration && this.configuration.apiKey) {
422
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
423
+ }
424
+ return [4 /*yield*/, this.request({
425
+ path: "/security/vault/secret/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
426
+ method: 'GET',
427
+ headers: headerParameters,
428
+ query: queryParameters,
429
+ }, initOverrides)];
430
+ case 1:
431
+ response = _a.sent();
432
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespSecretFromJSON(jsonValue); })];
433
+ }
434
+ });
435
+ });
436
+ };
437
+ /**
438
+ * Read a versioned secret. By default, the latest version of the secret is read. If the *version* query parameter is specified then that version of the secret is read. The *version* parameter should be passed as an integer with zero indicating the latest version of the secret. A NOT FOUND status code is returned if the secret version does not exist or if it\'s deleted or destroyed. The response object includes the map of zero or more key/value pairs and metadata that describes the secret. The metadata includes which version of the secret was returned. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
439
+ */
440
+ VaultApi.prototype.readSecret = function (requestParameters, initOverrides) {
441
+ return __awaiter(this, void 0, void 0, function () {
442
+ var response;
443
+ return __generator(this, function (_a) {
444
+ switch (_a.label) {
445
+ case 0: return [4 /*yield*/, this.readSecretRaw(requestParameters, initOverrides)];
446
+ case 1:
447
+ response = _a.sent();
448
+ return [4 /*yield*/, response.value()];
449
+ case 2: return [2 /*return*/, _a.sent()];
450
+ }
451
+ });
452
+ });
453
+ };
454
+ /**
455
+ * List a secret\'s metadata including its version information. The input parameter must be a secret name, not a folder. The result includes which version of the secret is the latest. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
456
+ */
457
+ VaultApi.prototype.readSecretMetaRaw = function (requestParameters, initOverrides) {
458
+ return __awaiter(this, void 0, void 0, function () {
459
+ var queryParameters, headerParameters, response;
460
+ return __generator(this, function (_a) {
461
+ switch (_a.label) {
462
+ case 0:
463
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
464
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling readSecretMeta.');
465
+ }
466
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
467
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling readSecretMeta.');
468
+ }
469
+ queryParameters = {};
470
+ if (requestParameters.tenant !== undefined) {
471
+ queryParameters['tenant'] = requestParameters.tenant;
472
+ }
473
+ if (requestParameters.user !== undefined) {
474
+ queryParameters['user'] = requestParameters.user;
475
+ }
476
+ if (requestParameters.pretty !== undefined) {
477
+ queryParameters['pretty'] = requestParameters.pretty;
478
+ }
479
+ if (requestParameters.sysid !== undefined) {
480
+ queryParameters['sysid'] = requestParameters.sysid;
481
+ }
482
+ if (requestParameters.sysuser !== undefined) {
483
+ queryParameters['sysuser'] = requestParameters.sysuser;
484
+ }
485
+ if (requestParameters.keytype !== undefined) {
486
+ queryParameters['keytype'] = requestParameters.keytype;
487
+ }
488
+ if (requestParameters.dbhost !== undefined) {
489
+ queryParameters['dbhost'] = requestParameters.dbhost;
490
+ }
491
+ if (requestParameters.dbname !== undefined) {
492
+ queryParameters['dbname'] = requestParameters.dbname;
493
+ }
494
+ if (requestParameters.dbservice !== undefined) {
495
+ queryParameters['dbservice'] = requestParameters.dbservice;
496
+ }
497
+ headerParameters = {};
498
+ if (this.configuration && this.configuration.apiKey) {
499
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
500
+ }
501
+ return [4 /*yield*/, this.request({
502
+ path: "/security/vault/secret/read/meta/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
503
+ method: 'GET',
504
+ headers: headerParameters,
505
+ query: queryParameters,
506
+ }, initOverrides)];
507
+ case 1:
508
+ response = _a.sent();
509
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespSecretVersionMetadataFromJSON(jsonValue); })];
510
+ }
511
+ });
512
+ });
513
+ };
514
+ /**
515
+ * List a secret\'s metadata including its version information. The input parameter must be a secret name, not a folder. The result includes which version of the secret is the latest. A valid tenant and user must be specified as query parameters. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
516
+ */
517
+ VaultApi.prototype.readSecretMeta = function (requestParameters, initOverrides) {
518
+ return __awaiter(this, void 0, void 0, function () {
519
+ var response;
520
+ return __generator(this, function (_a) {
521
+ switch (_a.label) {
522
+ case 0: return [4 /*yield*/, this.readSecretMetaRaw(requestParameters, initOverrides)];
523
+ case 1:
524
+ response = _a.sent();
525
+ return [4 /*yield*/, response.value()];
526
+ case 2: return [2 /*return*/, _a.sent()];
527
+ }
528
+ });
529
+ });
530
+ };
531
+ /**
532
+ * Restore one or more versions of a secret that have previously been deleted. This endpoint undoes soft deletions performed using the *secret/delete/{secretType}/{secretName}* endpoint. The input versions array is interpreted as follows: * [-] - empty = undelete all versions * [0] - zero = undelete only the latest version * [1, 3, ...] - list = undelete the specified versions A valid tenant and user must be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
533
+ */
534
+ VaultApi.prototype.undeleteSecretRaw = function (requestParameters, initOverrides) {
535
+ return __awaiter(this, void 0, void 0, function () {
536
+ var queryParameters, headerParameters, response;
537
+ return __generator(this, function (_a) {
538
+ switch (_a.label) {
539
+ case 0:
540
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
541
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling undeleteSecret.');
542
+ }
543
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
544
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling undeleteSecret.');
545
+ }
546
+ if (requestParameters.reqVersions === null || requestParameters.reqVersions === undefined) {
547
+ throw new runtime.RequiredError('reqVersions', 'Required parameter requestParameters.reqVersions was null or undefined when calling undeleteSecret.');
548
+ }
549
+ queryParameters = {};
550
+ if (requestParameters.pretty !== undefined) {
551
+ queryParameters['pretty'] = requestParameters.pretty;
552
+ }
553
+ if (requestParameters.sysid !== undefined) {
554
+ queryParameters['sysid'] = requestParameters.sysid;
555
+ }
556
+ if (requestParameters.sysuser !== undefined) {
557
+ queryParameters['sysuser'] = requestParameters.sysuser;
558
+ }
559
+ if (requestParameters.keytype !== undefined) {
560
+ queryParameters['keytype'] = requestParameters.keytype;
561
+ }
562
+ if (requestParameters.dbhost !== undefined) {
563
+ queryParameters['dbhost'] = requestParameters.dbhost;
564
+ }
565
+ if (requestParameters.dbname !== undefined) {
566
+ queryParameters['dbname'] = requestParameters.dbname;
567
+ }
568
+ if (requestParameters.dbservice !== undefined) {
569
+ queryParameters['dbservice'] = requestParameters.dbservice;
570
+ }
571
+ headerParameters = {};
572
+ headerParameters['Content-Type'] = 'application/json';
573
+ if (this.configuration && this.configuration.apiKey) {
574
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
575
+ }
576
+ return [4 /*yield*/, this.request({
577
+ path: "/security/vault/secret/undelete/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
578
+ method: 'POST',
579
+ headers: headerParameters,
580
+ query: queryParameters,
581
+ body: models_1.ReqVersionsToJSON(requestParameters.reqVersions),
582
+ }, initOverrides)];
583
+ case 1:
584
+ response = _a.sent();
585
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespVersionsFromJSON(jsonValue); })];
586
+ }
587
+ });
588
+ });
589
+ };
590
+ /**
591
+ * Restore one or more versions of a secret that have previously been deleted. This endpoint undoes soft deletions performed using the *secret/delete/{secretType}/{secretName}* endpoint. The input versions array is interpreted as follows: * [-] - empty = undelete all versions * [0] - zero = undelete only the latest version * [1, 3, ...] - list = undelete the specified versions A valid tenant and user must be specified in the body. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
592
+ */
593
+ VaultApi.prototype.undeleteSecret = function (requestParameters, initOverrides) {
594
+ return __awaiter(this, void 0, void 0, function () {
595
+ var response;
596
+ return __generator(this, function (_a) {
597
+ switch (_a.label) {
598
+ case 0: return [4 /*yield*/, this.undeleteSecretRaw(requestParameters, initOverrides)];
599
+ case 1:
600
+ response = _a.sent();
601
+ return [4 /*yield*/, response.value()];
602
+ case 2: return [2 /*return*/, _a.sent()];
603
+ }
604
+ });
605
+ });
606
+ };
607
+ /**
608
+ * Validate a service\'s password. The JSON payload contains the password that needs to be validated against the password stored in the vault for the service specifiedin the X-Tapis-User header. The secret name is the path under whichthe password was stored. A valid tenant and user must also be specified in the payload. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. Only services can make this request.
609
+ */
610
+ VaultApi.prototype.validateServicePasswordRaw = function (requestParameters, initOverrides) {
611
+ return __awaiter(this, void 0, void 0, function () {
612
+ var queryParameters, headerParameters, response;
613
+ return __generator(this, function (_a) {
614
+ switch (_a.label) {
615
+ case 0:
616
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
617
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling validateServicePassword.');
618
+ }
619
+ if (requestParameters.reqValidateServicePwd === null || requestParameters.reqValidateServicePwd === undefined) {
620
+ throw new runtime.RequiredError('reqValidateServicePwd', 'Required parameter requestParameters.reqValidateServicePwd was null or undefined when calling validateServicePassword.');
621
+ }
622
+ queryParameters = {};
623
+ if (requestParameters.pretty !== undefined) {
624
+ queryParameters['pretty'] = requestParameters.pretty;
625
+ }
626
+ headerParameters = {};
627
+ headerParameters['Content-Type'] = 'application/json';
628
+ if (this.configuration && this.configuration.apiKey) {
629
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
630
+ }
631
+ return [4 /*yield*/, this.request({
632
+ path: "/security/vault/secret/validateServicePassword/{secretName}".replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
633
+ method: 'POST',
634
+ headers: headerParameters,
635
+ query: queryParameters,
636
+ body: models_1.ReqValidateServicePwdToJSON(requestParameters.reqValidateServicePwd),
637
+ }, initOverrides)];
638
+ case 1:
639
+ response = _a.sent();
640
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespAuthorizedFromJSON(jsonValue); })];
641
+ }
642
+ });
643
+ });
644
+ };
645
+ /**
646
+ * Validate a service\'s password. The JSON payload contains the password that needs to be validated against the password stored in the vault for the service specifiedin the X-Tapis-User header. The secret name is the path under whichthe password was stored. A valid tenant and user must also be specified in the payload. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. Only services can make this request.
647
+ */
648
+ VaultApi.prototype.validateServicePassword = function (requestParameters, initOverrides) {
649
+ return __awaiter(this, void 0, void 0, function () {
650
+ var response;
651
+ return __generator(this, function (_a) {
652
+ switch (_a.label) {
653
+ case 0: return [4 /*yield*/, this.validateServicePasswordRaw(requestParameters, initOverrides)];
654
+ case 1:
655
+ response = _a.sent();
656
+ return [4 /*yield*/, response.value()];
657
+ case 2: return [2 /*return*/, _a.sent()];
658
+ }
659
+ });
660
+ });
661
+ };
662
+ /**
663
+ * Create or update a secret. The JSON payload contains a required *data* object and an optional *options* object. It also contains the required tenant and user fields. The *data* object is a JSON object that contains one or more key/value pairs in which both the key and value are strings. These are the individual secrets that are saved under the path name. The secrets are automatically versioned, which allows a pre-configured number of past secret values to be accessible even after new values are assigned. See the various GET operations for details on how to access different aspects of secrets. NOTE: The *cas* option is currently ignored but documented here for future reference. The *options* object can contain a *cas* key and with an integer value that represents a secret version. CAS stands for check-and-set and will check an existing secret\'s version before updating. If cas is not set the write will be always be allowed. If set to 0, a write will only be allowed if the key doesn’t exist. If the index is greater than zero, then the write will only be allowed if the key’s current version matches the version specified in the cas parameter. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
664
+ */
665
+ VaultApi.prototype.writeSecretRaw = function (requestParameters, initOverrides) {
666
+ return __awaiter(this, void 0, void 0, function () {
667
+ var queryParameters, headerParameters, response;
668
+ return __generator(this, function (_a) {
669
+ switch (_a.label) {
670
+ case 0:
671
+ if (requestParameters.secretType === null || requestParameters.secretType === undefined) {
672
+ throw new runtime.RequiredError('secretType', 'Required parameter requestParameters.secretType was null or undefined when calling writeSecret.');
673
+ }
674
+ if (requestParameters.secretName === null || requestParameters.secretName === undefined) {
675
+ throw new runtime.RequiredError('secretName', 'Required parameter requestParameters.secretName was null or undefined when calling writeSecret.');
676
+ }
677
+ if (requestParameters.reqWriteSecret === null || requestParameters.reqWriteSecret === undefined) {
678
+ throw new runtime.RequiredError('reqWriteSecret', 'Required parameter requestParameters.reqWriteSecret was null or undefined when calling writeSecret.');
679
+ }
680
+ queryParameters = {};
681
+ if (requestParameters.pretty !== undefined) {
682
+ queryParameters['pretty'] = requestParameters.pretty;
683
+ }
684
+ if (requestParameters.sysid !== undefined) {
685
+ queryParameters['sysid'] = requestParameters.sysid;
686
+ }
687
+ if (requestParameters.sysuser !== undefined) {
688
+ queryParameters['sysuser'] = requestParameters.sysuser;
689
+ }
690
+ if (requestParameters.keytype !== undefined) {
691
+ queryParameters['keytype'] = requestParameters.keytype;
692
+ }
693
+ if (requestParameters.dbhost !== undefined) {
694
+ queryParameters['dbhost'] = requestParameters.dbhost;
695
+ }
696
+ if (requestParameters.dbname !== undefined) {
697
+ queryParameters['dbname'] = requestParameters.dbname;
698
+ }
699
+ if (requestParameters.dbservice !== undefined) {
700
+ queryParameters['dbservice'] = requestParameters.dbservice;
701
+ }
702
+ headerParameters = {};
703
+ headerParameters['Content-Type'] = 'application/json';
704
+ if (this.configuration && this.configuration.apiKey) {
705
+ headerParameters["X-Tapis-Token"] = this.configuration.apiKey("X-Tapis-Token"); // TapisJWT authentication
706
+ }
707
+ return [4 /*yield*/, this.request({
708
+ path: "/security/vault/secret/{secretType}/{secretName}".replace("{" + "secretType" + "}", encodeURIComponent(String(requestParameters.secretType))).replace("{" + "secretName" + "}", encodeURIComponent(String(requestParameters.secretName))),
709
+ method: 'POST',
710
+ headers: headerParameters,
711
+ query: queryParameters,
712
+ body: models_1.ReqWriteSecretToJSON(requestParameters.reqWriteSecret),
713
+ }, initOverrides)];
714
+ case 1:
715
+ response = _a.sent();
716
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.RespSecretMetaFromJSON(jsonValue); })];
717
+ }
718
+ });
719
+ });
720
+ };
721
+ /**
722
+ * Create or update a secret. The JSON payload contains a required *data* object and an optional *options* object. It also contains the required tenant and user fields. The *data* object is a JSON object that contains one or more key/value pairs in which both the key and value are strings. These are the individual secrets that are saved under the path name. The secrets are automatically versioned, which allows a pre-configured number of past secret values to be accessible even after new values are assigned. See the various GET operations for details on how to access different aspects of secrets. NOTE: The *cas* option is currently ignored but documented here for future reference. The *options* object can contain a *cas* key and with an integer value that represents a secret version. CAS stands for check-and-set and will check an existing secret\'s version before updating. If cas is not set the write will be always be allowed. If set to 0, a write will only be allowed if the key doesn’t exist. If the index is greater than zero, then the write will only be allowed if the key’s current version matches the version specified in the cas parameter. ### Naming Secrets Secrets can be arranged hierarchically by using the \"+\" characters in the *secretName*. These characters will be converted to slashes upon receipt, allowing secrets to be arranged in folders. A secret is assigned a path name constructed from the *secretType* and *secretName* path parameters and, optionally, from query parameters determined by the *secretType*. Each *secretType* determines a specific transformation from the url path to a path in the vault. The *secretType* may require certain query parameters to be present on the request in order to construct the vault path. See the next section for details. ### Secret Types The list below documents each *secretType* and their applicable query parameters. Highlighted parameter names indicate required parameters. When present, default values are listed first and also highlighted. - **system** - *sysid*: the unique system id - *sysuser*: the accessing user (except when keytype=cert) - keytype: *sshkey* | password | accesskey | cert - **dbcred** - *dbhost*: the DBMS hostname, IP address or alias - *dbname*: the database name or alias - *dbservice*: service name - **jwtsigning** - *no query parameters* - **user** - *no query parameters* - **service** - *no query parameters* ### Authorization Requestors are authorized based on the secret type specified in the URL path. The following authorizations are enforced: - system: limited to the systems service - dbcred: any service - jwtsigning: limited to the tokens service - user: any user - service: any service
723
+ */
724
+ VaultApi.prototype.writeSecret = function (requestParameters, initOverrides) {
725
+ return __awaiter(this, void 0, void 0, function () {
726
+ var response;
727
+ return __generator(this, function (_a) {
728
+ switch (_a.label) {
729
+ case 0: return [4 /*yield*/, this.writeSecretRaw(requestParameters, initOverrides)];
730
+ case 1:
731
+ response = _a.sent();
732
+ return [4 /*yield*/, response.value()];
733
+ case 2: return [2 /*return*/, _a.sent()];
734
+ }
735
+ });
736
+ });
737
+ };
738
+ return VaultApi;
739
+ }(runtime.BaseAPI));
740
+ exports.VaultApi = VaultApi;