Skip to content

Commit

Permalink
fix: added the entity parameter to the ilink connection header
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago-da-silva23 committed Dec 14, 2023
1 parent 40832cd commit dd4500d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/billing/services/receipt_host_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def __init__(self) -> None:
self.__receipt_host_url = getattr(settings, "RECEIPT_HOST_URL")
self.__receipt_host_auth = getattr(settings, "RECEIPT_HOST_AUTH")
self.__receipt_host_password = getattr(settings, "RECEIPT_HOST_PASSWORD")
self.__receipt_entity_public_key = getattr(settings, "RECEIPT_ENTITY_PUBLIC_KEY")

def get_document(self, document_id: str):
"""
Expand All @@ -21,6 +22,7 @@ def get_document(self, document_id: str):
try:
response = requests.get(
url=f"{self.__receipt_host_url}/{document_id}",
headers={"entity": self.__receipt_entity_public_key},
auth=(
self.__receipt_host_auth,
self.__receipt_host_password,
Expand Down
1 change: 1 addition & 0 deletions apps/billing/tests/test_invoice_host_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self) -> None:
self.__receipt_host_url = "https://receipt-fake.com/"
self.__receipt_host_auth = "test_auth"
self.__receipt_host_password = "pwd_test"
self.__receipt_entity_public_key = "receipt_entity_public_key"


class MockResponse(Response):
Expand Down
1 change: 1 addition & 0 deletions nau_financial_manager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def get_env_setting(env_variable, default=None):
RECEIPT_HOST_URL = CONFIG.get("RECEIPT_HOST_URL", "")
RECEIPT_HOST_AUTH = CONFIG.get("RECEIPT_HOST_AUTH", "")
RECEIPT_HOST_PASSWORD = CONFIG.get("RECEIPT_HOST_PASSWORD", "")
RECEIPT_ENTITY_PUBLIC_KEY = CONFIG.get("RECEIPT_ENTITY_PUBLIC_KEY", "")

SWAGGER_PROJECT_NAME = CONFIG.get("SWAGGER_PROJECT_NAME", "Nau Financial Manager")
SWAGGER_PROJECT_VERSION = CONFIG.get("SWAGGER_PROJECT_VERSION", "1.0.0")
Expand Down

0 comments on commit dd4500d

Please sign in to comment.