Update OAuth2Session/requests.Session with config values for: ``cert``, ``cookies``, ``headers``, ``proxies``, ``timeout``, ``verify``.
(self, config: abc.Mapping[str, Any])
| 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.""" |