Skip to content

Commit

Permalink
feat: use public rules endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Jul 16, 2024
1 parent d9b43f4 commit 9f8fb3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions bento_beacon/config_files/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class Config:
KATSU_SEARCH_OVERVIEW = "/api/search_overview"
KATSU_PRIVATE_OVERVIEW = "/api/overview"
KATSU_PUBLIC_OVERVIEW = "/api/public_overview"
KATSU_PUBLIC_RULES = "/api/public_rules"
KATSU_TIMEOUT = int(os.environ.get("BEACON_KATSU_TIMEOUT", 180))

MAP_EXTRA_PROPERTIES_TO_INFO = os.environ.get("MAP_EXTRA_PROPERTIES_TO_INFO", True)
Expand Down
7 changes: 4 additions & 3 deletions bento_beacon/utils/katsu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,10 @@ def overview_statistics():


def katsu_censorship_settings() -> tuple[int | None, int | None]:
overview = katsu_get(current_app.config["KATSU_PUBLIC_OVERVIEW"])
max_filters = overview.get("max_query_parameters")
count_threshold = overview.get("count_threshold")
# TODO: should be project-dataset scoped
rules = katsu_get(current_app.config["KATSU_PUBLIC_RULES"])
max_filters = rules.get("max_query_parameters")
count_threshold = rules.get("count_threshold")
# return even if None
return max_filters, count_threshold

Expand Down

0 comments on commit 9f8fb3b

Please sign in to comment.