Browse Source

fix: turn get_name into a method, use setters in connection manager

pull/355/head
Richard Nemeth 2 years ago
parent
commit
49ddcdc3a6
  1. 1
      src/keycloak/authorization/role.py
  2. 10
      src/keycloak/connection.py

1
src/keycloak/authorization/role.py

@ -38,7 +38,6 @@ class Role:
self.name = name
self.required = required
@property
def get_name(self):
"""Get name."""
return self.name

10
src/keycloak/connection.py

@ -25,7 +25,7 @@
try:
from urllib.parse import urljoin
except ImportError:
except ImportError: # pragma: no cover
from urlparse import urljoin
import requests
@ -46,10 +46,10 @@ class ConnectionManager(object):
def __init__(self, base_url, headers={}, timeout=60, verify=True, proxies=None):
"""Init method."""
self._base_url = base_url
self._headers = headers
self._timeout = timeout
self._verify = verify
self.base_url = base_url
self.headers = headers
self.timeout = timeout
self.verify = verify
self._s = requests.Session()
self._s.auth = lambda x: x # don't let requests add auth headers

Loading…
Cancel
Save