Skip to content

Add default empty string for KEYCLOAK_HOST to prevent None being passed to get_tenant_info#1056

Closed
prjanitor wants to merge 1 commit intoepam:mainfrom
prjanitor:prjanitor/c4509a21d9a2d7f3a08178bf832acc23ef156696
Closed

Add default empty string for KEYCLOAK_HOST to prevent None being passed to get_tenant_info#1056
prjanitor wants to merge 1 commit intoepam:mainfrom
prjanitor:prjanitor/c4509a21d9a2d7f3a08178bf832acc23ef156696

Conversation

@prjanitor
Copy link
Copy Markdown

Bug Fix: Missing null check for KEYCLOAK_HOST

Problem

In taxonomy/taxonomy/token_dependency.py, the KEYCLOAK_HOST environment variable is retrieved without a default value:

KEYCLOAK_HOST = os.getenv("KEYCLOAK_HOST")

When KEYCLOAK_HOST is not set, os.getenv() returns None, which is then passed to get_tenant_info(url=KEYCLOAK_HOST, algorithm="RS256"). This can cause the function to fail or behave unexpectedly.

Solution

Add a default empty string value to prevent None from being passed:

KEYCLOAK_HOST = os.getenv("KEYCLOAK_HOST", "")

Impact

  • Prevents potential runtime errors when KEYCLOAK_HOST is not configured
  • Consistent with the pattern used in annotation/annotation/token_dependency.py
  • Minimal change with no side effects

This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

@prjanitor
Copy link
Copy Markdown
Author

Closing this PR -- after a closer review, we believe this change isn't correct. Apologies for the noise; we're still ironing out some kinks in our automated flow. Thanks for your patience!

@prjanitor prjanitor closed this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant