MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / update_session

Method update_session

dwave/cloud/auth/flows.py:134–145  ·  view source on GitHub ↗

Update OAuth2Session/requests.Session with config values for: ``cert``, ``cookies``, ``headers``, ``proxies``, ``timeout``, ``verify``.

(self, config: abc.Mapping[str, Any])

Source from the content-addressed store, hash-verified

132 logger.debug(f"{type(self).__name__} initialized with: {pretty_argvalues()}")
133
134 def update_session(self, config: abc.Mapping[str, Any]) -> None:
135 """Update OAuth2Session/requests.Session with config values for:
136 ``cert``, ``cookies``, ``headers``, ``proxies``, ``timeout``, ``verify``.
137 """
138 logger.trace(f"{type(self).__name__}.update_session(config={config!r})")
139
140 self.session.headers.update(config.get('headers') or {})
141 self.session.default_timeout = config.get('timeout', None)
142
143 for key in ('cert', 'cookies', 'proxies', 'verify'):
144 if key in config:
145 setattr(self.session, key, config[key])
146
147 def _load_token_from_creds(self) -> Optional[dict]:
148 """Update session token with value from creds."""

Callers 2

__init__Method · 0.95
test_session_configMethod · 0.95

Calls 1

getMethod · 0.45

Tested by 1

test_session_configMethod · 0.76