diff --git a/tests/integration/test_cassandra_config_end_to_end.py b/tests/integration/test_cassandra_config_end_to_end.py index 58ee31d2..8dc60de7 100644 --- a/tests/integration/test_cassandra_config_end_to_end.py +++ b/tests/integration/test_cassandra_config_end_to_end.py @@ -107,7 +107,7 @@ class TestEndToEndConfigurationFlow: # Verify KnowledgeTableStore was created with env config mock_table_store.assert_called_once_with( cassandra_host=['kg-host1', 'kg-host2', 'kg-host3', 'kg-host4'], - cassandra_user='kg-user', + cassandra_username='kg-user', cassandra_password='kg-pass', keyspace='knowledge' ) @@ -177,9 +177,9 @@ class TestConfigurationPriorityEndToEnd: # Verify mixed configuration mock_table_store.assert_called_once_with( - cassandra_host=['partial-host'], # From parameter - cassandra_user='fallback-user', # From environment - cassandra_password='fallback-pass', # From environment + cassandra_host=['partial-host'], # From parameter + cassandra_username='fallback-user', # From environment + cassandra_password='fallback-pass', # From environment keyspace='knowledge' ) @@ -269,7 +269,7 @@ class TestNoBackwardCompatibilityEndToEnd: # cassandra_user should be ignored, only cassandra_username works mock_table_store.assert_called_once_with( cassandra_host=['legacy-kg-host'], - cassandra_user=None, # Should be None since cassandra_user is not recognized + cassandra_username=None, # Should be None since cassandra_user is not recognized cassandra_password='legacy-kg-pass', keyspace='knowledge' ) diff --git a/trustgraph-flow/trustgraph/config/service/config.py b/trustgraph-flow/trustgraph/config/service/config.py index c9d315b0..701d7f58 100644 --- a/trustgraph-flow/trustgraph/config/service/config.py +++ b/trustgraph-flow/trustgraph/config/service/config.py @@ -45,13 +45,13 @@ class Configuration: # FIXME: Some version vs config race conditions - def __init__(self, push, host, user, password, keyspace): + def __init__(self, push, host, username, password, keyspace): # External function to respond to update self.push = push self.table_store = ConfigTableStore( - host, user, password, keyspace + host, username, password, keyspace ) async def inc_version(self): diff --git a/trustgraph-flow/trustgraph/config/service/service.py b/trustgraph-flow/trustgraph/config/service/service.py index 8c20e268..a23a33b9 100644 --- a/trustgraph-flow/trustgraph/config/service/service.py +++ b/trustgraph-flow/trustgraph/config/service/service.py @@ -61,7 +61,7 @@ class Processor(AsyncProcessor): ) cassandra_host = params.get("cassandra_host", default_cassandra_host) - cassandra_user = params.get("cassandra_user") + cassandra_username = params.get("cassandra_username") cassandra_password = params.get("cassandra_password") id = params.get("id") @@ -77,7 +77,7 @@ class Processor(AsyncProcessor): "flow_request_schema": FlowRequest.__name__, "flow_response_schema": FlowResponse.__name__, "cassandra_host": cassandra_host, - "cassandra_user": cassandra_user, + "cassandra_username": cassandra_username, } ) @@ -143,7 +143,7 @@ class Processor(AsyncProcessor): self.config = Configuration( host = cassandra_host.split(","), - user = cassandra_user, + username = cassandra_username, password = cassandra_password, keyspace = keyspace, push = self.push diff --git a/trustgraph-flow/trustgraph/cores/knowledge.py b/trustgraph-flow/trustgraph/cores/knowledge.py index 77477343..449f1c3b 100644 --- a/trustgraph-flow/trustgraph/cores/knowledge.py +++ b/trustgraph-flow/trustgraph/cores/knowledge.py @@ -16,12 +16,12 @@ logger = logging.getLogger(__name__) class KnowledgeManager: def __init__( - self, cassandra_host, cassandra_user, cassandra_password, + self, cassandra_host, cassandra_username, cassandra_password, keyspace, flow_config, ): self.table_store = KnowledgeTableStore( - cassandra_host, cassandra_user, cassandra_password, keyspace + cassandra_host, cassandra_username, cassandra_password, keyspace ) self.loader_queue = asyncio.Queue(maxsize=20) diff --git a/trustgraph-flow/trustgraph/cores/service.py b/trustgraph-flow/trustgraph/cores/service.py index ade3d12c..00b8a7d0 100755 --- a/trustgraph-flow/trustgraph/cores/service.py +++ b/trustgraph-flow/trustgraph/cores/service.py @@ -50,7 +50,7 @@ class Processor(AsyncProcessor): ) cassandra_host = params.get("cassandra_host", default_cassandra_host) - cassandra_user = params.get("cassandra_user") + cassandra_username = params.get("cassandra_username") cassandra_password = params.get("cassandra_password") super(Processor, self).__init__( @@ -90,7 +90,7 @@ class Processor(AsyncProcessor): self.knowledge = KnowledgeManager( cassandra_host = cassandra_host.split(","), - cassandra_user = cassandra_user, + cassandra_username = cassandra_username, cassandra_password = cassandra_password, keyspace = keyspace, flow_config = self, diff --git a/trustgraph-flow/trustgraph/librarian/librarian.py b/trustgraph-flow/trustgraph/librarian/librarian.py index 53d83296..56fcb040 100644 --- a/trustgraph-flow/trustgraph/librarian/librarian.py +++ b/trustgraph-flow/trustgraph/librarian/librarian.py @@ -16,7 +16,7 @@ class Librarian: def __init__( self, - cassandra_host, cassandra_user, cassandra_password, + cassandra_host, cassandra_username, cassandra_password, minio_host, minio_access_key, minio_secret_key, bucket_name, keyspace, load_document, ): @@ -26,7 +26,7 @@ class Librarian: ) self.table_store = LibraryTableStore( - cassandra_host, cassandra_user, cassandra_password, keyspace + cassandra_host, cassandra_username, cassandra_password, keyspace ) self.load_document = load_document diff --git a/trustgraph-flow/trustgraph/librarian/service.py b/trustgraph-flow/trustgraph/librarian/service.py index 47f1d459..5ab228f9 100755 --- a/trustgraph-flow/trustgraph/librarian/service.py +++ b/trustgraph-flow/trustgraph/librarian/service.py @@ -67,7 +67,7 @@ class Processor(AsyncProcessor): ) cassandra_host = params.get("cassandra_host", default_cassandra_host) - cassandra_user = params.get("cassandra_user") + cassandra_username = params.get("cassandra_username") cassandra_password = params.get("cassandra_password") super(Processor, self).__init__( @@ -77,7 +77,7 @@ class Processor(AsyncProcessor): "minio_host": minio_host, "minio_access_key": minio_access_key, "cassandra_host": cassandra_host, - "cassandra_user": cassandra_user, + "cassandra_username": cassandra_username, } ) @@ -109,7 +109,7 @@ class Processor(AsyncProcessor): self.librarian = Librarian( cassandra_host = cassandra_host.split(","), - cassandra_user = cassandra_user, + cassandra_username = cassandra_username, cassandra_password = cassandra_password, minio_host = minio_host, minio_access_key = minio_access_key, diff --git a/trustgraph-flow/trustgraph/storage/knowledge/store.py b/trustgraph-flow/trustgraph/storage/knowledge/store.py index ceb59ccf..b39fe09f 100644 --- a/trustgraph-flow/trustgraph/storage/knowledge/store.py +++ b/trustgraph-flow/trustgraph/storage/knowledge/store.py @@ -25,7 +25,7 @@ class Processor(FlowProcessor): # Use helper to resolve configuration hosts, username, password = resolve_cassandra_config( host=params.get("cassandra_host"), - username=params.get("cassandra_user", params.get("cassandra_username")), + username=params.get("cassandra_username"), password=params.get("cassandra_password") ) @@ -55,7 +55,7 @@ class Processor(FlowProcessor): self.table_store = KnowledgeTableStore( cassandra_host = hosts, - cassandra_user = username, + cassandra_username = username, cassandra_password = password, keyspace = keyspace, ) diff --git a/trustgraph-flow/trustgraph/tables/config.py b/trustgraph-flow/trustgraph/tables/config.py index 346ee569..a991de18 100644 --- a/trustgraph-flow/trustgraph/tables/config.py +++ b/trustgraph-flow/trustgraph/tables/config.py @@ -17,7 +17,7 @@ class ConfigTableStore: def __init__( self, - cassandra_host, cassandra_user, cassandra_password, keyspace, + cassandra_host, cassandra_username, cassandra_password, keyspace, ): self.keyspace = keyspace @@ -28,10 +28,10 @@ class ConfigTableStore: if isinstance(cassandra_host, str): cassandra_host = [h.strip() for h in cassandra_host.split(',')] - if cassandra_user and cassandra_password: + if cassandra_username and cassandra_password: ssl_context = SSLContext(PROTOCOL_TLSv1_2) auth_provider = PlainTextAuthProvider( - username=cassandra_user, password=cassandra_password + username=cassandra_username, password=cassandra_password ) self.cluster = Cluster( cassandra_host, diff --git a/trustgraph-flow/trustgraph/tables/knowledge.py b/trustgraph-flow/trustgraph/tables/knowledge.py index 92f577ae..1ee61088 100644 --- a/trustgraph-flow/trustgraph/tables/knowledge.py +++ b/trustgraph-flow/trustgraph/tables/knowledge.py @@ -17,7 +17,7 @@ class KnowledgeTableStore: def __init__( self, - cassandra_host, cassandra_user, cassandra_password, keyspace, + cassandra_host, cassandra_username, cassandra_password, keyspace, ): self.keyspace = keyspace @@ -28,10 +28,10 @@ class KnowledgeTableStore: if isinstance(cassandra_host, str): cassandra_host = [h.strip() for h in cassandra_host.split(',')] - if cassandra_user and cassandra_password: + if cassandra_username and cassandra_password: ssl_context = SSLContext(PROTOCOL_TLSv1_2) auth_provider = PlainTextAuthProvider( - username=cassandra_user, password=cassandra_password + username=cassandra_username, password=cassandra_password ) self.cluster = Cluster( cassandra_host, diff --git a/trustgraph-flow/trustgraph/tables/library.py b/trustgraph-flow/trustgraph/tables/library.py index 9f3695e1..cb152c30 100644 --- a/trustgraph-flow/trustgraph/tables/library.py +++ b/trustgraph-flow/trustgraph/tables/library.py @@ -21,7 +21,7 @@ class LibraryTableStore: def __init__( self, - cassandra_host, cassandra_user, cassandra_password, keyspace, + cassandra_host, cassandra_username, cassandra_password, keyspace, ): self.keyspace = keyspace @@ -32,10 +32,10 @@ class LibraryTableStore: if isinstance(cassandra_host, str): cassandra_host = [h.strip() for h in cassandra_host.split(',')] - if cassandra_user and cassandra_password: + if cassandra_username and cassandra_password: ssl_context = SSLContext(PROTOCOL_TLSv1_2) auth_provider = PlainTextAuthProvider( - username=cassandra_user, password=cassandra_password + username=cassandra_username, password=cassandra_password ) self.cluster = Cluster( cassandra_host,