Skip to content

Commit fa4fc31

Browse files
committed
fix CI
Signed-off-by: Yuchen Zhang <[email protected]>
1 parent 8186325 commit fa4fc31

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

docs/source/workflows/mcp/mcp-auth-token-storage.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ persistent and also unsafe.
6060
6161
For production environments, configure an external object store to persist tokens across restarts. The NeMo Agent toolkit supports S3-compatible storage (MinIO, AWS S3), MySQL, and Redis backends.
6262
63-
> **Note**: For detailed object store setup instructions including MinIO, MySQL, and Redis installation and configuration examples, see the [Object Store User Report Example](../../../../examples/object_store/user_report/README.md#choose-an-object-store).
63+
:::{note}
64+
For detailed object store setup instructions including MinIO, MySQL, and Redis installation and configuration examples, see the `examples/object_store/user_report/README.md` guide (under the "Choose an Object Store" section).
65+
:::
6466

6567
The following example shows token storage configuration using S3-compatible storage (MinIO):
6668

tests/nat/authentication/test_oauth_exchanger.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,13 @@ async def fail_cb(*_a, **_kw):
173173

174174
client = OAuth2AuthCodeFlowProvider(cfg)
175175
past = datetime.now(UTC) - timedelta(seconds=1)
176-
client._authenticated_tokens["bob"] = AuthResult(
177-
credentials=[BearerTokenCred(token="stale")], # type: ignore[arg-type]
178-
token_expires_at=past,
179-
raw={"refresh_token": "refTok"},
180-
)
176+
await client._token_storage.store(
177+
"bob",
178+
AuthResult(
179+
credentials=[BearerTokenCred(token="stale")], # type: ignore[arg-type]
180+
token_expires_at=past,
181+
raw={"refresh_token": "refTok"},
182+
))
181183

182184
res = await client.authenticate("bob")
183185
assert res.credentials[0].token.get_secret_value() == "newTok"
@@ -222,11 +224,13 @@ async def cb(conf, flow):
222224

223225
client = OAuth2AuthCodeFlowProvider(cfg)
224226
past = datetime.now(UTC) - timedelta(minutes=1)
225-
client._authenticated_tokens["eve"] = AuthResult(
226-
credentials=[BearerTokenCred(token="old")], # type: ignore[arg-type]
227-
token_expires_at=past,
228-
raw={"refresh_token": "badTok"},
229-
)
227+
await client._token_storage.store(
228+
"eve",
229+
AuthResult(
230+
credentials=[BearerTokenCred(token="old")], # type: ignore[arg-type]
231+
token_expires_at=past,
232+
raw={"refresh_token": "badTok"},
233+
))
230234

231235
res = await client.authenticate("eve")
232236
assert hits["n"] == 1

0 commit comments

Comments
 (0)