@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
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Tapis Security API
3
+ * The Tapis Security API provides for management of Security Kernel (SK) role-based authorization and secrets resources.
4
+ *
5
+ * The version of the OpenAPI document: 1.8.2
6
+ * Contact: cicsupport@tacc.utexas.edu
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { ReqShareResource, RespBoolean, RespChangeCount, RespResourceUrl, RespShare, RespShareList } from '../models/index';
14
+ export interface DeleteShareRequest {
15
+ grantor?: string;
16
+ grantee?: string;
17
+ tenant?: string;
18
+ resourceType?: string;
19
+ resourceId1?: string;
20
+ resourceId2?: string;
21
+ privilege?: string;
22
+ }
23
+ export interface DeleteShareByIdRequest {
24
+ id: number;
25
+ tenant?: string;
26
+ }
27
+ export interface GetShareRequest {
28
+ id: number;
29
+ tenant?: string;
30
+ }
31
+ export interface GetSharesRequest {
32
+ grantor?: string;
33
+ grantee?: string;
34
+ tenant?: string;
35
+ resourceType?: string;
36
+ resourceId1?: string;
37
+ resourceId2?: string;
38
+ privilege?: string;
39
+ createdBy?: string;
40
+ createdByTenant?: string;
41
+ includePublicGrantees?: boolean;
42
+ requireNullId2?: boolean;
43
+ id?: number;
44
+ }
45
+ export interface HasPrivilegeRequest {
46
+ grantee?: string;
47
+ tenant?: string;
48
+ resourceType?: string;
49
+ resourceId1?: string;
50
+ resourceId2?: string;
51
+ privilege?: string;
52
+ excludePublic?: boolean;
53
+ excludePublicNoAuthn?: boolean;
54
+ }
55
+ export interface ShareResourceRequest {
56
+ reqShareResource: ReqShareResource;
57
+ }
58
+ /**
59
+ *
60
+ */
61
+ export declare class ShareApi extends runtime.BaseAPI {
62
+ /**
63
+ * Delete a single shared resource by unique attribute selection. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that granted the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
64
+ */
65
+ deleteShareRaw(requestParameters: DeleteShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespChangeCount>>;
66
+ /**
67
+ * Delete a single shared resource by unique attribute selection. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that granted the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
68
+ */
69
+ deleteShare(requestParameters?: DeleteShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespChangeCount>;
70
+ /**
71
+ * Delete a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that created the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
72
+ */
73
+ deleteShareByIdRaw(requestParameters: DeleteShareByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespChangeCount>>;
74
+ /**
75
+ * Delete a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that created the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
76
+ */
77
+ deleteShareById(requestParameters: DeleteShareByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespChangeCount>;
78
+ /**
79
+ * Get a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. For the request to be authorized, the requestor must be a Tapis service.
80
+ */
81
+ getShareRaw(requestParameters: GetShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespShare>>;
82
+ /**
83
+ * Get a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. For the request to be authorized, the requestor must be a Tapis service.
84
+ */
85
+ getShare(requestParameters: GetShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespShare>;
86
+ /**
87
+ * Get a filtered list of shared resources. Query parameters are used to restrict the returned shares. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1*, *resourceId2*, *privilege*, *createdBy* and *createdByTenant* parameters are used to match values in shared resource objects. Other query parameters are used to control how matching is performed. The *tenant* parameter is required. If resourceId1 or resourceId2 end with a percent sign (%) wildcard then the search results will include all shares with IDs that begin with the same prefix string. Percent signs embedded elsewhere in the string are *not* recognized as wildcards. Specifying the *id* parameter causes the other filtering parameters to be ignored. The result list will contain at most one entry. The *includePublicGrantees* flag, true by default, controls whether resources granted to **~public** and **~public_no_authn** are also considered for inclusion in the result list. The *requireNullId2* flag, true by default, applies only when no *resourceId2* value is provided. When set, only shared resources that do not specify a *resourceId2* value are considered for inclusion in the result list. By setting this flag to false the caller indicates a \"don\'t care\" designation on the *resourceId2* value, allowing shares with any *resourceId2* value to be considered for inclusion in the result list. For the request to be authorized, the requestor must be a Tapis service.
88
+ */
89
+ getSharesRaw(requestParameters: GetSharesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespShareList>>;
90
+ /**
91
+ * Get a filtered list of shared resources. Query parameters are used to restrict the returned shares. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1*, *resourceId2*, *privilege*, *createdBy* and *createdByTenant* parameters are used to match values in shared resource objects. Other query parameters are used to control how matching is performed. The *tenant* parameter is required. If resourceId1 or resourceId2 end with a percent sign (%) wildcard then the search results will include all shares with IDs that begin with the same prefix string. Percent signs embedded elsewhere in the string are *not* recognized as wildcards. Specifying the *id* parameter causes the other filtering parameters to be ignored. The result list will contain at most one entry. The *includePublicGrantees* flag, true by default, controls whether resources granted to **~public** and **~public_no_authn** are also considered for inclusion in the result list. The *requireNullId2* flag, true by default, applies only when no *resourceId2* value is provided. When set, only shared resources that do not specify a *resourceId2* value are considered for inclusion in the result list. By setting this flag to false the caller indicates a \"don\'t care\" designation on the *resourceId2* value, allowing shares with any *resourceId2* value to be considered for inclusion in the result list. For the request to be authorized, the requestor must be a Tapis service.
92
+ */
93
+ getShares(requestParameters?: GetSharesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespShareList>;
94
+ /**
95
+ * Determine if a user has been granted a specific privilege on a specific resource. The *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. Privilege matching is performed for the grantee and tenant specified in the query parameters. True is returned if the user has been granted the privilege, false otherwise. By default, both authenticated and unauthenticated public privileges are included in the calculation. For example, if a privilege on a resource has been granted to all authenticated users in a tenant (~public), then true will be returned for all users in the tenant. The *excludePublic* and *excludePublicNoAuthn* parameters can be used to change the default handling of public grants. Either or both types of public grants can be excluded. For the request to be authorized, the requestor must be a Tapis service.
96
+ */
97
+ hasPrivilegeRaw(requestParameters: HasPrivilegeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespBoolean>>;
98
+ /**
99
+ * Determine if a user has been granted a specific privilege on a specific resource. The *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. Privilege matching is performed for the grantee and tenant specified in the query parameters. True is returned if the user has been granted the privilege, false otherwise. By default, both authenticated and unauthenticated public privileges are included in the calculation. For example, if a privilege on a resource has been granted to all authenticated users in a tenant (~public), then true will be returned for all users in the tenant. The *excludePublic* and *excludePublicNoAuthn* parameters can be used to change the default handling of public grants. Either or both types of public grants can be excluded. For the request to be authorized, the requestor must be a Tapis service.
100
+ */
101
+ hasPrivilege(requestParameters?: HasPrivilegeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespBoolean>;
102
+ /**
103
+ * Share a Tapis resource using a request body. Shared resources allow services to indicate that other services should relax their Tapis authorization checking in certain, well-defined contexts. Grantees can be given shared access to a resource on an individual basis or by using the public granting mechanism. Grants to the distinguished **~public** and **~public_no_authn** pseudo-grantees allow access to a resource to authenticated users or to any user, respectively. The payload for this request includes these values, with all except *resourceId2* required: - grantor - grantee - tenant - resourceType - resourceId1 - resourceId2 - privilege If the share already exists, then this call has no effect. For the request to be authorized, the requestor must be a Tapis service.
104
+ */
105
+ shareResourceRaw(requestParameters: ShareResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespResourceUrl>>;
106
+ /**
107
+ * Share a Tapis resource using a request body. Shared resources allow services to indicate that other services should relax their Tapis authorization checking in certain, well-defined contexts. Grantees can be given shared access to a resource on an individual basis or by using the public granting mechanism. Grants to the distinguished **~public** and **~public_no_authn** pseudo-grantees allow access to a resource to authenticated users or to any user, respectively. The payload for this request includes these values, with all except *resourceId2* required: - grantor - grantee - tenant - resourceType - resourceId1 - resourceId2 - privilege If the share already exists, then this call has no effect. For the request to be authorized, the requestor must be a Tapis service.
108
+ */
109
+ shareResource(requestParameters: ShareResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespResourceUrl>;
110
+ }
@@ -0,0 +1,469 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Tapis Security API
6
+ * The Tapis Security API provides for management of Security Kernel (SK) role-based authorization and secrets resources.
7
+ *
8
+ * The version of the OpenAPI document: 1.8.2
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 = 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
+ };
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");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
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); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
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;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
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;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.ShareApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ShareApi = /** @class */ (function (_super) {
74
+ __extends(ShareApi, _super);
75
+ function ShareApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Delete a single shared resource by unique attribute selection. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that granted the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
80
+ */
81
+ ShareApi.prototype.deleteShareRaw = function (requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, _a, _b, response;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0:
87
+ queryParameters = {};
88
+ if (requestParameters['grantor'] != null) {
89
+ queryParameters['grantor'] = requestParameters['grantor'];
90
+ }
91
+ if (requestParameters['grantee'] != null) {
92
+ queryParameters['grantee'] = requestParameters['grantee'];
93
+ }
94
+ if (requestParameters['tenant'] != null) {
95
+ queryParameters['tenant'] = requestParameters['tenant'];
96
+ }
97
+ if (requestParameters['resourceType'] != null) {
98
+ queryParameters['resourceType'] = requestParameters['resourceType'];
99
+ }
100
+ if (requestParameters['resourceId1'] != null) {
101
+ queryParameters['resourceId1'] = requestParameters['resourceId1'];
102
+ }
103
+ if (requestParameters['resourceId2'] != null) {
104
+ queryParameters['resourceId2'] = requestParameters['resourceId2'];
105
+ }
106
+ if (requestParameters['privilege'] != null) {
107
+ queryParameters['privilege'] = requestParameters['privilege'];
108
+ }
109
+ headerParameters = {};
110
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
111
+ _a = headerParameters;
112
+ _b = "X-Tapis-Token";
113
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
114
+ case 1:
115
+ _a[_b] = _c.sent(); // TapisJWT authentication
116
+ _c.label = 2;
117
+ case 2: return [4 /*yield*/, this.request({
118
+ path: "/security/share",
119
+ method: 'DELETE',
120
+ headers: headerParameters,
121
+ query: queryParameters,
122
+ }, initOverrides)];
123
+ case 3:
124
+ response = _c.sent();
125
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
126
+ }
127
+ });
128
+ });
129
+ };
130
+ /**
131
+ * Delete a single shared resource by unique attribute selection. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that granted the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
132
+ */
133
+ ShareApi.prototype.deleteShare = function () {
134
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
135
+ var response;
136
+ if (requestParameters === void 0) { requestParameters = {}; }
137
+ return __generator(this, function (_a) {
138
+ switch (_a.label) {
139
+ case 0: return [4 /*yield*/, this.deleteShareRaw(requestParameters, initOverrides)];
140
+ case 1:
141
+ response = _a.sent();
142
+ return [4 /*yield*/, response.value()];
143
+ case 2: return [2 /*return*/, _a.sent()];
144
+ }
145
+ });
146
+ });
147
+ };
148
+ /**
149
+ * Delete a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that created the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
150
+ */
151
+ ShareApi.prototype.deleteShareByIdRaw = function (requestParameters, initOverrides) {
152
+ return __awaiter(this, void 0, void 0, function () {
153
+ var queryParameters, headerParameters, _a, _b, response;
154
+ return __generator(this, function (_c) {
155
+ switch (_c.label) {
156
+ case 0:
157
+ if (requestParameters['id'] == null) {
158
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteShareById().');
159
+ }
160
+ queryParameters = {};
161
+ if (requestParameters['tenant'] != null) {
162
+ queryParameters['tenant'] = requestParameters['tenant'];
163
+ }
164
+ headerParameters = {};
165
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
166
+ _a = headerParameters;
167
+ _b = "X-Tapis-Token";
168
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
169
+ case 1:
170
+ _a[_b] = _c.sent(); // TapisJWT authentication
171
+ _c.label = 2;
172
+ case 2: return [4 /*yield*/, this.request({
173
+ path: "/security/share/{id}".replace("{".concat("id", "}"), encodeURIComponent(String(requestParameters['id']))),
174
+ method: 'DELETE',
175
+ headers: headerParameters,
176
+ query: queryParameters,
177
+ }, initOverrides)];
178
+ case 3:
179
+ response = _c.sent();
180
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespChangeCountFromJSON)(jsonValue); })];
181
+ }
182
+ });
183
+ });
184
+ };
185
+ /**
186
+ * Delete a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. The calling service must also be the same as the orginal service that created the share. This call is idempotent. If no share satisfies the above constraints, a success response code is returned and the indicated number of changes is set to zero. When a share is deleted, the indicated number of changes is one. For the request to be authorized, the requestor must be the Tapis service that originally granted the share.
187
+ */
188
+ ShareApi.prototype.deleteShareById = function (requestParameters, initOverrides) {
189
+ return __awaiter(this, void 0, void 0, function () {
190
+ var response;
191
+ return __generator(this, function (_a) {
192
+ switch (_a.label) {
193
+ case 0: return [4 /*yield*/, this.deleteShareByIdRaw(requestParameters, initOverrides)];
194
+ case 1:
195
+ response = _a.sent();
196
+ return [4 /*yield*/, response.value()];
197
+ case 2: return [2 /*return*/, _a.sent()];
198
+ }
199
+ });
200
+ });
201
+ };
202
+ /**
203
+ * Get a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. For the request to be authorized, the requestor must be a Tapis service.
204
+ */
205
+ ShareApi.prototype.getShareRaw = function (requestParameters, initOverrides) {
206
+ return __awaiter(this, void 0, void 0, function () {
207
+ var queryParameters, headerParameters, _a, _b, response;
208
+ return __generator(this, function (_c) {
209
+ switch (_c.label) {
210
+ case 0:
211
+ if (requestParameters['id'] == null) {
212
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getShare().');
213
+ }
214
+ queryParameters = {};
215
+ if (requestParameters['tenant'] != null) {
216
+ queryParameters['tenant'] = requestParameters['tenant'];
217
+ }
218
+ headerParameters = {};
219
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
220
+ _a = headerParameters;
221
+ _b = "X-Tapis-Token";
222
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
223
+ case 1:
224
+ _a[_b] = _c.sent(); // TapisJWT authentication
225
+ _c.label = 2;
226
+ case 2: return [4 /*yield*/, this.request({
227
+ path: "/security/share/{id}".replace("{".concat("id", "}"), encodeURIComponent(String(requestParameters['id']))),
228
+ method: 'GET',
229
+ headers: headerParameters,
230
+ query: queryParameters,
231
+ }, initOverrides)];
232
+ case 3:
233
+ response = _c.sent();
234
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespShareFromJSON)(jsonValue); })];
235
+ }
236
+ });
237
+ });
238
+ };
239
+ /**
240
+ * Get a shared resource by ID. The shared resource is deleted only if it\'s in the tenant specified in the required *tenant* query parameter. For the request to be authorized, the requestor must be a Tapis service.
241
+ */
242
+ ShareApi.prototype.getShare = function (requestParameters, initOverrides) {
243
+ return __awaiter(this, void 0, void 0, function () {
244
+ var response;
245
+ return __generator(this, function (_a) {
246
+ switch (_a.label) {
247
+ case 0: return [4 /*yield*/, this.getShareRaw(requestParameters, initOverrides)];
248
+ case 1:
249
+ response = _a.sent();
250
+ return [4 /*yield*/, response.value()];
251
+ case 2: return [2 /*return*/, _a.sent()];
252
+ }
253
+ });
254
+ });
255
+ };
256
+ /**
257
+ * Get a filtered list of shared resources. Query parameters are used to restrict the returned shares. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1*, *resourceId2*, *privilege*, *createdBy* and *createdByTenant* parameters are used to match values in shared resource objects. Other query parameters are used to control how matching is performed. The *tenant* parameter is required. If resourceId1 or resourceId2 end with a percent sign (%) wildcard then the search results will include all shares with IDs that begin with the same prefix string. Percent signs embedded elsewhere in the string are *not* recognized as wildcards. Specifying the *id* parameter causes the other filtering parameters to be ignored. The result list will contain at most one entry. The *includePublicGrantees* flag, true by default, controls whether resources granted to **~public** and **~public_no_authn** are also considered for inclusion in the result list. The *requireNullId2* flag, true by default, applies only when no *resourceId2* value is provided. When set, only shared resources that do not specify a *resourceId2* value are considered for inclusion in the result list. By setting this flag to false the caller indicates a \"don\'t care\" designation on the *resourceId2* value, allowing shares with any *resourceId2* value to be considered for inclusion in the result list. For the request to be authorized, the requestor must be a Tapis service.
258
+ */
259
+ ShareApi.prototype.getSharesRaw = function (requestParameters, initOverrides) {
260
+ return __awaiter(this, void 0, void 0, function () {
261
+ var queryParameters, headerParameters, _a, _b, response;
262
+ return __generator(this, function (_c) {
263
+ switch (_c.label) {
264
+ case 0:
265
+ queryParameters = {};
266
+ if (requestParameters['grantor'] != null) {
267
+ queryParameters['grantor'] = requestParameters['grantor'];
268
+ }
269
+ if (requestParameters['grantee'] != null) {
270
+ queryParameters['grantee'] = requestParameters['grantee'];
271
+ }
272
+ if (requestParameters['tenant'] != null) {
273
+ queryParameters['tenant'] = requestParameters['tenant'];
274
+ }
275
+ if (requestParameters['resourceType'] != null) {
276
+ queryParameters['resourceType'] = requestParameters['resourceType'];
277
+ }
278
+ if (requestParameters['resourceId1'] != null) {
279
+ queryParameters['resourceId1'] = requestParameters['resourceId1'];
280
+ }
281
+ if (requestParameters['resourceId2'] != null) {
282
+ queryParameters['resourceId2'] = requestParameters['resourceId2'];
283
+ }
284
+ if (requestParameters['privilege'] != null) {
285
+ queryParameters['privilege'] = requestParameters['privilege'];
286
+ }
287
+ if (requestParameters['createdBy'] != null) {
288
+ queryParameters['createdBy'] = requestParameters['createdBy'];
289
+ }
290
+ if (requestParameters['createdByTenant'] != null) {
291
+ queryParameters['createdByTenant'] = requestParameters['createdByTenant'];
292
+ }
293
+ if (requestParameters['includePublicGrantees'] != null) {
294
+ queryParameters['includePublicGrantees'] = requestParameters['includePublicGrantees'];
295
+ }
296
+ if (requestParameters['requireNullId2'] != null) {
297
+ queryParameters['requireNullId2'] = requestParameters['requireNullId2'];
298
+ }
299
+ if (requestParameters['id'] != null) {
300
+ queryParameters['id'] = requestParameters['id'];
301
+ }
302
+ headerParameters = {};
303
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
304
+ _a = headerParameters;
305
+ _b = "X-Tapis-Token";
306
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
307
+ case 1:
308
+ _a[_b] = _c.sent(); // TapisJWT authentication
309
+ _c.label = 2;
310
+ case 2: return [4 /*yield*/, this.request({
311
+ path: "/security/share",
312
+ method: 'GET',
313
+ headers: headerParameters,
314
+ query: queryParameters,
315
+ }, initOverrides)];
316
+ case 3:
317
+ response = _c.sent();
318
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespShareListFromJSON)(jsonValue); })];
319
+ }
320
+ });
321
+ });
322
+ };
323
+ /**
324
+ * Get a filtered list of shared resources. Query parameters are used to restrict the returned shares. The *grantor*, *grantee*, *tenant*, *resourceType*, *resourceId1*, *resourceId2*, *privilege*, *createdBy* and *createdByTenant* parameters are used to match values in shared resource objects. Other query parameters are used to control how matching is performed. The *tenant* parameter is required. If resourceId1 or resourceId2 end with a percent sign (%) wildcard then the search results will include all shares with IDs that begin with the same prefix string. Percent signs embedded elsewhere in the string are *not* recognized as wildcards. Specifying the *id* parameter causes the other filtering parameters to be ignored. The result list will contain at most one entry. The *includePublicGrantees* flag, true by default, controls whether resources granted to **~public** and **~public_no_authn** are also considered for inclusion in the result list. The *requireNullId2* flag, true by default, applies only when no *resourceId2* value is provided. When set, only shared resources that do not specify a *resourceId2* value are considered for inclusion in the result list. By setting this flag to false the caller indicates a \"don\'t care\" designation on the *resourceId2* value, allowing shares with any *resourceId2* value to be considered for inclusion in the result list. For the request to be authorized, the requestor must be a Tapis service.
325
+ */
326
+ ShareApi.prototype.getShares = function () {
327
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
328
+ var response;
329
+ if (requestParameters === void 0) { requestParameters = {}; }
330
+ return __generator(this, function (_a) {
331
+ switch (_a.label) {
332
+ case 0: return [4 /*yield*/, this.getSharesRaw(requestParameters, initOverrides)];
333
+ case 1:
334
+ response = _a.sent();
335
+ return [4 /*yield*/, response.value()];
336
+ case 2: return [2 /*return*/, _a.sent()];
337
+ }
338
+ });
339
+ });
340
+ };
341
+ /**
342
+ * Determine if a user has been granted a specific privilege on a specific resource. The *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. Privilege matching is performed for the grantee and tenant specified in the query parameters. True is returned if the user has been granted the privilege, false otherwise. By default, both authenticated and unauthenticated public privileges are included in the calculation. For example, if a privilege on a resource has been granted to all authenticated users in a tenant (~public), then true will be returned for all users in the tenant. The *excludePublic* and *excludePublicNoAuthn* parameters can be used to change the default handling of public grants. Either or both types of public grants can be excluded. For the request to be authorized, the requestor must be a Tapis service.
343
+ */
344
+ ShareApi.prototype.hasPrivilegeRaw = function (requestParameters, initOverrides) {
345
+ return __awaiter(this, void 0, void 0, function () {
346
+ var queryParameters, headerParameters, _a, _b, response;
347
+ return __generator(this, function (_c) {
348
+ switch (_c.label) {
349
+ case 0:
350
+ queryParameters = {};
351
+ if (requestParameters['grantee'] != null) {
352
+ queryParameters['grantee'] = requestParameters['grantee'];
353
+ }
354
+ if (requestParameters['tenant'] != null) {
355
+ queryParameters['tenant'] = requestParameters['tenant'];
356
+ }
357
+ if (requestParameters['resourceType'] != null) {
358
+ queryParameters['resourceType'] = requestParameters['resourceType'];
359
+ }
360
+ if (requestParameters['resourceId1'] != null) {
361
+ queryParameters['resourceId1'] = requestParameters['resourceId1'];
362
+ }
363
+ if (requestParameters['resourceId2'] != null) {
364
+ queryParameters['resourceId2'] = requestParameters['resourceId2'];
365
+ }
366
+ if (requestParameters['privilege'] != null) {
367
+ queryParameters['privilege'] = requestParameters['privilege'];
368
+ }
369
+ if (requestParameters['excludePublic'] != null) {
370
+ queryParameters['excludePublic'] = requestParameters['excludePublic'];
371
+ }
372
+ if (requestParameters['excludePublicNoAuthn'] != null) {
373
+ queryParameters['excludePublicNoAuthn'] = requestParameters['excludePublicNoAuthn'];
374
+ }
375
+ headerParameters = {};
376
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
377
+ _a = headerParameters;
378
+ _b = "X-Tapis-Token";
379
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
380
+ case 1:
381
+ _a[_b] = _c.sent(); // TapisJWT authentication
382
+ _c.label = 2;
383
+ case 2: return [4 /*yield*/, this.request({
384
+ path: "/security/share/hasPrivilege",
385
+ method: 'GET',
386
+ headers: headerParameters,
387
+ query: queryParameters,
388
+ }, initOverrides)];
389
+ case 3:
390
+ response = _c.sent();
391
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespBooleanFromJSON)(jsonValue); })];
392
+ }
393
+ });
394
+ });
395
+ };
396
+ /**
397
+ * Determine if a user has been granted a specific privilege on a specific resource. The *grantee*, *tenant*, *resourceType*, *resourceId1* and *privilege* parameters are mandatory; *resourceId2* is optional and assumed to be NULL if not provided. Privilege matching is performed for the grantee and tenant specified in the query parameters. True is returned if the user has been granted the privilege, false otherwise. By default, both authenticated and unauthenticated public privileges are included in the calculation. For example, if a privilege on a resource has been granted to all authenticated users in a tenant (~public), then true will be returned for all users in the tenant. The *excludePublic* and *excludePublicNoAuthn* parameters can be used to change the default handling of public grants. Either or both types of public grants can be excluded. For the request to be authorized, the requestor must be a Tapis service.
398
+ */
399
+ ShareApi.prototype.hasPrivilege = function () {
400
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
401
+ var response;
402
+ if (requestParameters === void 0) { requestParameters = {}; }
403
+ return __generator(this, function (_a) {
404
+ switch (_a.label) {
405
+ case 0: return [4 /*yield*/, this.hasPrivilegeRaw(requestParameters, initOverrides)];
406
+ case 1:
407
+ response = _a.sent();
408
+ return [4 /*yield*/, response.value()];
409
+ case 2: return [2 /*return*/, _a.sent()];
410
+ }
411
+ });
412
+ });
413
+ };
414
+ /**
415
+ * Share a Tapis resource using a request body. Shared resources allow services to indicate that other services should relax their Tapis authorization checking in certain, well-defined contexts. Grantees can be given shared access to a resource on an individual basis or by using the public granting mechanism. Grants to the distinguished **~public** and **~public_no_authn** pseudo-grantees allow access to a resource to authenticated users or to any user, respectively. The payload for this request includes these values, with all except *resourceId2* required: - grantor - grantee - tenant - resourceType - resourceId1 - resourceId2 - privilege If the share already exists, then this call has no effect. For the request to be authorized, the requestor must be a Tapis service.
416
+ */
417
+ ShareApi.prototype.shareResourceRaw = function (requestParameters, initOverrides) {
418
+ return __awaiter(this, void 0, void 0, function () {
419
+ var queryParameters, headerParameters, _a, _b, response;
420
+ return __generator(this, function (_c) {
421
+ switch (_c.label) {
422
+ case 0:
423
+ if (requestParameters['reqShareResource'] == null) {
424
+ throw new runtime.RequiredError('reqShareResource', 'Required parameter "reqShareResource" was null or undefined when calling shareResource().');
425
+ }
426
+ queryParameters = {};
427
+ headerParameters = {};
428
+ headerParameters['Content-Type'] = 'application/json';
429
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
430
+ _a = headerParameters;
431
+ _b = "X-Tapis-Token";
432
+ return [4 /*yield*/, this.configuration.apiKey("X-Tapis-Token")];
433
+ case 1:
434
+ _a[_b] = _c.sent(); // TapisJWT authentication
435
+ _c.label = 2;
436
+ case 2: return [4 /*yield*/, this.request({
437
+ path: "/security/share",
438
+ method: 'POST',
439
+ headers: headerParameters,
440
+ query: queryParameters,
441
+ body: (0, index_1.ReqShareResourceToJSON)(requestParameters['reqShareResource']),
442
+ }, initOverrides)];
443
+ case 3:
444
+ response = _c.sent();
445
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.RespResourceUrlFromJSON)(jsonValue); })];
446
+ }
447
+ });
448
+ });
449
+ };
450
+ /**
451
+ * Share a Tapis resource using a request body. Shared resources allow services to indicate that other services should relax their Tapis authorization checking in certain, well-defined contexts. Grantees can be given shared access to a resource on an individual basis or by using the public granting mechanism. Grants to the distinguished **~public** and **~public_no_authn** pseudo-grantees allow access to a resource to authenticated users or to any user, respectively. The payload for this request includes these values, with all except *resourceId2* required: - grantor - grantee - tenant - resourceType - resourceId1 - resourceId2 - privilege If the share already exists, then this call has no effect. For the request to be authorized, the requestor must be a Tapis service.
452
+ */
453
+ ShareApi.prototype.shareResource = function (requestParameters, initOverrides) {
454
+ return __awaiter(this, void 0, void 0, function () {
455
+ var response;
456
+ return __generator(this, function (_a) {
457
+ switch (_a.label) {
458
+ case 0: return [4 /*yield*/, this.shareResourceRaw(requestParameters, initOverrides)];
459
+ case 1:
460
+ response = _a.sent();
461
+ return [4 /*yield*/, response.value()];
462
+ case 2: return [2 /*return*/, _a.sent()];
463
+ }
464
+ });
465
+ });
466
+ };
467
+ return ShareApi;
468
+ }(runtime.BaseAPI));
469
+ exports.ShareApi = ShareApi;