Skip to content

Commit

Permalink
UPDATE function settings
Browse files Browse the repository at this point in the history
  • Loading branch information
elay committed Jun 25, 2024
1 parent d941b49 commit 9b8282d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions pc-funcs.dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ IMAGE_OUTPUT_STORAGE_URL="http://azurite:10000/devstoreaccount1/output/images"
IMAGE_OUTPUT_ACCOUNT_KEY="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
IMAGE_API_ROOT_URL="https://planetarycomputer-staging.microsoft.com/api/data/v1"
IMAGE_TILE_REQUEST_CONCURRENCY=2

STORAGE_ACCOUNT_URL=https://pctapisstagingsa.table.core.windows.net/
BANNED_IP_TABLE=blobstoragebannedip
LOG_ANALYTICS_WORKSPACE_ID=78d48390-b6bb-49a9-b7fd-a86f6522e9c4
17 changes: 8 additions & 9 deletions pcfuncs/ipban/config.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# config.py
from pydantic import BaseSettings
from pydantic import BaseSettings, Field


class Settings(BaseSettings):
# Constants related to Azure Table Storage
storage_account_url: str = "https://pctapisstagingsa.table.core.windows.net/"
banned_ip_table: str = "blobstoragebannedip"

# Log Analytics Workspace: pc-api-loganalytics
log_analytics_workspace_id: str = "78d48390-b6bb-49a9-b7fd-a86f6522e9c4"
storage_account_url: str = Field(env="STORAGE_ACCOUNT_URL")
banned_ip_table: str = Field(env="BANNED_IP_TABLE")
log_analytics_workspace_id: str = Field(env="LOG_ANALYTICS_WORKSPACE_ID")

# Time and threshold settings
time_window_in_hours: int = 24
threshold_read_count_in_gb: int = 5120
time_window_in_hours: int = Field(default=24, env="TIME_WINDOW_IN_HOURS")
threshold_read_count_in_gb: int = Field(
default=5120, env="THRESHOLD_READ_COUNT_IN_GB"
)


# Create a global settings instance
Expand Down

0 comments on commit 9b8282d

Please sign in to comment.