mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-18 19:44:19 +02:00
Add warnings regarding memory store
This commit is contained in:
parent
aecf7f07c2
commit
d1f7c74cde
2 changed files with 16 additions and 0 deletions
|
|
@ -191,6 +191,14 @@ class OAuth(OAuthClientProvider):
|
|||
# Create server-specific token storage
|
||||
token_storage = token_storage or MemoryStore()
|
||||
|
||||
if isinstance(token_storage, MemoryStore):
|
||||
from warnings import warn
|
||||
|
||||
warn(
|
||||
message="Using in-memory token storage is not recommended for production use -- "
|
||||
+ "tokens will be lost on server restart."
|
||||
)
|
||||
|
||||
self.token_storage_adapter: TokenStorageAdapter = TokenStorageAdapter(
|
||||
async_key_value=token_storage, server_url=server_base_url
|
||||
)
|
||||
|
|
|
|||
|
|
@ -388,6 +388,14 @@ class OAuthProxy(OAuthProvider):
|
|||
|
||||
self._client_storage: AsyncKeyValue = client_storage or MemoryStore()
|
||||
|
||||
if isinstance(self._client_storage, MemoryStore):
|
||||
from warnings import warn
|
||||
|
||||
warn(
|
||||
message="Using in-memory client storage is not recommended for production use -- "
|
||||
+ "clients will be lost on server restart which may require manual clean-up of oauth information on the client."
|
||||
)
|
||||
|
||||
self._client_store = PydanticAdapter[ProxyDCRClient](
|
||||
key_value=self._client_storage,
|
||||
pydantic_model=ProxyDCRClient,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue