From c4e03d4641aa1c7b038d85a973aa97904eca9eec Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Thu, 15 Jun 2023 16:22:26 +0200 Subject: [PATCH] Fix: New tenant storage information endpoint Parametrize tenant enpoint and publick decryption key as environment variable and set the default value to new endpoint. --- pyinfra/config.py | 4 ++-- pyinfra/payload_processing/processor.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyinfra/config.py b/pyinfra/config.py index 0afb57c..fe2d72e 100644 --- a/pyinfra/config.py +++ b/pyinfra/config.py @@ -93,8 +93,8 @@ class Config: self.allowed_compression_types = ["gz"] # config for x-tenant-endpoint to receive storage connection information per tenant - self.persistence_service_public_key = "redaction" - self.persistence_service_tenant_endpoint = "http://persistence-service-v1:8080/internal-api/tenants" + self.tenant_decryption_public_key = read_from_environment("TENANT_PUBLIC_KEY", "redaction") + self.tenant_endpoint = read_from_environment("TENANT_ENDPOINT", "http://tenant-user-management:8081/internal-api/tenants") # Value to see if we should write a consumer token to a file self.write_consumer_token = read_from_environment("WRITE_CONSUMER_TOKEN", "False") diff --git a/pyinfra/payload_processing/processor.py b/pyinfra/payload_processing/processor.py index 37f31a1..e4359f9 100644 --- a/pyinfra/payload_processing/processor.py +++ b/pyinfra/payload_processing/processor.py @@ -113,8 +113,8 @@ def make_payload_processor(data_processor: Callable, config: Config = None) -> P default_storage_info: StorageInfo = get_storage_info_from_config(config) get_storage_info_from_tenant_id = partial( get_storage_info_from_endpoint, - config.persistence_service_public_key, - config.persistence_service_tenant_endpoint, + config.tenant_decryption_public_key, + config.tenant_endpoint, ) monitor = get_monitor_from_config(config) payload_parser: QueueMessagePayloadParser = get_queue_message_payload_parser(config) diff --git a/pyproject.toml b/pyproject.toml index 4409313..f4f3a7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyinfra" -version = "1.5.7" +version = "1.5.8" description = "" authors = ["Francisco Schulz "] license = "All rights reseverd"