Update pipfile

This commit is contained in:
zandercymatics 2023-10-16 13:33:11 -06:00
parent a9e4d34099
commit 7bb6bb9e7d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 36 additions and 41 deletions

View file

@ -25,6 +25,7 @@ django-phonenumber-field = {extras = ["phonenumberslite"], version = "*"}
boto3 = "*" boto3 = "*"
typing-extensions ='*' typing-extensions ='*'
django-login-required-middleware = "*" django-login-required-middleware = "*"
gevent = "*"
fred-epplib = {git = "https://github.com/cisagov/epplib.git", ref = "master"} fred-epplib = {git = "https://github.com/cisagov/epplib.git", ref = "master"}
geventconnpool = {git = "https://github.com/rasky/geventconnpool.git", ref = "1bbb93a714a331a069adf27265fe582d9ba7ecd4"} geventconnpool = {git = "https://github.com/rasky/geventconnpool.git", ref = "1bbb93a714a331a069adf27265fe582d9ba7ecd4"}

3
src/Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "a3a996c98e72cee37bc89a3b95fab6ae4b396d5663eb4fe66a80684154bc90e0" "sha256": "67b51a57b7d9d7d70d1eeca3515e169cd614d575a7213f31251f9dde43e1f748"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": {}, "requires": {},
@ -433,6 +433,7 @@
"sha256:fae8d5b5b8fa2a8f63b39f5447168b02db10c888a3e387ed7af2bd1b8612e543", "sha256:fae8d5b5b8fa2a8f63b39f5447168b02db10c888a3e387ed7af2bd1b8612e543",
"sha256:fde6402c5432b835fbb7698f1c7f2809c8d6b2bd9d047ac1f5a7c1d5aa569303" "sha256:fde6402c5432b835fbb7698f1c7f2809c8d6b2bd9d047ac1f5a7c1d5aa569303"
], ],
"index": "pypi",
"markers": "python_version >= '3.8'", "markers": "python_version >= '3.8'",
"version": "==23.9.1" "version": "==23.9.1"
}, },

View file

@ -36,6 +36,7 @@ except Exception:
exc_info=True, exc_info=True,
) )
class EPPLibWrapper: class EPPLibWrapper:
""" """
A wrapper over epplib's client. A wrapper over epplib's client.
@ -69,9 +70,7 @@ class EPPLibWrapper:
# Pool size # Pool size
"size": settings.EPP_CONNECTION_POOL_SIZE, "size": settings.EPP_CONNECTION_POOL_SIZE,
# Which errors the pool should look out for # Which errors the pool should look out for
"exc_classes": ( "exc_classes": (TransportError,),
TransportError,
),
# Occasionally pings the registry to keep the connection alive. # Occasionally pings the registry to keep the connection alive.
# Value in seconds => (keepalive / size) # Value in seconds => (keepalive / size)
"keepalive": settings.POOL_KEEP_ALIVE, "keepalive": settings.POOL_KEEP_ALIVE,
@ -160,7 +159,7 @@ class EPPLibWrapper:
else: # don't try again else: # don't try again
raise err raise err
def start_connection_pool(self, restart_pool_if_exists = True): def start_connection_pool(self, restart_pool_if_exists=True):
"""Starts a connection pool for the registry. """Starts a connection pool for the registry.
restart_pool_if_exists -> bool: restart_pool_if_exists -> bool:
@ -203,9 +202,7 @@ class EPPLibWrapper:
self._pool = None self._pool = None
self.pool_status.pool_running = False self.pool_status.pool_running = False
return return
logger.info( logger.info("kill_pool() was invoked but there was no pool to delete")
"kill_pool() was invoked but there was no pool to delete"
)
def _test_registry_connection_success(self): def _test_registry_connection_success(self):
"""Check that determines if our login """Check that determines if our login

View file

@ -22,6 +22,7 @@ logger = logging.getLogger(__name__)
@patch("djangooidc.views.CLIENT", autospec=True) @patch("djangooidc.views.CLIENT", autospec=True)
class TestConnectionPool(MockEppLib): class TestConnectionPool(MockEppLib):
"""Tests for our connection pooling behaviour""" """Tests for our connection pooling behaviour"""
def setUp(self): def setUp(self):
""" """
Background: Background:
@ -33,9 +34,7 @@ class TestConnectionPool(MockEppLib):
# Current pool size # Current pool size
"size": 1, "size": 1,
# Which errors the pool should look out for # Which errors the pool should look out for
"exc_classes": ( "exc_classes": (TransportError,),
TransportError,
),
# Occasionally pings the registry to keep the connection alive. # Occasionally pings the registry to keep the connection alive.
# Value in seconds => (keepalive / size) # Value in seconds => (keepalive / size)
"keepalive": 60, "keepalive": 60,
@ -69,16 +68,16 @@ class TestConnectionPool(MockEppLib):
# in client.py. They should remain unchanged, # in client.py. They should remain unchanged,
# and if they aren't, something went wrong. # and if they aren't, something went wrong.
expected_login = commands.Login( expected_login = commands.Login(
cl_id='nothing', cl_id="nothing",
password='nothing', password="nothing",
obj_uris=[ obj_uris=[
'urn:ietf:params:xml:ns:domain-1.0', "urn:ietf:params:xml:ns:domain-1.0",
'urn:ietf:params:xml:ns:contact-1.0' "urn:ietf:params:xml:ns:contact-1.0",
], ],
new_pw=None, new_pw=None,
version='1.0', version="1.0",
lang='en', lang="en",
ext_uris=[] ext_uris=[],
) )
# Key/cert will generate a new file everytime. # Key/cert will generate a new file everytime.
@ -129,4 +128,3 @@ class TestConnectionPool(MockEppLib):
def test_pool_sends_data(self): def test_pool_sends_data(self):
"""A .send is invoked on the pool""" """A .send is invoked on the pool"""
raise raise

View file

@ -22,6 +22,7 @@ class EPPConnectionPool(ConnectionPool):
options (dict): Options for the ConnectionPool options (dict): Options for the ConnectionPool
base class base class
""" """
def __init__(self, client, login, options: dict): def __init__(self, client, login, options: dict):
# For storing shared credentials # For storing shared credentials
self._client = client self._client = client
@ -66,9 +67,7 @@ class EPPConnectionPool(ConnectionPool):
self.lock.release() self.lock.release()
# TODO - connection pool err # TODO - connection pool err
except Exception as err: except Exception as err:
logger.error( logger.error("Could not kill all connections.")
"Could not kill all connections."
)
raise err raise err
def repopulate_all_connections(self): def repopulate_all_connections(self):
@ -80,6 +79,4 @@ class EPPConnectionPool(ConnectionPool):
for i in range(self.size): for i in range(self.size):
self.lock.acquire() self.lock.acquire()
for i in range(self.size): for i in range(self.size):
gevent.spawn_later(self.SPAWN_FREQUENCY*i, self._addOne) gevent.spawn_later(self.SPAWN_FREQUENCY * i, self._addOne)

View file

@ -1,5 +1,6 @@
class PoolStatus: class PoolStatus:
"""A list of Booleans to keep track of Pool Status""" """A list of Booleans to keep track of Pool Status"""
def __init__(self): def __init__(self):
self.pool_running = False self.pool_running = False
self.connection_success = False self.connection_success = False