Skip to content

Commit

Permalink
refactor: update API settings and remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
remyvdwereld committed Jan 29, 2025
1 parent 47165ec commit 52a88b7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ DEFAULT_THEME=Vakantieverhuur
DEFAULT_REASON=SIG melding
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_URL=https://api.acceptatie.toeristischeverhuur.nl/api/
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_ACCESS_TOKEN=SECRET_ACCESS_TOKEN
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BAG_ID=0503100000000209
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BSN=999999990
ZAKEN_CONTAINER_HOST=http://zaak-gateway:8000

Expand Down
4 changes: 2 additions & 2 deletions app/apps/health/health_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def check_status(self):
), "The registration data is empty and could not be retrieved using the BSN number"

bag_registrations = get_vakantieverhuur_registrations_by_bag_id(
settings.VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BAG_ID
settings.BAG_ID_AMSTEL_1
)
assert (
len(bag_registrations) > 0
Expand Down Expand Up @@ -303,7 +303,7 @@ def check_status(self):

try:
get_vakantieverhuur_meldingen(
settings.VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BAG_ID,
settings.BAG_ID_AMSTEL_1,
query_params=params,
use_retry=False,
)
Expand Down
9 changes: 0 additions & 9 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,6 @@ def filter_traces(envelope):
"BAG_API_BENKAGG_SEARCH_URL",
"https://api.data.amsterdam.nl/v1/benkagg/adresseerbareobjecten/",
)
# API key for the public Amsterdam API (api.data.amsterdam.nl).
# This key is NOT used for authorization, but to identify who is using the API for communication purposes.
BAG_API_PUBLIC_KEY = os.getenv(
"BAG_API_PUBLIC_KEY",
"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJzdWIiOjMxNjQ2NDI4NzA1MzQ4NzI1NTEsImV4cCI6MTczODA3MDQ4N30.sGNs0EIRcdyUv76X1J1q46Y4kAIHSqHR1fca-srQlIQnV0aWduQn5xTlGQM1lvZCDk_F5qWf0__8u1jcYDMlDg",
)
# Bag_id of Amstel 1 for testing purposes.
BAG_ID_AMSTEL_1 = os.getenv(
"BAG_ID_AMSTEL_1",
Expand Down Expand Up @@ -554,9 +548,6 @@ def get_redis_url():
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_ACCESS_TOKEN = os.getenv(
"VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_ACCESS_TOKEN"
)
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BAG_ID = os.getenv(
"VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BAG_ID", "0503100000000209"
)
VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BSN = os.getenv(
"VAKANTIEVERHUUR_TOERISTISCHE_VERHUUR_API_BSN"
)
Expand Down
3 changes: 0 additions & 3 deletions app/utils/api_queries_bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

logger = logging.getLogger(__name__)

headers = {"x-api-key": settings.BAG_API_PUBLIC_KEY}


@retry(stop=stop_after_attempt(3), after=after_log(logger, logging.ERROR))
def do_bag_search_benkagg_by_id(identificatie):
Expand All @@ -21,7 +19,6 @@ def do_bag_search_benkagg_by_id(identificatie):
address_search = requests.get(
settings.BAG_API_BENKAGG_SEARCH_URL,
params={"identificatie": identificatie},
headers=headers,
timeout=30,
)
return address_search.json()
Expand Down

0 comments on commit 52a88b7

Please sign in to comment.