@pleri/olam-cli 0.1.84 → 0.1.86

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.
@@ -1,9 +1,9 @@
1
1
  {
2
- "auth": "sha256:ee6b1d1046933c76acc8d28cd83ac3871bc69057d2401014252872dc5ec42db7",
3
- "devbox": "sha256:0b7a8ed93e55bec3cd12351689a6213daa87a9fc7531b9dfcfb0513ba62add61",
4
- "host-cp": "sha256:ab8540c92b84b0fff082d9221b0792f0ccdfe7053143be261122b148501b0fc6",
2
+ "auth": "sha256:acd77f9b4b2764841207e6e749e0bd5044843458f789eb5548cb4363d02fb985",
3
+ "devbox": "sha256:6b60bdffc09db5b81410a74fe4262fbeb0b2f6770f5011d2b38dd34650ea2c55",
4
+ "host-cp": "sha256:51366e683e0032855425568fbfd35f816821d1dc48f92d0fb37c0d0eedfc1698",
5
5
  "mcp-auth": "sha256:e47169ad3fbc9cab216248fecbc56874343a5daab84b1f18d67529b7d415cf95",
6
6
  "$schema_version": 1,
7
- "$published_version": "0.1.84",
7
+ "$published_version": "0.1.86",
8
8
  "$registry": "ghcr.io/pleri"
9
9
  }
@@ -1029,9 +1029,23 @@ const server = http.createServer(async (req, res) => {
1029
1029
  if (url.pathname === '/api/auth/credentials' && req.method === 'GET') {
1030
1030
  try {
1031
1031
  const upstream = await authServiceFetch('GET', '/credentials/status');
1032
+ if (!upstream.ok) {
1033
+ // auth-service returned non-2xx. The most common cause is a missing or
1034
+ // wrong OLAM_AUTH_SECRET (auth-service returns 401 when X-Olam-Secret is
1035
+ // absent). Never forward auth-service's 401 to the SPA — the operator IS
1036
+ // authenticated to host-cp at this point; this is an internal service
1037
+ // misconfiguration, not an operator auth failure. 502 tells the SPA that
1038
+ // the data is unavailable due to a server-side error.
1039
+ return jsonReply(res, 502, {
1040
+ error: 'auth_service_error',
1041
+ upstream_status: upstream.status,
1042
+ credentials: [],
1043
+ hint: 'Check OLAM_AUTH_SECRET env var — host-cp may not be authorized to query the auth-service vault.',
1044
+ });
1045
+ }
1032
1046
  const raw = await upstream.json();
1033
1047
  const accounts = Array.isArray(raw.accounts) ? raw.accounts : [];
1034
- return jsonReply(res, upstream.status, { credentials: accounts.map(normalizeCredential) });
1048
+ return jsonReply(res, 200, { credentials: accounts.map(normalizeCredential) });
1035
1049
  } catch (err) {
1036
1050
  return jsonReply(res, 502, { error: 'auth_service_unavailable', message: err.message });
1037
1051
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pleri/olam-cli",
3
- "version": "0.1.84",
3
+ "version": "0.1.86",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "olam": "./bin/olam.cjs"