@homeflare/distilled-openbao 0.2.0

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 (313) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +78 -0
  3. package/dist/credentials.d.ts +32 -0
  4. package/dist/credentials.d.ts.map +1 -0
  5. package/dist/credentials.js +66 -0
  6. package/dist/credentials.js.map +1 -0
  7. package/dist/credentials.test.d.ts +2 -0
  8. package/dist/credentials.test.d.ts.map +1 -0
  9. package/dist/credentials.test.js +29 -0
  10. package/dist/credentials.test.js.map +1 -0
  11. package/dist/errors.d.ts +57 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +37 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/index.d.ts +30 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +30 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/protocol.d.ts +18 -0
  20. package/dist/protocol.d.ts.map +1 -0
  21. package/dist/protocol.js +96 -0
  22. package/dist/protocol.js.map +1 -0
  23. package/dist/protocol.test.d.ts +2 -0
  24. package/dist/protocol.test.d.ts.map +1 -0
  25. package/dist/protocol.test.js +78 -0
  26. package/dist/protocol.test.js.map +1 -0
  27. package/dist/retry.d.ts +60 -0
  28. package/dist/retry.d.ts.map +1 -0
  29. package/dist/retry.js +53 -0
  30. package/dist/retry.js.map +1 -0
  31. package/dist/services/alias.d.ts +73 -0
  32. package/dist/services/alias.d.ts.map +1 -0
  33. package/dist/services/alias.js +91 -0
  34. package/dist/services/alias.js.map +1 -0
  35. package/dist/services/approle.d.ts +918 -0
  36. package/dist/services/approle.d.ts.map +1 -0
  37. package/dist/services/approle.js +1206 -0
  38. package/dist/services/approle.js.map +1 -0
  39. package/dist/services/auditing.d.ts +97 -0
  40. package/dist/services/auditing.d.ts.map +1 -0
  41. package/dist/services/auditing.js +158 -0
  42. package/dist/services/auditing.js.map +1 -0
  43. package/dist/services/auth.d.ts +160 -0
  44. package/dist/services/auth.d.ts.map +1 -0
  45. package/dist/services/auth.js +169 -0
  46. package/dist/services/auth.js.map +1 -0
  47. package/dist/services/collect.d.ts +35 -0
  48. package/dist/services/collect.d.ts.map +1 -0
  49. package/dist/services/collect.js +46 -0
  50. package/dist/services/collect.js.map +1 -0
  51. package/dist/services/configure.d.ts +35 -0
  52. package/dist/services/configure.d.ts.map +1 -0
  53. package/dist/services/configure.js +43 -0
  54. package/dist/services/configure.js.map +1 -0
  55. package/dist/services/cors.d.ts +54 -0
  56. package/dist/services/cors.d.ts.map +1 -0
  57. package/dist/services/cors.js +65 -0
  58. package/dist/services/cors.js.map +1 -0
  59. package/dist/services/cubbyhole.d.ts +40 -0
  60. package/dist/services/cubbyhole.d.ts.map +1 -0
  61. package/dist/services/cubbyhole.js +56 -0
  62. package/dist/services/cubbyhole.js.map +1 -0
  63. package/dist/services/database.d.ts +278 -0
  64. package/dist/services/database.d.ts.map +1 -0
  65. package/dist/services/database.js +384 -0
  66. package/dist/services/database.js.map +1 -0
  67. package/dist/services/decode.d.ts +18 -0
  68. package/dist/services/decode.d.ts.map +1 -0
  69. package/dist/services/decode.js +24 -0
  70. package/dist/services/decode.js.map +1 -0
  71. package/dist/services/entity.d.ts +257 -0
  72. package/dist/services/entity.d.ts.map +1 -0
  73. package/dist/services/entity.js +313 -0
  74. package/dist/services/entity.js.map +1 -0
  75. package/dist/services/generate.d.ts +136 -0
  76. package/dist/services/generate.d.ts.map +1 -0
  77. package/dist/services/generate.js +188 -0
  78. package/dist/services/generate.js.map +1 -0
  79. package/dist/services/group.d.ts +244 -0
  80. package/dist/services/group.d.ts.map +1 -0
  81. package/dist/services/group.js +277 -0
  82. package/dist/services/group.js.map +1 -0
  83. package/dist/services/ha.d.ts +17 -0
  84. package/dist/services/ha.d.ts.map +1 -0
  85. package/dist/services/ha.js +24 -0
  86. package/dist/services/ha.js.map +1 -0
  87. package/dist/services/index.d.ts +54 -0
  88. package/dist/services/index.d.ts.map +1 -0
  89. package/dist/services/index.js +55 -0
  90. package/dist/services/index.js.map +1 -0
  91. package/dist/services/initialize.d.ts +34 -0
  92. package/dist/services/initialize.d.ts.map +1 -0
  93. package/dist/services/initialize.js +31 -0
  94. package/dist/services/initialize.js.map +1 -0
  95. package/dist/services/internal.d.ts +131 -0
  96. package/dist/services/internal.d.ts.map +1 -0
  97. package/dist/services/internal.js +199 -0
  98. package/dist/services/internal.js.map +1 -0
  99. package/dist/services/jwt.d.ts +684 -0
  100. package/dist/services/jwt.d.ts.map +1 -0
  101. package/dist/services/jwt.js +801 -0
  102. package/dist/services/jwt.js.map +1 -0
  103. package/dist/services/kubernetes.d.ts +166 -0
  104. package/dist/services/kubernetes.d.ts.map +1 -0
  105. package/dist/services/kubernetes.js +187 -0
  106. package/dist/services/kubernetes.js.map +1 -0
  107. package/dist/services/kv.d.ts +519 -0
  108. package/dist/services/kv.d.ts.map +1 -0
  109. package/dist/services/kv.js +655 -0
  110. package/dist/services/kv.js.map +1 -0
  111. package/dist/services/leader.d.ts +21 -0
  112. package/dist/services/leader.d.ts.map +1 -0
  113. package/dist/services/leader.js +29 -0
  114. package/dist/services/leader.js.map +1 -0
  115. package/dist/services/leases.d.ts +185 -0
  116. package/dist/services/leases.d.ts.map +1 -0
  117. package/dist/services/leases.js +238 -0
  118. package/dist/services/leases.js.map +1 -0
  119. package/dist/services/locked.d.ts +27 -0
  120. package/dist/services/locked.d.ts.map +1 -0
  121. package/dist/services/locked.js +42 -0
  122. package/dist/services/locked.js.map +1 -0
  123. package/dist/services/loggers.d.ts +69 -0
  124. package/dist/services/loggers.d.ts.map +1 -0
  125. package/dist/services/loggers.js +100 -0
  126. package/dist/services/loggers.js.map +1 -0
  127. package/dist/services/mfa.d.ts +386 -0
  128. package/dist/services/mfa.d.ts.map +1 -0
  129. package/dist/services/mfa.js +553 -0
  130. package/dist/services/mfa.js.map +1 -0
  131. package/dist/services/misc.d.ts +103 -0
  132. package/dist/services/misc.d.ts.map +1 -0
  133. package/dist/services/misc.js +120 -0
  134. package/dist/services/misc.js.map +1 -0
  135. package/dist/services/mounts.d.ts +173 -0
  136. package/dist/services/mounts.d.ts.map +1 -0
  137. package/dist/services/mounts.js +168 -0
  138. package/dist/services/mounts.js.map +1 -0
  139. package/dist/services/namespaces.d.ts +257 -0
  140. package/dist/services/namespaces.d.ts.map +1 -0
  141. package/dist/services/namespaces.js +320 -0
  142. package/dist/services/namespaces.js.map +1 -0
  143. package/dist/services/oidc.d.ts +509 -0
  144. package/dist/services/oidc.d.ts.map +1 -0
  145. package/dist/services/oidc.js +718 -0
  146. package/dist/services/oidc.js.map +1 -0
  147. package/dist/services/persona.d.ts +73 -0
  148. package/dist/services/persona.d.ts.map +1 -0
  149. package/dist/services/persona.js +91 -0
  150. package/dist/services/persona.js.map +1 -0
  151. package/dist/services/pki.d.ts +5783 -0
  152. package/dist/services/pki.d.ts.map +1 -0
  153. package/dist/services/pki.js +4995 -0
  154. package/dist/services/pki.js.map +1 -0
  155. package/dist/services/plugins.d.ts +203 -0
  156. package/dist/services/plugins.d.ts.map +1 -0
  157. package/dist/services/plugins.js +237 -0
  158. package/dist/services/plugins.js.map +1 -0
  159. package/dist/services/policies.d.ts +250 -0
  160. package/dist/services/policies.d.ts.map +1 -0
  161. package/dist/services/policies.js +312 -0
  162. package/dist/services/policies.js.map +1 -0
  163. package/dist/services/pprof.d.ts +104 -0
  164. package/dist/services/pprof.d.ts.map +1 -0
  165. package/dist/services/pprof.js +161 -0
  166. package/dist/services/pprof.js.map +1 -0
  167. package/dist/services/query.d.ts +65 -0
  168. package/dist/services/query.d.ts.map +1 -0
  169. package/dist/services/query.js +66 -0
  170. package/dist/services/query.js.map +1 -0
  171. package/dist/services/rate.d.ts +102 -0
  172. package/dist/services/rate.d.ts.map +1 -0
  173. package/dist/services/rate.js +129 -0
  174. package/dist/services/rate.js.map +1 -0
  175. package/dist/services/raw.d.ts +85 -0
  176. package/dist/services/raw.d.ts.map +1 -0
  177. package/dist/services/raw.js +116 -0
  178. package/dist/services/raw.js.map +1 -0
  179. package/dist/services/read.d.ts +87 -0
  180. package/dist/services/read.d.ts.map +1 -0
  181. package/dist/services/read.js +123 -0
  182. package/dist/services/read.js.map +1 -0
  183. package/dist/services/rekey.d.ts +184 -0
  184. package/dist/services/rekey.d.ts.map +1 -0
  185. package/dist/services/rekey.js +243 -0
  186. package/dist/services/rekey.js.map +1 -0
  187. package/dist/services/reload.d.ts +15 -0
  188. package/dist/services/reload.d.ts.map +1 -0
  189. package/dist/services/reload.js +27 -0
  190. package/dist/services/reload.js.map +1 -0
  191. package/dist/services/remount.d.ts +18 -0
  192. package/dist/services/remount.d.ts.map +1 -0
  193. package/dist/services/remount.js +30 -0
  194. package/dist/services/remount.js.map +1 -0
  195. package/dist/services/root.d.ts +134 -0
  196. package/dist/services/root.d.ts.map +1 -0
  197. package/dist/services/root.js +180 -0
  198. package/dist/services/root.js.map +1 -0
  199. package/dist/services/rotate.d.ts +367 -0
  200. package/dist/services/rotate.d.ts.map +1 -0
  201. package/dist/services/rotate.js +473 -0
  202. package/dist/services/rotate.js.map +1 -0
  203. package/dist/services/seal.d.ts +29 -0
  204. package/dist/services/seal.d.ts.map +1 -0
  205. package/dist/services/seal.js +37 -0
  206. package/dist/services/seal.js.map +1 -0
  207. package/dist/services/ssh.d.ts +491 -0
  208. package/dist/services/ssh.d.ts.map +1 -0
  209. package/dist/services/ssh.js +582 -0
  210. package/dist/services/ssh.js.map +1 -0
  211. package/dist/services/status.d.ts +17 -0
  212. package/dist/services/status.d.ts.map +1 -0
  213. package/dist/services/status.js +25 -0
  214. package/dist/services/status.js.map +1 -0
  215. package/dist/services/step.d.ts +14 -0
  216. package/dist/services/step.d.ts.map +1 -0
  217. package/dist/services/step.js +21 -0
  218. package/dist/services/step.js.map +1 -0
  219. package/dist/services/system.d.ts +33 -0
  220. package/dist/services/system.d.ts.map +1 -0
  221. package/dist/services/system.js +47 -0
  222. package/dist/services/system.js.map +1 -0
  223. package/dist/services/token.d.ts +408 -0
  224. package/dist/services/token.d.ts.map +1 -0
  225. package/dist/services/token.js +415 -0
  226. package/dist/services/token.js.map +1 -0
  227. package/dist/services/ui.d.ts +70 -0
  228. package/dist/services/ui.d.ts.map +1 -0
  229. package/dist/services/ui.js +95 -0
  230. package/dist/services/ui.js.map +1 -0
  231. package/dist/services/update.d.ts +25 -0
  232. package/dist/services/update.d.ts.map +1 -0
  233. package/dist/services/update.js +36 -0
  234. package/dist/services/update.js.map +1 -0
  235. package/dist/services/userpass.d.ts +151 -0
  236. package/dist/services/userpass.d.ts.map +1 -0
  237. package/dist/services/userpass.js +177 -0
  238. package/dist/services/userpass.js.map +1 -0
  239. package/dist/services/version.d.ts +22 -0
  240. package/dist/services/version.d.ts.map +1 -0
  241. package/dist/services/version.js +28 -0
  242. package/dist/services/version.js.map +1 -0
  243. package/dist/services/workflows.d.ts +122 -0
  244. package/dist/services/workflows.d.ts.map +1 -0
  245. package/dist/services/workflows.js +149 -0
  246. package/dist/services/workflows.js.map +1 -0
  247. package/dist/traits.d.ts +11 -0
  248. package/dist/traits.d.ts.map +1 -0
  249. package/dist/traits.js +12 -0
  250. package/dist/traits.js.map +1 -0
  251. package/package.json +75 -0
  252. package/src/credentials.test.ts +36 -0
  253. package/src/credentials.ts +100 -0
  254. package/src/errors.ts +73 -0
  255. package/src/index.ts +33 -0
  256. package/src/protocol.test.ts +123 -0
  257. package/src/protocol.ts +120 -0
  258. package/src/retry.ts +84 -0
  259. package/src/services/alias.ts +208 -0
  260. package/src/services/approle.ts +2750 -0
  261. package/src/services/auditing.ts +318 -0
  262. package/src/services/auth.ts +416 -0
  263. package/src/services/collect.ts +103 -0
  264. package/src/services/configure.ts +94 -0
  265. package/src/services/cors.ts +155 -0
  266. package/src/services/cubbyhole.ts +117 -0
  267. package/src/services/database.ts +854 -0
  268. package/src/services/decode.ts +49 -0
  269. package/src/services/entity.ts +744 -0
  270. package/src/services/generate.ts +409 -0
  271. package/src/services/group.ts +677 -0
  272. package/src/services/ha.ts +52 -0
  273. package/src/services/index.ts +54 -0
  274. package/src/services/initialize.ts +76 -0
  275. package/src/services/internal.ts +425 -0
  276. package/src/services/jwt.ts +1838 -0
  277. package/src/services/kubernetes.ts +446 -0
  278. package/src/services/kv.ts +1480 -0
  279. package/src/services/leader.ts +57 -0
  280. package/src/services/leases.ts +532 -0
  281. package/src/services/locked.ts +86 -0
  282. package/src/services/loggers.ts +215 -0
  283. package/src/services/mfa.ts +1193 -0
  284. package/src/services/misc.ts +286 -0
  285. package/src/services/mounts.ts +428 -0
  286. package/src/services/namespaces.ts +707 -0
  287. package/src/services/oidc.ts +1613 -0
  288. package/src/services/persona.ts +210 -0
  289. package/src/services/pki.ts +13320 -0
  290. package/src/services/plugins.ts +549 -0
  291. package/src/services/policies.ts +689 -0
  292. package/src/services/pprof.ts +351 -0
  293. package/src/services/query.ts +170 -0
  294. package/src/services/rate.ts +303 -0
  295. package/src/services/raw.ts +244 -0
  296. package/src/services/read.ts +266 -0
  297. package/src/services/rekey.ts +540 -0
  298. package/src/services/reload.ts +51 -0
  299. package/src/services/remount.ts +58 -0
  300. package/src/services/root.ts +393 -0
  301. package/src/services/rotate.ts +1088 -0
  302. package/src/services/seal.ts +75 -0
  303. package/src/services/ssh.ts +1351 -0
  304. package/src/services/status.ts +51 -0
  305. package/src/services/step.ts +43 -0
  306. package/src/services/system.ts +98 -0
  307. package/src/services/token.ts +1046 -0
  308. package/src/services/ui.ts +207 -0
  309. package/src/services/update.ts +73 -0
  310. package/src/services/userpass.ts +410 -0
  311. package/src/services/version.ts +60 -0
  312. package/src/services/workflows.ts +327 -0
  313. package/src/traits.ts +45 -0
@@ -0,0 +1,149 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-openbao, generated — see fetch-specs.ts). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as T from "../traits.js";
5
+ import { OpenBaoProtocol, } from "../protocol.js";
6
+ import * as Retry from "../retry.js";
7
+ export const DeleteWorkflowsManagePathRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
8
+ path: S.String.pipe(T.Label()),
9
+ }).pipe(T.Http({
10
+ method: "DELETE",
11
+ uri: "/sys/workflows/manage/{path}",
12
+ code: 200,
13
+ }))).annotate({
14
+ identifier: "DeleteWorkflowsManagePathRequest",
15
+ });
16
+ export const DeleteWorkflowsManagePathResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
17
+ identifier: "DeleteWorkflowsManagePathResponse",
18
+ });
19
+ export const ReadWorkflowsManagePathRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
20
+ path: S.String.pipe(T.Label()),
21
+ list: S.optional(S.String.pipe(T.Query())),
22
+ scan: S.optional(S.String.pipe(T.Query())),
23
+ }).pipe(T.Http({ method: "GET", uri: "/sys/workflows/manage/{path}", code: 200 }))).annotate({
24
+ identifier: "ReadWorkflowsManagePathRequest",
25
+ });
26
+ export const WorkflowsReadWorkflowsManagePathResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
27
+ allow_unauthenticated: S.optional(S.Boolean),
28
+ cas_required: S.optional(S.Boolean),
29
+ description: S.optional(S.String),
30
+ version: S.optional(S.Number),
31
+ workflow: S.optional(S.String),
32
+ })).annotate({
33
+ identifier: "WorkflowsReadWorkflowsManagePathResponse",
34
+ });
35
+ export const WorkflowsExecuteWriteWorkflowsExecutePathRequest =
36
+ /*@__PURE__*/ S.suspend(() => S.Struct({
37
+ path: S.String.pipe(T.Label()),
38
+ }).pipe(T.Http({
39
+ method: "POST",
40
+ uri: "/sys/workflows/execute/{path}",
41
+ code: 200,
42
+ }))).annotate({
43
+ identifier: "WorkflowsExecuteWriteWorkflowsExecutePathRequest",
44
+ });
45
+ export const WorkflowsExecuteWriteWorkflowsExecutePathResponse =
46
+ /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
47
+ identifier: "WorkflowsExecuteWriteWorkflowsExecutePathResponse",
48
+ });
49
+ export const WorkflowsScanWorkflowsManageRequestList = S.String;
50
+ export const WorkflowsScanWorkflowsManageRequestScan = S.String;
51
+ export const WorkflowsScanWorkflowsManageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
52
+ list: WorkflowsScanWorkflowsManageRequestList.pipe(T.Query()),
53
+ scan: WorkflowsScanWorkflowsManageRequestScan.pipe(T.Query()),
54
+ }).pipe(T.Http({ method: "GET", uri: "/sys/workflows/manage", code: 200 }))).annotate({
55
+ identifier: "WorkflowsScanWorkflowsManageRequest",
56
+ });
57
+ export const WorkflowsScanWorkflowsManageResponseKeysList =
58
+ /*@__PURE__*/ S.Array(S.String);
59
+ export const WorkflowsScanWorkflowsManageResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
60
+ key_info: S.optional(S.Unknown),
61
+ keys: S.optional(WorkflowsScanWorkflowsManageResponseKeysList),
62
+ })).annotate({
63
+ identifier: "WorkflowsScanWorkflowsManageResponse",
64
+ });
65
+ export const WorkflowsTraceWriteWorkflowsTracePathRequest =
66
+ /*@__PURE__*/ S.suspend(() => S.Struct({
67
+ path: S.String.pipe(T.Label()),
68
+ }).pipe(T.Http({ method: "POST", uri: "/sys/workflows/trace/{path}", code: 200 }))).annotate({
69
+ identifier: "WorkflowsTraceWriteWorkflowsTracePathRequest",
70
+ });
71
+ export const WorkflowsTraceWriteWorkflowsTracePathResponse =
72
+ /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
73
+ identifier: "WorkflowsTraceWriteWorkflowsTracePathResponse",
74
+ });
75
+ export const WorkflowsWriteWorkflowsManagePathRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
76
+ path: S.String.pipe(T.Label()),
77
+ after: S.optional(S.String),
78
+ allow_unauthenticated: S.optional(S.Boolean),
79
+ cas: S.optional(S.Number),
80
+ cas_required: S.optional(S.Boolean),
81
+ description: S.optional(S.String),
82
+ limit: S.optional(S.Number),
83
+ workflow: S.String,
84
+ }).pipe(T.Http({
85
+ method: "POST",
86
+ uri: "/sys/workflows/manage/{path}",
87
+ code: 200,
88
+ }))).annotate({
89
+ identifier: "WorkflowsWriteWorkflowsManagePathRequest",
90
+ });
91
+ export const WorkflowsWriteWorkflowsManagePathResponse =
92
+ /*@__PURE__*/ S.suspend(() => S.Struct({
93
+ allow_unauthenticated: S.optional(S.Boolean),
94
+ cas_required: S.optional(S.Boolean),
95
+ description: S.optional(S.String),
96
+ version: S.optional(S.Number),
97
+ workflow: S.optional(S.String),
98
+ })).annotate({
99
+ identifier: "WorkflowsWriteWorkflowsManagePathResponse",
100
+ });
101
+ /** Delete a workflow. */
102
+ export const deleteWorkflowsManagePath = /*@__PURE__*/ API.make(() => ({
103
+ input: DeleteWorkflowsManagePathRequest,
104
+ output: DeleteWorkflowsManagePathResponse,
105
+ errors: [],
106
+ protocol: OpenBaoProtocol,
107
+ retry: Retry.Retry,
108
+ }));
109
+ /** Retrieve a workflow. */
110
+ export const readWorkflowsManagePath = /*@__PURE__*/ API.make(() => ({
111
+ input: ReadWorkflowsManagePathRequest,
112
+ output: WorkflowsReadWorkflowsManagePathResponse,
113
+ errors: [],
114
+ protocol: OpenBaoProtocol,
115
+ retry: Retry.Retry,
116
+ }));
117
+ /** Execute the given workflow. */
118
+ export const workflowsExecuteWriteWorkflowsExecutePath = /*@__PURE__*/ API.make(() => ({
119
+ input: WorkflowsExecuteWriteWorkflowsExecutePathRequest,
120
+ output: WorkflowsExecuteWriteWorkflowsExecutePathResponse,
121
+ errors: [],
122
+ protocol: OpenBaoProtocol,
123
+ retry: Retry.Retry,
124
+ }));
125
+ /** Scan (recursively list) workflows. */
126
+ export const workflowsScanWorkflowsManage = /*@__PURE__*/ API.make(() => ({
127
+ input: WorkflowsScanWorkflowsManageRequest,
128
+ output: WorkflowsScanWorkflowsManageResponse,
129
+ errors: [],
130
+ protocol: OpenBaoProtocol,
131
+ retry: Retry.Retry,
132
+ }));
133
+ /** Execute the given workflow. */
134
+ export const workflowsTraceWriteWorkflowsTracePath = /*@__PURE__*/ API.make(() => ({
135
+ input: WorkflowsTraceWriteWorkflowsTracePathRequest,
136
+ output: WorkflowsTraceWriteWorkflowsTracePathResponse,
137
+ errors: [],
138
+ protocol: OpenBaoProtocol,
139
+ retry: Retry.Retry,
140
+ }));
141
+ /** Create or update a workflow. */
142
+ export const workflowsWriteWorkflowsManagePath = /*@__PURE__*/ API.make(() => ({
143
+ input: WorkflowsWriteWorkflowsManagePathRequest,
144
+ output: WorkflowsWriteWorkflowsManagePathResponse,
145
+ errors: [],
146
+ protocol: OpenBaoProtocol,
147
+ retry: Retry.Retry,
148
+ }));
149
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/services/workflows.ts"],"names":[],"mappings":"AAAA,wIAAwI;AACxI,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,eAAe,GAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAQrC,MAAM,CAAC,MAAM,gCAAgC,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAC3E,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;CAC/B,CAAC,CAAC,IAAI,CACL,CAAC,CAAC,IAAI,CAAC;IACL,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,8BAA8B;IACnC,IAAI,EAAE,GAAG;CACV,CAAC,CACH,CACF,CAAC,QAAQ,CAAC;IACT,UAAU,EAAE,kCAAkC;CAC/C,CAAsD,CAAC;AAGxD,MAAM,CAAC,MAAM,iCAAiC,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAC5E,CAAC,CAAC,MAA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AI,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,KAAK,EAAE,4CAA4C;IACnD,MAAM,EAAE,6CAA6C;IACrD,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,KAAK,CAAC,KAAK;CACnB,CAAC,CAAC,CAAC;AAGJ,mCAAmC;AACnC,MAAM,CAAC,MAAM,iCAAiC,GAK1C,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,KAAK,EAAE,wCAAwC;IAC/C,MAAM,EAAE,yCAAyC;IACjD,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,KAAK,CAAC,KAAK;CACnB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * OpenBao SDK trait surface — hand-written.
3
+ *
4
+ * Re-exports the generic protocol traits from core so generated operations
5
+ * import everything from one place. OpenBao speaks plain token-REST JSON
6
+ * with a `data`-enveloped success body (unwrapped in `protocol.ts`), so
7
+ * there are no provider-specific traits.
8
+ */
9
+ export { Body, Header, Query, Label, Http, ResponseCode, HttpBody, FormDataFile, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, type HttpTrait, type ErrorMatcher, bodySymbol, headerSymbol, querySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
10
+ export { SensitiveValue, RawResponse, RawResponseRoot, sensitiveValueSymbol, rawResponseSymbol, rawResponseRootSymbol, } from "@distilled.cloud/core/protocol-rest";
11
+ //# sourceMappingURL=traits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC"}
package/dist/traits.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * OpenBao SDK trait surface — hand-written.
3
+ *
4
+ * Re-exports the generic protocol traits from core so generated operations
5
+ * import everything from one place. OpenBao speaks plain token-REST JSON
6
+ * with a `data`-enveloped success body (unwrapped in `protocol.ts`), so
7
+ * there are no provider-specific traits.
8
+ */
9
+ export { Body, Header, Query, Label, Http, ResponseCode, HttpBody, FormDataFile, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, bodySymbol, headerSymbol, querySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
10
+ // Bearer-REST protocol traits (sensitive strings, bare-payload responses).
11
+ export { SensitiveValue, RawResponse, RawResponseRoot, sensitiveValueSymbol, rawResponseSymbol, rawResponseRootSymbol, } from "@distilled.cloud/core/protocol-rest";
12
+ //# sourceMappingURL=traits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traits.js","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAGhB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC,2EAA2E;AAC3E,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@homeflare/distilled-openbao",
3
+ "version": "0.2.0",
4
+ "description": "Interim npm home for @distilled.cloud/openbao — see docs/distilled-interim.md. Not published upstream yet; the kit aliases @distilled.cloud/openbao onto this package until it is.",
5
+ "homepage": "https://github.com/taslabs-net/homeflare-kit/tree/main/packages/distilled-openbao#readme",
6
+ "bugs": "https://github.com/taslabs-net/homeflare-kit/issues",
7
+ "license": "Apache-2.0",
8
+ "author": "Timothy Schneider",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/taslabs-net/homeflare-kit.git",
12
+ "directory": "packages/distilled-openbao"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "type": "module",
21
+ "sideEffects": false,
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "bun": "./src/index.ts",
26
+ "worker": "./src/index.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./Credentials": {
30
+ "types": "./dist/credentials.d.ts",
31
+ "bun": "./src/credentials.ts",
32
+ "worker": "./src/credentials.ts",
33
+ "default": "./dist/credentials.js"
34
+ },
35
+ "./Errors": {
36
+ "types": "./dist/errors.d.ts",
37
+ "bun": "./src/errors.ts",
38
+ "worker": "./src/errors.ts",
39
+ "default": "./dist/errors.js"
40
+ },
41
+ "./Traits": {
42
+ "types": "./dist/traits.d.ts",
43
+ "bun": "./src/traits.ts",
44
+ "worker": "./src/traits.ts",
45
+ "default": "./dist/traits.js"
46
+ },
47
+ "./Protocol": {
48
+ "types": "./dist/protocol.d.ts",
49
+ "bun": "./src/protocol.ts",
50
+ "worker": "./src/protocol.ts",
51
+ "default": "./dist/protocol.js"
52
+ },
53
+ "./Retry": {
54
+ "types": "./dist/retry.d.ts",
55
+ "bun": "./src/retry.ts",
56
+ "worker": "./src/retry.ts",
57
+ "default": "./dist/retry.js"
58
+ },
59
+ "./*": {
60
+ "types": "./dist/services/*.d.ts",
61
+ "bun": "./src/services/*.ts",
62
+ "worker": "./src/services/*.ts",
63
+ "default": "./dist/services/*.js"
64
+ }
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "dependencies": {
70
+ "@distilled.cloud/core": "1.0.0-rc.12"
71
+ },
72
+ "peerDependencies": {
73
+ "effect": "4.0.0-rc.115"
74
+ }
75
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Proves `normalizeBaseUrl`'s trailing-slash trim is a linear scan, not the
3
+ * `/\/+$/` regex CodeQL flagged as js/polynomial-redos (alert 15 on kit PR
4
+ * 263): a long run of `/` must normalize correctly AND fast, not just
5
+ * correctly — a passing assertion alone wouldn't prove the fix, since the
6
+ * regex it replaces was also correct, just slow on adversarial input.
7
+ */
8
+ import { describe, expect, test } from "bun:test";
9
+ import { normalizeBaseUrl } from "./credentials.ts";
10
+
11
+ describe("normalizeBaseUrl", () => {
12
+ test("drops a single trailing slash and appends /v1", () => {
13
+ expect(normalizeBaseUrl("http://127.0.0.1:8200/")).toBe(
14
+ "http://127.0.0.1:8200/v1",
15
+ );
16
+ });
17
+
18
+ test("leaves an already-complete /v1 root alone", () => {
19
+ expect(normalizeBaseUrl("http://127.0.0.1:8200/v1")).toBe(
20
+ "http://127.0.0.1:8200/v1",
21
+ );
22
+ });
23
+
24
+ test("a long run of trailing slashes normalizes correctly and in linear time", () => {
25
+ const pathological = `http://127.0.0.1:8200${"/".repeat(50_000)}`;
26
+ const start = performance.now();
27
+ const result = normalizeBaseUrl(pathological);
28
+ const elapsedMs = performance.now() - start;
29
+
30
+ expect(result).toBe("http://127.0.0.1:8200/v1");
31
+ // The polynomial regex this replaced would visibly stall (seconds, not
32
+ // milliseconds) on an input this size; a generous bound still catches
33
+ // a regression without being a flaky timing assertion.
34
+ expect(elapsedMs).toBeLessThan(200);
35
+ });
36
+ });
@@ -0,0 +1,100 @@
1
+ /**
2
+ * OpenBao credentials — hand-written.
3
+ *
4
+ * The `Credentials` service resolves `{ token, apiBaseUrl, namespace }` per
5
+ * request; the protocol layer formats the `X-Vault-Token` (and, when set,
6
+ * `X-Vault-Namespace`) headers from it.
7
+ *
8
+ * OpenBao is self-hosted, so — unlike a single-tenant SaaS — there is no
9
+ * default API root: the address is part of the credential, same shape as
10
+ * `@distilled.cloud/forgejo`'s `FORGEJO_URL`/`FORGEJO_TOKEN`. The env var
11
+ * names (`BAO_ADDR`, `BAO_TOKEN`, `BAO_NAMESPACE`) match the kit's own
12
+ * `packages/alchemy/src/openbao/bao-address.ts` and the `bao` CLI itself.
13
+ */
14
+ import * as EffectConfig from "effect/Config";
15
+ import * as Context from "effect/Context";
16
+ import * as Effect from "effect/Effect";
17
+ import * as Layer from "effect/Layer";
18
+ import * as Redacted from "effect/Redacted";
19
+ import { ConfigError } from "@distilled.cloud/core/errors";
20
+
21
+ /**
22
+ * API path prefix — every OpenBao route is documented "prefixed with
23
+ * `/v1/`" (the generated spec's own `info.description`). It is a fixed path
24
+ * segment, not a header, so it belongs to the base URL exactly as Forgejo's
25
+ * `API_PATH` does.
26
+ */
27
+ export const API_PATH = "/v1";
28
+
29
+ /**
30
+ * Drop trailing slashes; the address carries no other structure to fix up.
31
+ * A loop, not `/\/+$/`: that regex backtracks polynomially on a long run of
32
+ * `/` (CodeQL js/polynomial-redos, alert 15 on kit PR 263) — the same fix
33
+ * as distilled-netbox's and distilled-unifi-network's `normalizeBaseUrl`.
34
+ */
35
+ const trimTrailingSlashes = (addr: string): string => {
36
+ let end = addr.length;
37
+ while (end > 0 && addr.charCodeAt(end - 1) === 47) end--;
38
+ return addr.slice(0, end);
39
+ };
40
+
41
+ /** Normalize an address (or an already-complete `/v1` root) into the API base URL. */
42
+ export const normalizeBaseUrl = (addr: string): string => {
43
+ const trimmed = trimTrailingSlashes(addr);
44
+ return trimmed.endsWith(API_PATH) ? trimmed : `${trimmed}${API_PATH}`;
45
+ };
46
+
47
+ export interface Config {
48
+ readonly token: Redacted.Redacted<string>;
49
+ /** Fully-qualified API root, e.g. `http://127.0.0.1:8200/v1`. */
50
+ readonly apiBaseUrl: string;
51
+ /** `X-Vault-Namespace`, when the estate uses one. Absent = root namespace. */
52
+ readonly namespace?: string;
53
+ }
54
+
55
+ export class Credentials extends Context.Service<
56
+ Credentials,
57
+ Effect.Effect<Config>
58
+ >()("OpenBaoCredentials") {}
59
+
60
+ const envConfig = EffectConfig.all({
61
+ token: EffectConfig.String("BAO_TOKEN"),
62
+ addr: EffectConfig.String("BAO_ADDR"),
63
+ namespace: EffectConfig.String("BAO_NAMESPACE").pipe(EffectConfig.option),
64
+ });
65
+
66
+ export const CredentialsFromEnv = Layer.succeed(
67
+ Credentials,
68
+ envConfig.pipe(
69
+ Effect.mapError(
70
+ () =>
71
+ new ConfigError({
72
+ message: "BAO_ADDR and BAO_TOKEN environment variables are required",
73
+ }),
74
+ ),
75
+ Effect.map(({ token, addr, namespace }) => ({
76
+ token: Redacted.make(token),
77
+ apiBaseUrl: normalizeBaseUrl(addr),
78
+ namespace: namespace.valueOrUndefined,
79
+ })),
80
+ Effect.orDie,
81
+ ),
82
+ );
83
+
84
+ /** Convenience layer from a plain token, address and optional namespace. */
85
+ export const credentials = (config: {
86
+ readonly token: string | Redacted.Redacted<string>;
87
+ readonly addr: string;
88
+ readonly namespace?: string;
89
+ }): Layer.Layer<Credentials> =>
90
+ Layer.succeed(
91
+ Credentials,
92
+ Effect.succeed({
93
+ token:
94
+ typeof config.token === "string"
95
+ ? Redacted.make(config.token)
96
+ : config.token,
97
+ apiBaseUrl: normalizeBaseUrl(config.addr),
98
+ namespace: config.namespace,
99
+ }),
100
+ );
package/src/errors.ts ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * OpenBao-specific error types.
3
+ *
4
+ * Re-exports the common HTTP errors from core and adds the OpenBao-specific
5
+ * unknown-error and parse-error wrappers.
6
+ *
7
+ * OpenBao's failure envelope is `{"errors": [...]}` — zero or more strings,
8
+ * frequently empty (measured 2026-09-24: a 404 on a missing ACL policy
9
+ * answers `{"errors":[]}`, no text at all — vault/logical_system.go's
10
+ * `handlePoliciesRead` returns no response, which `RespondErrorCommon` turns
11
+ * into a bare status). There is rarely a machine-readable code, so most
12
+ * operations dispatch on the HTTP status alone: the per-operation classes
13
+ * generated from each operation's declared responses first, then core's
14
+ * shared status map, then {@link UnknownOpenBaoError}. Operations whose
15
+ * absence, conflict or refusal needs a resource-specific tag are typed by
16
+ * status (and message, when OpenBao supplies one) under `patches/`.
17
+ */
18
+ export {
19
+ BadGateway,
20
+ BadRequest,
21
+ Conflict,
22
+ ConfigError,
23
+ Forbidden,
24
+ GatewayTimeout,
25
+ InternalServerError,
26
+ Locked,
27
+ NotFound,
28
+ ServiceUnavailable,
29
+ TooManyRequests,
30
+ Unauthorized,
31
+ UnprocessableEntity,
32
+ HTTP_STATUS_MAP,
33
+ DEFAULT_ERRORS,
34
+ API_ERRORS,
35
+ } from "@distilled.cloud/core/errors";
36
+ import type { DefaultErrors as CoreDefaultErrors } from "@distilled.cloud/core/errors";
37
+
38
+ import * as Schema from "effect/Schema";
39
+ import * as Category from "@distilled.cloud/core/category";
40
+
41
+ /**
42
+ * Unknown OpenBao error — returned when a failed response's HTTP status has
43
+ * no mapped error class. Carries the raw body for later cataloging.
44
+ */
45
+ export class UnknownOpenBaoError extends Schema.TaggedError<UnknownOpenBaoError>()(
46
+ "UnknownOpenBaoError",
47
+ {
48
+ code: Schema.optional(Schema.String),
49
+ message: Schema.optional(Schema.String),
50
+ body: Schema.Unknown,
51
+ },
52
+ ).pipe(Category.withServerError) {}
53
+
54
+ /** Schema parse error wrapper. */
55
+ export class OpenBaoParseError extends Schema.TaggedError<OpenBaoParseError>()(
56
+ "OpenBaoParseError",
57
+ {
58
+ body: Schema.Unknown,
59
+ cause: Schema.Unknown,
60
+ },
61
+ ).pipe(Category.withParseError) {}
62
+
63
+ /**
64
+ * Errors any OpenBao operation may surface in addition to the per-operation
65
+ * typed status errors.
66
+ */
67
+ export type ClientErrors = UnknownOpenBaoError | OpenBaoParseError;
68
+
69
+ /**
70
+ * Default OpenBao operation errors: the shared HTTP status errors from core
71
+ * plus the client-level fallback/decode errors.
72
+ */
73
+ export type DefaultErrors = CoreDefaultErrors | ClientErrors;
package/src/index.ts ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @distilled.cloud/openbao — OpenBao HTTP API SDK for Effect.
3
+ *
4
+ * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
+ * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
6
+ * document that `stacks/distilled-submodules/spec-repos/openbao/
7
+ * fetch-specs.ts` generates by mounting OpenBao's own stock backends on a
8
+ * throwaway local `-dev` server). Everything else in this folder is
9
+ * hand-written.
10
+ *
11
+ * One module per mount/backend prefix — `policies`, `kv`, `pki`, `approle`,
12
+ * `database`, `ssh`, `sys`, … — bucketed from each operation's own
13
+ * `operationId` (see `scripts/convert.ts`'s module docs).
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import * as OpenBao from "@distilled.cloud/openbao";
18
+ *
19
+ * const policy = yield* OpenBao.Services.policies.policiesReadAclPolicy({
20
+ * name: "agent",
21
+ * });
22
+ * ```
23
+ */
24
+ export * from "./credentials.ts";
25
+ export * from "./errors.ts";
26
+ export * as T from "./traits.ts";
27
+ export {
28
+ OpenBaoProtocol,
29
+ type OpenBaoOpError,
30
+ type OpenBaoOpContext,
31
+ } from "./protocol.ts";
32
+ export * as Retry from "./retry.ts";
33
+ export * as Services from "./services/index.ts";
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Proves the two measured, package-specific rules in `protocol.ts`: the
3
+ * `{"errors": [...]}` envelope (often empty — the common 404 shape) and the
4
+ * `data`-envelope unwrap on 2xx bodies. Same pattern as
5
+ * `@distilled.cloud/proxmox`'s `protocol.test.ts` (a fake `HttpClient`
6
+ * layer in front of a real generated operation), written after that file's
7
+ * own history: an adversarial review is what caught the proxmox bug this
8
+ * pattern exists to stop recurring, so OpenBao gets the same coverage from
9
+ * the start rather than after its own incident.
10
+ */
11
+ import { describe, expect, test } from "bun:test";
12
+ import * as Effect from "effect/Effect";
13
+ import * as Layer from "effect/Layer";
14
+ import * as HttpClient from "effect/unstable/http/HttpClient";
15
+ import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
16
+ import { credentials } from "./credentials.ts";
17
+ import { Forbidden, UnknownOpenBaoError } from "./errors.ts";
18
+ import * as Retry from "./retry.ts";
19
+ import { PolicyNotFound, policiesReadAclPolicy } from "./services/policies.ts";
20
+
21
+ const testCredentials = credentials({
22
+ token: "test-token",
23
+ addr: "http://127.0.0.1:8299",
24
+ namespace: "homeflare",
25
+ });
26
+
27
+ const fakeOpenBao = (status: number, body: unknown) =>
28
+ Layer.succeed(
29
+ HttpClient.HttpClient,
30
+ HttpClient.make((request) =>
31
+ Effect.sync(() =>
32
+ HttpClientResponse.fromWeb(
33
+ request,
34
+ new Response(body === undefined ? undefined : JSON.stringify(body), {
35
+ status,
36
+ }),
37
+ ),
38
+ ),
39
+ ),
40
+ );
41
+
42
+ const readAbsent = (status: number, body: unknown) =>
43
+ Effect.runPromise(
44
+ policiesReadAclPolicy({ name: "zz-probe-absent" }).pipe(
45
+ Retry.none,
46
+ Effect.provide(
47
+ Layer.mergeAll(fakeOpenBao(status, body), testCredentials),
48
+ ),
49
+ Effect.flip,
50
+ ),
51
+ );
52
+
53
+ describe("protocol.ts error decoding", () => {
54
+ test("a 404 with an EMPTY errors array (the measured absent-policy shape) is PolicyNotFound", async () => {
55
+ // Measured on OpenBao 2.6.2, 2026-09-24: GET sys/policies/acl/<absent>
56
+ // answers exactly this — see patches/policies/_errors.json.
57
+ const error = await readAbsent(404, { errors: [] });
58
+ expect(error).toBeInstanceOf(PolicyNotFound);
59
+ });
60
+
61
+ test("a 403 with an errors array falls back to core's status map (Forbidden), joined", async () => {
62
+ const error = await readAbsent(403, {
63
+ errors: ["permission denied", "token expired"],
64
+ });
65
+ expect(error).toBeInstanceOf(Forbidden);
66
+ expect(error).toMatchObject({
67
+ message: "permission denied; token expired",
68
+ });
69
+ });
70
+
71
+ // 418 is neither in HTTP_STATUS_MAP nor >= 500 (the unmapped-5xx fallback
72
+ // in core's makeRestProtocol answers InternalServerError for those before
73
+ // unknownError is ever reached).
74
+ test("a genuinely unmapped, non-5xx status still falls back to UnknownOpenBaoError", async () => {
75
+ const error = await readAbsent(418, { errors: ["teapot"] });
76
+ expect(error).toBeInstanceOf(UnknownOpenBaoError);
77
+ });
78
+
79
+ test('the {"data": ...} envelope is unwrapped before decode', async () => {
80
+ const result = await Effect.runPromise(
81
+ policiesReadAclPolicy({ name: "agent" }).pipe(
82
+ Effect.provide(
83
+ Layer.mergeAll(
84
+ fakeOpenBao(200, {
85
+ request_id: "r-1",
86
+ lease_id: "",
87
+ renewable: false,
88
+ lease_duration: 0,
89
+ data: { name: "agent", policy: 'path "secret/*" {}', version: 1 },
90
+ wrap_info: null,
91
+ warnings: null,
92
+ auth: null,
93
+ }),
94
+ testCredentials,
95
+ ),
96
+ ),
97
+ ),
98
+ );
99
+ expect(result).toMatchObject({
100
+ name: "agent",
101
+ policy: 'path "secret/*" {}',
102
+ });
103
+ });
104
+
105
+ test("sys/health-shaped bodies (no data envelope) pass through unchanged", async () => {
106
+ // Not every endpoint is a logical response — sys/health answers its
107
+ // fields at the top level, with no `data` wrapper. This operation never
108
+ // calls that endpoint; the test exercises transformResponse directly
109
+ // through a 2xx body that happens to have no `data` field, confirming
110
+ // the unwrap only fires when one is actually present.
111
+ const result = await Effect.runPromise(
112
+ policiesReadAclPolicy({ name: "agent" }).pipe(
113
+ Effect.provide(
114
+ Layer.mergeAll(
115
+ fakeOpenBao(200, { name: "agent", policy: "" }),
116
+ testCredentials,
117
+ ),
118
+ ),
119
+ ),
120
+ );
121
+ expect(result).toMatchObject({ name: "agent", policy: "" });
122
+ });
123
+ });