@homeflare/alchemy 0.3.1 → 0.4.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Custom [Alchemy](https://alchemy.run) providers for gaps the vendor SDK leaves.
4
4
 
5
5
  ```sh
6
- bun add @homeflare/alchemy alchemy@2.0.0-beta.78 effect@4.0.0-rc.115 \
6
+ bun add @homeflare/alchemy alchemy@2.0.0-beta.79 effect@4.0.0-rc.115 \
7
7
  @effect/platform-node@4.0.0-rc.115 cloudflare@4.5.0 mime@4.1.0
8
8
  ```
9
9
 
@@ -76,7 +76,7 @@ like a bad credential.
76
76
  ## Peers — and one override you need
77
77
 
78
78
  ```sh
79
- bun add @homeflare/alchemy alchemy@2.0.0-beta.78 effect@4.0.0-rc.115 \
79
+ bun add @homeflare/alchemy alchemy@2.0.0-beta.79 effect@4.0.0-rc.115 \
80
80
  @effect/platform-node@4.0.0-rc.115 cloudflare@4.5.0 mime@4.1.0
81
81
  ```
82
82
 
@@ -116,10 +116,9 @@ stay there. The override is still the only thing that holds the set together.
116
116
  `Cloudflare/Workers/WorkerBridge → @effect/platform-node/NodeServices` even when you only
117
117
  import the Proxmox subpath.
118
118
 
119
- ⚠️ So is `mime`. Alchemy 78's `@alchemy.run/cloudflare-runtime` imports it and does
120
- not declare it. `@effect/platform-node` has `mime` as its own dependency, but a clean
121
- consumer install (no hoist) cannot see that copy — measured 2026-09-17, every subpath
122
- threw `Cannot find package 'mime'` until it was installed next to the peers.
119
+ ⚠️ So is `mime`. Alchemy 78's `@alchemy.run/cloudflare-runtime` imported it without
120
+ declaring it (measured 2026-09-17). 79 declares it; the peer stays so a consumer
121
+ that followed the 78 README does not drop a required line.
123
122
 
124
123
  ⚠️ So is `cloudflare`. It was marked optional in 0.1.1, which claimed the `/cloudflare`
125
124
  subpath would degrade without it — measured 2026-09-16, the subpath does not load at all:
@@ -0,0 +1,43 @@
1
+ export interface BaoAuthMethodProps {
2
+ /** Auth path without trailing slash, as `sys/auth/<path>` takes it. */
3
+ path: string;
4
+ /** Auth method type, e.g. `approle`, `jwt`, `oidc`. */
5
+ type: string;
6
+ /** Human description — sent on enable and on tune, as configure-engines does. */
7
+ description?: string;
8
+ /** Default lease TTL, e.g. `768h`. */
9
+ defaultLeaseTtl?: string;
10
+ /** Max lease TTL, e.g. `8760h`. */
11
+ maxLeaseTtl?: string;
12
+ }
13
+ export interface BaoAuthMethodAttributes {
14
+ path: string;
15
+ type: string;
16
+ description: string;
17
+ defaultLeaseTtl: string;
18
+ maxLeaseTtl: string;
19
+ /** SHA-256 of the managed fields — safe to persist; see policy.ts. */
20
+ digest: string;
21
+ }
22
+ /** Auth path without a trailing slash — listing keys are `${path}/`. */
23
+ export declare const authPath: (path: string) => string;
24
+ export declare const attributesOf: (props: BaoAuthMethodProps, live: Record<string, unknown>) => BaoAuthMethodAttributes;
25
+ /** `sys/auth/<path>` — read, enable and disable all address the method here. */
26
+ export declare const readPath: (path: string) => string;
27
+ /**
28
+ * ★ SAME TUNE ROUTE SHAPE AS SECRETS MOUNTS. `bao auth tune` hits
29
+ * `sys/auth/<path>/tune` (openbao v2.6.2 api/sys_auth.go TuneAuth).
30
+ */
31
+ export declare const tunePath: (path: string) => string;
32
+ /**
33
+ * The enable body. configure-engines POSTed `{ type, description }` for approle.
34
+ *
35
+ * ⚠️ TTLs ARE NOT SENT HERE. reconcile tunes them after enable, same as Bao.Mount.
36
+ */
37
+ export declare const enableBody: (props: BaoAuthMethodProps) => Record<string, string>;
38
+ /** Tune body — only the fields the declaration names. An omitted field is left alone. */
39
+ export declare const tuneBody: (props: BaoAuthMethodProps) => Record<string, string>;
40
+ /** True when live already matches the declaration on every managed field. */
41
+ export declare const matches: (attributes: BaoAuthMethodAttributes, props: BaoAuthMethodProps) => boolean;
42
+ export declare const wantsTune: (props: BaoAuthMethodProps) => boolean;
43
+ //# sourceMappingURL=auth-method-form.d.ts.map
@@ -0,0 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 +1,21 @@
1
+ /**
2
+ * The OpenBao calls Bao.AuthMethod makes — read one method, enable, tune, disable.
3
+ *
4
+ * ★ ENDPOINTS, READ FROM openbao v2.6.2 api/sys_auth.go — the client configure-engines
5
+ * used via curl:
6
+ * read GET sys/auth/<path>
7
+ * enable POST sys/auth/<path> — `bao auth enable`
8
+ * tune POST sys/auth/<path>/tune — `bao auth tune`
9
+ * disable DELETE sys/auth/<path> — `bao auth disable`
10
+ * table GET sys/auth
11
+ */
12
+ import * as Effect from 'effect/Effect';
13
+ import { type BaoAuthMethodProps } from './auth-method-form.ts';
14
+ import { BaoError } from './bao-status.ts';
15
+ /** One method's config (`type`, `description`, `config.*_lease_ttl`), or undefined when absent. */
16
+ export declare const readAuthMethodData: (path: string) => Effect.Effect<Record<string, unknown> | undefined, BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
17
+ export declare const enableAuthMethod: (props: BaoAuthMethodProps) => Effect.Effect<void, BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
18
+ export declare const tuneAuthMethod: (props: BaoAuthMethodProps) => Effect.Effect<void, BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
19
+ /** ⚠️ THERE IS NO FORCE. Disable is a plain DELETE, same as `bao auth disable`. */
20
+ export declare const disableAuthMethod: (path: string) => Effect.Effect<void, BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
21
+ //# sourceMappingURL=auth-method-wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-method-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-method-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA4B3C,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,SAAU,MAAM,uHAM5C,CAAC;AAEJ,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,wFACC,CAAC;AAE5D,eAAO,MAAM,cAAc,UAAW,kBAAkB,wFACC,CAAC;AAE1D,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,SAAU,MAAM,wFAA8B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * An OpenBao auth method — path, type, description and lease TTLs.
3
+ *
4
+ * ⛔ NO SECRET IN PROPS OR ATTRIBUTES — see policy.ts. This enables `approle` (or jwt/oidc)
5
+ * as a mount. Role ids, OIDC client secrets, and secret_ids are out of scope.
6
+ *
7
+ * ★ `defaultRemovalPolicy: 'retain'` — disabling a method destroys every role under it
8
+ * and revokes tokens minted through those roles. Opt in with
9
+ * `.pipe(RemovalPolicy.destroy())`.
10
+ */
11
+ import { Resource } from 'alchemy';
12
+ import * as Provider from 'alchemy/Provider';
13
+ import type * as HttpClient from 'effect/unstable/http/HttpClient';
14
+ import { type BaoAuthMethodAttributes, type BaoAuthMethodProps } from './auth-method-form.ts';
15
+ export type { BaoAuthMethodAttributes, BaoAuthMethodProps };
16
+ export interface BaoAuthMethod extends Resource<'Bao.AuthMethod', BaoAuthMethodProps, BaoAuthMethodAttributes, never, HttpClient.HttpClient> {
17
+ }
18
+ export declare const BaoAuthMethod: import("alchemy").ResourceClass<BaoAuthMethod>;
19
+ export declare const BaoAuthMethodProvider: () => import("effect/Layer").Layer<Provider.Provider<BaoAuthMethod>, never, HttpClient.HttpClient>;
20
+ //# sourceMappingURL=auth-method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-method.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAKxB,MAAM,uBAAuB,CAAC;AAQ/B,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAC;AAE5D,MAAM,WAAW,aAAc,SAAQ,QAAQ,CAC7C,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,aAAa,gDAExB,CAAC;AASH,eAAO,MAAM,qBAAqB,oGAmE/B,CAAC"}
@@ -8,6 +8,7 @@
8
8
  * ★ Anything unlisted is still reachable by path if you genuinely need it — that is a
9
9
  * deliberate, visible act rather than an accident of barrelling.
10
10
  */
11
+ export { BaoAuthMethod, BaoAuthMethodProvider } from './auth-method.ts';
11
12
  export { BaoAuthRole, BaoAuthRoleProvider } from './auth-role.ts';
12
13
  export { BaoCloudflareRole, BaoCloudflareRoleProvider } from './cloudflare-role.ts';
13
14
  export { CloudflarePermissionGroups, permissionGroupsFromEngine, permissionGroupsFromLiveRoles, } from './cloudflare-permission-groups.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openbao/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;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