@goodandready/dsh-subscriptions 0.6.21 → 0.6.22

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.
@@ -29,6 +29,10 @@ export function registerAccountsRoutes(ctx, state) {
29
29
  writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
30
30
  return
31
31
  }
32
+ if (!isTrustedSettingsRequest(req)) {
33
+ writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'same-origin only' } })
34
+ return
35
+ }
32
36
  const q = queryOf(req)
33
37
  const provider = q.get('provider') || ''
34
38
  const index = Number(q.get('index') || '1')
@@ -81,6 +81,10 @@ export function registerStatusRoutes(ctx, state) {
81
81
  writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
82
82
  return
83
83
  }
84
+ if (!isTrustedSettingsRequest(req)) {
85
+ writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'same-origin only' } })
86
+ return
87
+ }
84
88
  const logged = await store.loggedInProviders()
85
89
  // #66/#67: usagePercent (max across accounts) and expiresAt for the chip.
86
90
  const usage = {}
@@ -250,6 +254,10 @@ export function registerStatusRoutes(ctx, state) {
250
254
  writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
251
255
  return
252
256
  }
257
+ if (!isTrustedSettingsRequest(req)) {
258
+ writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'same-origin only' } })
259
+ return
260
+ }
253
261
  const host = (req.headers.host || '').split(':')[0]
254
262
  if (host !== 'localhost' && host !== '127.0.0.1') {
255
263
  writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'localhost only' } })
@@ -269,6 +277,10 @@ export function registerStatusRoutes(ctx, state) {
269
277
  writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
270
278
  return
271
279
  }
280
+ if (!isTrustedSettingsRequest(req)) {
281
+ writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'same-origin only' } })
282
+ return
283
+ }
272
284
  const summary = typeof history.telemetrySummary === 'function'
273
285
  ? history.telemetrySummary()
274
286
  : { totalRequests: history.size(), requests24h: 0, successRequests: 0, errorRequests: 0, successRate: 100, avgLatencyMs: 0 }
@@ -397,6 +409,10 @@ export function registerStatusRoutes(ctx, state) {
397
409
  writeJson(res, 405, { ok: false, error: { code: 'method', message: 'GET only' } })
398
410
  return
399
411
  }
412
+ if (!isTrustedSettingsRequest(req)) {
413
+ writeJson(res, 403, { ok: false, error: { code: 'forbidden', message: 'same-origin only' } })
414
+ return
415
+ }
400
416
  const limit = Math.min(Number(queryOf(req).get('limit') || '50'), 100)
401
417
  writeJson(res, 200, { ok: true, alerts: getRecentAlerts(limit) })
402
418
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, Antigravity, Kimi, GLM, Cursor, Kiro, Copilot, Qwen, ERNIE, Spark, JetBrains, Perplexity, Replit, and Cody subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",