@@ -22,31 +22,30 @@ async def get_credentials(
2222
2323class InMemoryContextCredentialStore (CredentialService ):
2424 """
25- A simple in-memory store for context -keyed credentials.
25+ A simple in-memory store for session -keyed credentials.
2626
27- This class uses the 'contextId' from the ClientCallContext state to
28- store and retrieve credentials, providing a simple, user-specific
29- credential mechanism without requiring a full user authentication system.
27+ This class uses the 'sessionId' from the ClientCallContext state to
28+ store and retrieve credentials...
3029 """
3130
3231 def __init__ (self ):
33- # {context_id : {scheme_name: credential}}
32+ # {session_id : {scheme_name: credential}}
3433 self ._store : dict [str , dict [str , str ]] = {}
3534
3635 async def get_credentials (
3736 self ,
3837 security_scheme_name : str ,
3938 context : ClientCallContext | None ,
4039 ) -> str | None :
41- if not context or 'contextId ' not in context .state :
40+ if not context or 'sessionId ' not in context .state :
4241 return None
43- context_id = context .state ['contextId ' ]
44- return self ._store .get (context_id , {}).get (security_scheme_name )
42+ session_id = context .state ['sessionId ' ]
43+ return self ._store .get (session_id , {}).get (security_scheme_name )
4544
46- async def set_credentials (
47- self , context_id : str , security_scheme_name : str , credential : str
45+ async def set_credential (
46+ self , session_id : str , security_scheme_name : str , credential : str
4847 ):
4948 """Method to populate the store."""
50- if context_id not in self ._store :
51- self ._store [context_id ] = {}
52- self ._store [context_id ][security_scheme_name ] = credential
49+ if session_id not in self ._store :
50+ self ._store [session_id ] = {}
51+ self ._store [session_id ][security_scheme_name ] = credential
0 commit comments