@tpsdev-ai/flair 0.8.2 → 0.8.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.
- package/dist/resources/health.js +20 -1
- package/package.json +1 -1
package/dist/resources/health.js
CHANGED
|
@@ -17,13 +17,32 @@ const exists = async (path) => {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* Health endpoint —
|
|
20
|
+
* Health endpoint — truly public, returns only { ok: true }.
|
|
21
|
+
*
|
|
22
|
+
* `allowRead() { return true }` opens Harper's role gate for anonymous GETs,
|
|
23
|
+
* which is what makes /Health work for callers outside `authorizeLocal`'s
|
|
24
|
+
* localhost-bypass. Without this, Harper's intrinsic Basic-auth gate fires
|
|
25
|
+
* BEFORE our HTTP middleware can apply the /Health bypass list in
|
|
26
|
+
* auth-middleware.ts, so remote callers (e.g., from rockit hitting a Fabric-
|
|
27
|
+
* hosted Flair) get a 401 even though the Resource handler is intentionally
|
|
28
|
+
* unauthenticated. Symptom matched: Fabric returned 401 + WWW-Authenticate:
|
|
29
|
+
* Basic on /Health while rockit-localhost returned 200 — the difference was
|
|
30
|
+
* Harper's localhost-auto-auth, not anything in our code.
|
|
31
|
+
*
|
|
32
|
+
* Same pattern as `FederationPair.allowCreate(){ return true }` (PR #299):
|
|
33
|
+
* declare the Resource anonymously-accessible at the Harper layer; let the
|
|
34
|
+
* handler itself enforce whatever it needs (in this case, nothing — /Health
|
|
35
|
+
* is intentionally and always public).
|
|
21
36
|
*
|
|
22
37
|
* Rich stats (memory counts, agent names, etc.) are behind /HealthDetail
|
|
23
38
|
* which requires authentication. This prevents information leakage on
|
|
24
39
|
* publicly exposed instances.
|
|
25
40
|
*/
|
|
26
41
|
export class Health extends Resource {
|
|
42
|
+
// Anyone can call /Health — no auth, no role check. Truly public.
|
|
43
|
+
allowRead(_user) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
27
46
|
async get() {
|
|
28
47
|
return { ok: true };
|
|
29
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tpsdev-ai/flair",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality — all in a single process.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|