@homeflare/alchemy 0.42.0 → 0.43.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/dist/litellm/budget-errors.d.ts +36 -0
- package/dist/litellm/budget-errors.d.ts.map +1 -0
- package/dist/litellm/budget-form.d.ts +50 -0
- package/dist/litellm/budget-form.d.ts.map +1 -0
- package/dist/litellm/budget-operations.d.ts +20 -0
- package/dist/litellm/budget-operations.d.ts.map +1 -0
- package/dist/litellm/budget.d.ts +61 -0
- package/dist/litellm/budget.d.ts.map +1 -0
- package/dist/litellm/fake-litellm.d.ts +5 -0
- package/dist/litellm/fake-litellm.d.ts.map +1 -1
- package/dist/litellm/index.d.ts +2 -0
- package/dist/litellm/index.d.ts.map +1 -1
- package/dist/litellm/index.js +125 -2
- package/dist/litellm/index.js.map +9 -5
- package/dist/litellm/operations.d.ts +22 -0
- package/dist/litellm/operations.d.ts.map +1 -1
- package/dist/litellm/providers.d.ts +1 -1
- package/dist/litellm/providers.d.ts.map +1 -1
- package/dist/openbao/auth-role-form.d.ts +9 -0
- package/dist/openbao/auth-role-form.d.ts.map +1 -1
- package/dist/openbao/auth-role-wire.d.ts.map +1 -1
- package/dist/openbao/fake-engines-roles.d.ts.map +1 -1
- package/dist/openbao/index.js +9 -6
- package/dist/openbao/index.js.map +4 -4
- package/dist/postgres/connection.d.ts +20 -2
- package/dist/postgres/connection.d.ts.map +1 -1
- package/dist/postgres/database-sql.d.ts +1 -1
- package/dist/postgres/database-sql.d.ts.map +1 -1
- package/dist/postgres/database.d.ts +1 -1
- package/dist/postgres/database.d.ts.map +1 -1
- package/dist/postgres/index.d.ts +5 -3
- package/dist/postgres/index.d.ts.map +1 -1
- package/dist/postgres/index.js +124 -38
- package/dist/postgres/index.js.map +8 -7
- package/dist/postgres/providers.d.ts +4 -2
- package/dist/postgres/providers.d.ts.map +1 -1
- package/dist/postgres/psql-executor.d.ts +21 -0
- package/dist/postgres/psql-executor.d.ts.map +1 -0
- package/dist/proxmox/ceph-flag-types.d.ts +57 -0
- package/dist/proxmox/ceph-flag-types.d.ts.map +1 -0
- package/dist/proxmox/ceph-flag-wire.d.ts +77 -0
- package/dist/proxmox/ceph-flag-wire.d.ts.map +1 -0
- package/dist/proxmox/ceph-flag.d.ts +15 -50
- package/dist/proxmox/ceph-flag.d.ts.map +1 -1
- package/dist/proxmox/ceph-osd-write.d.ts +10 -13
- package/dist/proxmox/ceph-osd-write.d.ts.map +1 -1
- package/dist/proxmox/index.js +772 -740
- package/dist/proxmox/index.js.map +8 -7
- package/docs/litellm-budget.md +55 -0
- package/docs/litellm.md +7 -6
- package/docs/postgres.md +22 -0
- package/docs/proxmox-sdk-migration.md +45 -0
- package/package.json +3 -3
- package/src/litellm/budget-errors.ts +38 -0
- package/src/litellm/budget-form.ts +94 -0
- package/src/litellm/budget-operations.ts +51 -0
- package/src/litellm/budget.test.ts +105 -0
- package/src/litellm/budget.ts +127 -0
- package/src/litellm/fake-litellm.ts +50 -1
- package/src/litellm/index.ts +13 -0
- package/src/litellm/operations.ts +1 -1
- package/src/litellm/providers.ts +4 -1
- package/src/openbao/auth-role-form.test.ts +37 -0
- package/src/openbao/auth-role-form.ts +12 -1
- package/src/openbao/auth-role-wire.test.ts +1 -0
- package/src/openbao/auth-role-wire.ts +13 -1
- package/src/openbao/distilled-retry.test.ts +1 -0
- package/src/openbao/fake-engines-roles.ts +7 -1
- package/src/postgres/connection.ts +37 -3
- package/src/postgres/database-sql.ts +4 -3
- package/src/postgres/database.ts +3 -2
- package/src/postgres/index.ts +10 -3
- package/src/postgres/providers.ts +15 -2
- package/src/postgres/psql-executor.test.ts +106 -0
- package/src/postgres/psql-executor.ts +130 -0
- package/src/proxmox/ceph-flag-types.ts +70 -0
- package/src/proxmox/ceph-flag-wire.test.ts +72 -0
- package/src/proxmox/ceph-flag-wire.ts +123 -0
- package/src/proxmox/ceph-flag.ts +77 -130
- package/src/proxmox/ceph-osd-write.ts +10 -13
|
@@ -34,6 +34,28 @@ import * as Effect from 'effect/Effect';
|
|
|
34
34
|
export type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';
|
|
35
35
|
export type LitellmRequirements = LitellmOpContext;
|
|
36
36
|
export type { PassThroughEndpointResponse, PassThroughGenericEndpoint, PassThroughGuardrailSettings, } from '@distilled.cloud/litellm/misc';
|
|
37
|
+
/**
|
|
38
|
+
* Serialises a write against this call's own base URL — see the file header.
|
|
39
|
+
*
|
|
40
|
+
* ⚠️ `Credentials` itself ends in `Effect.orDie` on a missing/misspelled env var (Q6, decision
|
|
41
|
+
* 49 "upstream wins", 2026-09-24, matching distilled's own convention — 73 of 80 packages'
|
|
42
|
+
* `credentials.ts` do the same at `homeflare/base`), so resolving it here can no longer fail
|
|
43
|
+
* typed. The `| ConfigError` this function still adds to its return type stays only because
|
|
44
|
+
* `@distilled.cloud/litellm`'s own `LitellmOpError` (protocol.ts) unconditionally declares
|
|
45
|
+
* `ConfigError` as a member of every generated operation's error union regardless of
|
|
46
|
+
* `Credentials`'s own type — so `E` (the wrapped operation's error) already contains it, and
|
|
47
|
+
* this widening is a genuine no-op for callers, not dead type-state left over from the revert.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* ⛔ THE STACK'S AMBIENT `HttpClient` MAY BE CADDY'S. `caddyProviders()` provideMerges a client
|
|
51
|
+
* that dials the admin listener and ignores the request host (`caddy-http-client.ts`). Measured
|
|
52
|
+
* 2026-09-25: that client answers `GET /config/pass_through_endpoint` with HTTP 200 `null`
|
|
53
|
+
* (Caddy's empty-config body). The decoded value then has no `endpoints`, and `locate` throws
|
|
54
|
+
* `rows.find` of undefined. FetchHttpClient uses the URL the LiteLLM protocol built. An outer
|
|
55
|
+
* `Fetch` service still wins inside that client, which is how the fake proxy stays the test
|
|
56
|
+
* transport.
|
|
57
|
+
*/
|
|
58
|
+
export declare const throughFetch: <A, E, R>(io: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, import("effect/unstable/http/HttpClient").HttpClient>>;
|
|
37
59
|
/** GET /config/pass_through_endpoint — every row, config-file and DB alike. Not under the semaphore: reads don't race the field. */
|
|
38
60
|
export declare const listPassThroughEndpoints: () => Effect.Effect<readonly misc.PassThroughGenericEndpoint[], misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError, LitellmOpContext>;
|
|
39
61
|
/** POST /config/pass_through_endpoint. `body` carries `id` — see pass-through-form.ts. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/litellm/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACnD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/litellm/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACnD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AAcvC;;;;;;;;;;;GAWG;AACH;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,0FAChB,CAAC;AA0BjD,oIAAoI;AACpI,eAAO,MAAM,wBAAwB,QAAO,MAAM,CAAC,MAAM,CACvD,SAAS,IAAI,CAAC,0BAA0B,EAAE,EAC1C,IAAI,CAAC,wDAAwD,EAC7D,gBAAgB,CAIf,CAAC;AAEJ,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB,SAC9B,IAAI,CAAC,0BAA0B,KACpC,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,4DAA4D,EACjE,gBAAgB,CACiF,CAAC;AAEpG;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,QACZ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GACrE,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,KACzD,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,sEAAsE,EAC3E,gBAAgB,CASf,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,KACjB,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,8DAA8D,EACnE,gBAAgB,CAcf,CAAC"}
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { type Credentials } from '@distilled.cloud/litellm/Credentials';
|
|
22
22
|
import * as Layer from 'effect/Layer';
|
|
23
|
-
export declare const litellmProviders: (creds?: Layer.Layer<Credentials>) => Layer.Layer<Credentials | import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
|
|
23
|
+
export declare const litellmProviders: (creds?: Layer.Layer<Credentials>) => Layer.Layer<Credentials | import("alchemy").Provider<import("./budget.ts").LiteLLMBudget> | import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
|
|
24
24
|
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,eAAO,MAAM,gBAAgB,WAAW,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,8SAG7D,CAAC"}
|
|
@@ -13,6 +13,14 @@ export interface BaoAuthRoleProps {
|
|
|
13
13
|
bindSecretId?: boolean;
|
|
14
14
|
/** `0` means unlimited uses — the shape reconcile.sh writes for headless roles. */
|
|
15
15
|
secretIdNumUses?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Token period, e.g. `24h` — set only for a periodic (forever-renewable) role, where
|
|
18
|
+
* `tokenTtl`/`tokenMaxTtl` are conventionally `'0'`. Omitted means this declaration does not
|
|
19
|
+
* manage the field: a live role's `token_period` (however it got set) is left untouched, the
|
|
20
|
+
* same way an omitted `bindSecretId` is. See house `openbao/approles.ts` for the role this
|
|
21
|
+
* unblocks — a periodic agent token that was inexpressible with these props.
|
|
22
|
+
*/
|
|
23
|
+
tokenPeriod?: string;
|
|
16
24
|
}
|
|
17
25
|
export interface BaoAuthRoleAttributes {
|
|
18
26
|
name: string;
|
|
@@ -22,6 +30,7 @@ export interface BaoAuthRoleAttributes {
|
|
|
22
30
|
secretIdTtl: string;
|
|
23
31
|
bindSecretId: boolean;
|
|
24
32
|
secretIdNumUses: number;
|
|
33
|
+
tokenPeriod: string;
|
|
25
34
|
/** SHA-256 of the managed fields — safe to persist; see policy.ts. */
|
|
26
35
|
digest: string;
|
|
27
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAYF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;AAWtE,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,qBAAqB,SAAS,gBAAgB,YAWjF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAyB3C,eAAO,MAAM,YAAY,SAAU,MAAM,81BAQtC,CAAC;AAEJ,eAAO,MAAM,cAAc,SAAU,MAAM,k0BACwB,CAAC;AAEpE,eAAO,MAAM,eAAe,UAAW,gBAAgB,4DAkCnD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,gBAAgB,0PAC6C,CAAC;AAEnG,+EAA+E;AAC/E,eAAO,MAAM,cAAc,SAAU,MAAM,s4BACqD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,
|
|
1
|
+
{"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,KAa1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,KAO9B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,KAuB9B,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAIC,IAAI,KAAG,KAAK;;;;CAMnC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/openbao/index.js
CHANGED
|
@@ -858,7 +858,8 @@ var attributesOf3 = (props, live) => {
|
|
|
858
858
|
tokenMaxTtl: ttlText(ttlSeconds(live["token_max_ttl"])),
|
|
859
859
|
secretIdTtl: ttlText(ttlSeconds(live["secret_id_ttl"]), "0"),
|
|
860
860
|
bindSecretId: bool(live["bind_secret_id"], true),
|
|
861
|
-
secretIdNumUses: int(live["secret_id_num_uses"], 0)
|
|
861
|
+
secretIdNumUses: int(live["secret_id_num_uses"], 0),
|
|
862
|
+
tokenPeriod: ttlText(ttlSeconds(live["token_period"]), "0")
|
|
862
863
|
};
|
|
863
864
|
return { ...attrs, digest: sha256(JSON.stringify(attrs)) };
|
|
864
865
|
};
|
|
@@ -871,7 +872,7 @@ var sameTtl3 = (want, have) => {
|
|
|
871
872
|
};
|
|
872
873
|
var matches3 = (attributes, props) => {
|
|
873
874
|
const wantPolicies = props.tokenPolicies.slice().sort();
|
|
874
|
-
return samePolicies(wantPolicies, attributes.tokenPolicies) && sameTtl3(props.tokenTtl, attributes.tokenTtl) && sameTtl3(props.tokenMaxTtl, attributes.tokenMaxTtl) && sameTtl3(props.secretIdTtl, attributes.secretIdTtl) && (props.bindSecretId === undefined || attributes.bindSecretId === props.bindSecretId) && (props.secretIdNumUses === undefined || attributes.secretIdNumUses === props.secretIdNumUses);
|
|
875
|
+
return samePolicies(wantPolicies, attributes.tokenPolicies) && sameTtl3(props.tokenTtl, attributes.tokenTtl) && sameTtl3(props.tokenMaxTtl, attributes.tokenMaxTtl) && sameTtl3(props.secretIdTtl, attributes.secretIdTtl) && (props.bindSecretId === undefined || attributes.bindSecretId === props.bindSecretId) && (props.secretIdNumUses === undefined || attributes.secretIdNumUses === props.secretIdNumUses) && (props.tokenPeriod === undefined || sameTtl3(props.tokenPeriod, attributes.tokenPeriod));
|
|
875
876
|
};
|
|
876
877
|
|
|
877
878
|
// src/openbao/auth-role-wire.ts
|
|
@@ -906,14 +907,15 @@ var runBaoWrite = (operation, timeout3 = BAO_TIMEOUT) => retryTransport(runBao(o
|
|
|
906
907
|
// src/openbao/auth-role-wire.ts
|
|
907
908
|
var identity = (name) => ({ approle_mount_path: "approle", role_name: name });
|
|
908
909
|
var seconds = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
909
|
-
var completeRole = (live) => live !== null && typeof live === "object" && typeof live.bind_secret_id === "boolean" && seconds(live.secret_id_num_uses) && seconds(live.secret_id_ttl) && seconds(live.token_ttl) && seconds(live.token_max_ttl) && Array.isArray(live.token_policies) && live.token_policies.every((policy) => typeof policy === "string");
|
|
910
|
+
var completeRole = (live) => live !== null && typeof live === "object" && typeof live.bind_secret_id === "boolean" && seconds(live.secret_id_num_uses) && seconds(live.secret_id_ttl) && seconds(live.token_ttl) && seconds(live.token_max_ttl) && seconds(live.token_period) && Array.isArray(live.token_policies) && live.token_policies.every((policy) => typeof policy === "string");
|
|
910
911
|
var readAuthRole = (name) => runBaoRead(appRoleReadRole(identity(name))).pipe(Effect14.flatMap((live) => completeRole(live) ? Effect14.succeed(live) : Effect14.fail(new BaoError(200, "GET", readPath3(name), ["incomplete role metadata"]))), Effect14.catchTag("NotFound", () => Effect14.succeed(undefined)));
|
|
911
912
|
var authRoleExists = (name) => readAuthRole(name).pipe(Effect14.map((live) => live !== undefined));
|
|
912
913
|
var authRoleRequest = (props) => Effect14.gen(function* () {
|
|
913
914
|
const tokenTtl = parseDuration(props.tokenTtl);
|
|
914
915
|
const tokenMaxTtl = parseDuration(props.tokenMaxTtl);
|
|
915
916
|
const secretIdTtl = parseDuration(props.secretIdTtl);
|
|
916
|
-
|
|
917
|
+
const tokenPeriod = props.tokenPeriod === undefined ? undefined : parseDuration(props.tokenPeriod);
|
|
918
|
+
if (!seconds(tokenTtl) || !seconds(tokenMaxTtl) || !seconds(secretIdTtl) || props.tokenPeriod !== undefined && !seconds(tokenPeriod)) {
|
|
917
919
|
return yield* Effect14.fail(new BaoError(0, "POST", readPath3(props.name), ["invalid role TTL duration"]));
|
|
918
920
|
}
|
|
919
921
|
const request = {
|
|
@@ -923,7 +925,8 @@ var authRoleRequest = (props) => Effect14.gen(function* () {
|
|
|
923
925
|
token_max_ttl: tokenMaxTtl,
|
|
924
926
|
secret_id_ttl: secretIdTtl,
|
|
925
927
|
...props.bindSecretId === undefined ? {} : { bind_secret_id: props.bindSecretId },
|
|
926
|
-
...props.secretIdNumUses === undefined ? {} : { secret_id_num_uses: props.secretIdNumUses }
|
|
928
|
+
...props.secretIdNumUses === undefined ? {} : { secret_id_num_uses: props.secretIdNumUses },
|
|
929
|
+
...tokenPeriod === undefined ? {} : { token_period: tokenPeriod }
|
|
927
930
|
};
|
|
928
931
|
return request;
|
|
929
932
|
});
|
|
@@ -3592,5 +3595,5 @@ export {
|
|
|
3592
3595
|
revokeSelfEffect
|
|
3593
3596
|
};
|
|
3594
3597
|
|
|
3595
|
-
//# debugId=
|
|
3598
|
+
//# debugId=6284E1A37FA458FA64756E2164756E21
|
|
3596
3599
|
//# sourceMappingURL=index.js.map
|