kshitijk4poor
288fdc1a4c
fix(auth): accept a non-production Portal's own inference host when the operator selected it
...
A token minted by a non-production Portal is meant to be spent at that environment's own
inference gateway, and the Portal's refresh response names that host. The allowlist applied
to Portal-returned inference URLs was production-only, so the value was refused as "not in
allowlist" and healed to the production host — a token the production Portal never issued,
sent to the production gateway, which 401s it. Every hosted non-production instance hit
this on every gateway turn once #108319 made the deploy-wide NOUS_INFERENCE_BASE_URL
invisible inside a routed profile scope (by design, #65941 ).
The widening is keyed on the operator's trusted HERMES_PORTAL_BASE_URL override, never on
the stored portal_base_url: when that override names a Portal outside the production
allowlist, any https host under the Nous domain is accepted; otherwise the strict production
set stands. So a poisoned auth.json cannot widen the set, a production-Portal session that
finds a foreign inference URL in its state is still refused and healed, and the bearer can
only ever go to a Nous-owned host. No environment is named in code. Because the override is
read through the profile scope (previous commit), each multiplexed profile decides for
itself.
Validation: 4 invariant tests (accepted only under a non-production override; look-alike
domains, dotless suffix and http still refused; stored portal alone does not widen; the
decision follows the profile scope under multiplex) — the new-behaviour ones red on the
previous commit. Main's existing validation tests are unchanged and green. Live receipt for
the symptom and the fixed chain on a hosted instance: #111589 .
Based on #102863 and its rebase onto the decomposed auth_nous.py in #111589 , whose
portal-keyed pairing this replaces with the same behaviour and no environment literals.
Co-authored-by: Ben Barclay <ben@nousresearch.com >
2026-09-15 16:31:53 +05:30
..
2026-09-13 09:40:44 -07:00
2026-09-14 21:49:13 -04:00
2026-09-13 05:09:43 -07:00
2026-09-15 03:58:44 -07:00
2026-09-15 03:46:29 -07:00
2026-09-14 09:02:28 -07:00
2026-09-15 03:53:13 -07:00
2026-09-07 06:13:16 -07:00
2026-09-11 19:01:47 -07:00
2026-09-13 05:07:11 -07:00
2026-09-15 03:58:44 -07:00
2026-09-15 03:58:44 -07:00
2026-09-13 14:48:09 -07:00
2026-09-13 05:09:43 -07:00
2026-09-11 03:45:33 +05:30
2026-09-11 03:45:33 +05:30
2026-09-14 20:38:07 +05:30
2026-09-12 22:07:41 -07:00
2026-09-12 22:07:41 -07:00
2026-09-12 22:07:41 -07:00
2026-09-15 16:31:53 +05:30
2026-09-09 21:17:35 +05:30
2026-09-12 22:07:41 -07:00
2026-09-15 03:38:29 -07:00
2026-09-12 22:07:41 -07:00
2026-09-14 20:38:07 +05:30
2026-09-13 05:07:11 -07:00
2026-09-13 20:57:03 -07:00
2026-09-08 05:10:57 -07:00
2026-09-08 03:06:30 -07:00
2026-09-12 08:25:54 -07:00
2026-09-15 03:53:13 -07:00
2026-09-12 08:25:54 -07:00
2026-09-13 14:35:32 -07:00
2026-09-15 14:52:26 +05:30
2026-09-15 03:37:49 -07:00
2026-09-13 20:41:41 -07:00
2026-09-15 14:52:26 +05:30
2026-09-13 20:54:50 -07:00
2026-09-13 14:35:32 -07:00
2026-09-13 05:21:02 -07:00
2026-09-12 22:00:02 -07:00
2026-09-13 14:35:32 -07:00
2026-09-08 13:39:17 -07:00
2026-09-08 13:39:17 -07:00
2026-09-13 16:43:50 -07:00
2026-09-13 20:50:10 -07:00
2026-09-13 05:07:11 -07:00
2026-09-11 11:54:49 -07:00
2026-09-12 08:25:36 -07:00
2026-09-13 20:41:41 -07:00
2026-09-12 16:17:04 -07:00
2026-09-15 03:34:20 -07:00
2026-09-13 05:09:06 -07:00
2026-09-07 04:46:37 -07:00
2026-09-15 00:41:13 +05:30
2026-09-10 01:08:18 -07:00
2026-09-15 03:39:45 -07:00
2026-09-14 08:10:36 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 05:09:06 -07:00
2026-09-14 09:19:32 -07:00
2026-09-12 05:56:15 -07:00
2026-09-13 05:21:02 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 09:18:02 -07:00
2026-09-10 01:25:45 -07:00
2026-09-15 03:44:36 -07:00
2026-09-13 05:09:06 -07:00
2026-09-15 12:51:27 +05:30
2026-09-12 08:24:11 -07:00
2026-09-15 11:03:39 +05:30
2026-09-06 05:41:46 -07:00
2026-09-13 20:51:06 -07:00
2026-09-12 21:39:10 -07:00
2026-09-14 08:10:36 -07:00
2026-09-11 03:45:33 +05:30
2026-09-14 16:16:06 -07:00
2026-09-14 16:16:06 -07:00
2026-09-15 03:44:36 -07:00
2026-09-14 20:51:37 +05:30
2026-09-15 03:44:36 -07:00
2026-09-10 01:00:19 -07:00
2026-09-12 15:00:37 +05:30
2026-09-07 00:51:41 -07:00
2026-09-15 03:59:50 -07:00
2026-09-06 07:20:24 -07:00
2026-09-13 05:07:11 -07:00
2026-09-11 03:45:32 +05:30
2026-09-15 03:47:15 -07:00
2026-09-15 03:47:15 -07:00
2026-09-07 14:16:57 -07:00
2026-09-14 16:14:33 -07:00
2026-09-15 03:51:28 -07:00
2026-09-13 05:09:06 -07:00
2026-09-07 06:04:06 -07:00
2026-09-07 04:46:54 -07:00
2026-09-14 16:14:33 -07:00
2026-09-07 04:46:54 -07:00
2026-09-07 04:46:54 -07:00
2026-09-13 05:09:43 -07:00
2026-09-09 12:18:58 -07:00
2026-09-15 03:45:41 -07:00
2026-09-07 04:55:17 -07:00
2026-09-14 05:28:46 -07:00
2026-09-07 05:56:50 -07:00
2026-09-09 10:28:52 -07:00
2026-09-12 08:47:21 -07:00
2026-09-12 08:25:54 -07:00
2026-09-13 16:43:50 -07:00
2026-09-14 08:10:36 -07:00
2026-09-15 03:53:13 -07:00
2026-09-13 05:07:50 -07:00
2026-09-12 08:34:43 -07:00
2026-09-12 20:49:18 -07:00
2026-09-11 19:50:46 -07:00
2026-09-15 03:38:29 -07:00
2026-09-07 06:15:43 -07:00
2026-09-13 05:07:11 -07:00
2026-09-10 04:22:38 -07:00
2026-09-13 20:54:50 -07:00
2026-09-15 03:39:45 -07:00
2026-09-13 16:43:50 -07:00
2026-09-15 03:46:29 -07:00
2026-09-15 03:39:45 -07:00
2026-09-13 21:06:39 -07:00
2026-09-10 09:11:00 -07:00
2026-09-07 08:08:04 -07:00
2026-09-12 01:35:05 -07:00
2026-09-12 01:35:05 -07:00
2026-09-12 14:05:36 -07:00
2026-09-15 03:46:29 -07:00
2026-09-14 22:01:32 +00:00
2026-09-11 03:45:31 +05:30
2026-09-10 18:11:25 -07:00
2026-09-14 08:10:36 -07:00
2026-09-12 08:24:26 -07:00
2026-09-14 21:00:29 -07:00
2026-09-13 05:07:11 -07:00
2026-09-09 04:38:01 -07:00
2026-09-12 07:57:13 -07:00
2026-09-14 21:00:29 -07:00
2026-09-10 05:09:15 -07:00
2026-09-15 10:48:49 +05:30
2026-09-15 10:48:49 +05:30
2026-09-09 04:38:01 -07:00
2026-09-09 04:38:01 -07:00
2026-09-15 11:03:39 +05:30
2026-09-11 03:45:31 +05:30
2026-09-12 08:27:53 -07:00
2026-09-13 14:33:11 -07:00
2026-09-13 14:33:11 -07:00
2026-09-06 05:34:01 -07:00
2026-09-10 01:00:19 -07:00
2026-09-15 12:45:29 +05:30
2026-09-13 05:08:29 -07:00
2026-09-10 14:56:55 -04:00
2026-09-13 05:07:50 -07:00
2026-09-13 05:07:11 -07:00
2026-09-07 02:09:34 -07:00
2026-09-15 03:36:22 -07:00
2026-09-14 21:18:47 +05:30
2026-09-14 19:49:12 +05:30
2026-09-15 03:44:36 -07:00
2026-09-13 05:07:50 -07:00
2026-09-13 05:07:50 -07:00
2026-09-13 05:07:50 -07:00
2026-09-15 03:46:29 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:54 -07:00
2026-09-13 05:21:02 -07:00
2026-09-11 06:37:27 -07:00
2026-09-09 13:30:28 -07:00
2026-09-11 06:24:54 -07:00
2026-09-15 12:51:27 +05:30
2026-09-13 05:32:38 -07:00
2026-09-12 08:25:54 -07:00
2026-09-12 08:25:54 -07:00
2026-09-12 08:25:54 -07:00
2026-09-07 22:25:12 -07:00
2026-09-15 14:15:59 +05:30
2026-09-12 08:25:54 -07:00
2026-09-13 05:08:29 -07:00
2026-09-11 03:45:31 +05:30
2026-09-12 21:47:53 -07:00
2026-09-13 05:21:02 -07:00
2026-09-14 08:10:36 -07:00
2026-09-15 03:53:13 -07:00
2026-09-14 08:10:36 -07:00
2026-09-15 14:52:26 +05:30
2026-09-11 06:24:54 -07:00
2026-09-08 19:52:26 +05:30
2026-09-12 08:34:43 -07:00
2026-09-13 05:07:50 -07:00
2026-09-12 08:25:54 -07:00
2026-09-13 05:08:20 -07:00
2026-09-13 05:08:20 -07:00
2026-09-15 03:44:36 -07:00
2026-09-14 20:51:37 +05:30
2026-09-13 14:44:38 -07:00
2026-09-13 15:41:01 -07:00
2026-09-06 14:53:33 +05:30
2026-09-10 11:48:01 -07:00
2026-09-13 19:19:32 -07:00
2026-09-09 21:16:40 +05:30
2026-09-15 03:40:26 -07:00
2026-09-13 05:07:50 -07:00
2026-09-09 04:38:01 -07:00
2026-09-07 07:11:36 -07:00
2026-09-12 06:13:44 -07:00
2026-09-11 15:28:37 -07:00
2026-09-14 08:10:36 -07:00
2026-09-12 18:35:21 -07:00
2026-09-11 03:45:33 +05:30
2026-09-15 03:46:29 -07:00
2026-09-11 06:37:27 -07:00
2026-09-11 19:50:46 -07:00
2026-09-13 21:30:02 -07:00
2026-09-13 20:55:29 -07:00
2026-09-13 20:55:29 -07:00
2026-09-13 05:07:11 -07:00
2026-09-09 02:36:00 -07:00