@eclaw/openclaw-channel 1.1.5 → 1.1.7

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.
@@ -21,13 +21,17 @@ export function unregisterWebhookToken(callbackToken) {
21
21
  */
22
22
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
23
  export async function dispatchWebhook(req, res) {
24
+ // Support two auth modes:
25
+ // 1. Standard: Authorization: Bearer <token>
26
+ // 2. Basic Auth gateway (Railway WEB_PASSWORD): X-Callback-Token header
24
27
  const authHeader = req.headers?.authorization;
25
- if (!authHeader?.startsWith('Bearer ')) {
28
+ const customToken = req.headers?.['x-callback-token'];
29
+ const token = authHeader?.startsWith('Bearer ') ? authHeader.slice(7) : customToken;
30
+ if (!token) {
26
31
  res.writeHead(401, { 'Content-Type': 'application/json' });
27
- res.end(JSON.stringify({ error: 'Unauthorized' }));
32
+ res.end(JSON.stringify({ error: 'Auth required' }));
28
33
  return;
29
34
  }
30
- const token = authHeader.slice(7);
31
35
  const entry = registry.get(token);
32
36
  if (!entry) {
33
37
  // Unknown token — likely a stale push after a server restart
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclaw/openclaw-channel",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "E-Claw channel plugin for OpenClaw — AI chat platform for live wallpaper entities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",