Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
GATEWAY_AUTH_ISSUER: ${{ secrets.GATEWAY_AUTH_ISSUER }}
GATEWAY_AUTH_AUDIENCE: ${{ secrets.GATEWAY_AUTH_AUDIENCE }}
GATEWAY_AUTH_CLIENT_ID: ${{ secrets.GATEWAY_AUTH_CLIENT_ID }}
GATEWAY_AUTH_CLIENT_SECRET: ${{ secrets.GATEWAY_AUTH_CLIENT_SECRET }}
docker:
name: Docker
runs-on: ubuntu-latest
Expand Down
12 changes: 0 additions & 12 deletions gcp/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
ANTHROPIC_API_KEY = os.environ["ANTHROPIC_API_KEY"]
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
HUGGING_FACE_TOKEN = os.environ["HUGGING_FACE_TOKEN"]
GATEWAY_AUTH_ISSUER = os.environ["GATEWAY_AUTH_ISSUER"]
GATEWAY_AUTH_AUDIENCE = os.environ["GATEWAY_AUTH_AUDIENCE"]
GATEWAY_AUTH_CLIENT_ID = os.environ["GATEWAY_AUTH_CLIENT_ID"]
GATEWAY_AUTH_CLIENT_SECRET = os.environ["GATEWAY_AUTH_CLIENT_SECRET"]

# Export GAE to to .gac.json and DB_PD to .dbpw in the current directory

Expand All @@ -39,14 +35,6 @@
dockerfile = dockerfile.replace(".anthropic_api_key", ANTHROPIC_API_KEY)
dockerfile = dockerfile.replace(".openai_api_key", OPENAI_API_KEY)
dockerfile = dockerfile.replace(".hugging_face_token", HUGGING_FACE_TOKEN)
dockerfile = dockerfile.replace(".gateway_auth_issuer", GATEWAY_AUTH_ISSUER)
dockerfile = dockerfile.replace(".gateway_auth_audience", GATEWAY_AUTH_AUDIENCE)
dockerfile = dockerfile.replace(
".gateway_auth_client_id", GATEWAY_AUTH_CLIENT_ID
)
dockerfile = dockerfile.replace(
".gateway_auth_client_secret", GATEWAY_AUTH_CLIENT_SECRET
)

with open(dockerfile_location, "w") as f:
f.write(dockerfile)
4 changes: 0 additions & 4 deletions gcp/policyengine_api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ ENV ANTHROPIC_API_KEY .anthropic_api_key
ENV OPENAI_API_KEY .openai_api_key
ENV HUGGING_FACE_TOKEN .hugging_face_token
ENV CREDENTIALS_JSON_API_V2 .credentials_json_api_v2
ENV GATEWAY_AUTH_ISSUER .gateway_auth_issuer
ENV GATEWAY_AUTH_AUDIENCE .gateway_auth_audience
ENV GATEWAY_AUTH_CLIENT_ID .gateway_auth_client_id
ENV GATEWAY_AUTH_CLIENT_SECRET .gateway_auth_client_secret

WORKDIR /app

Expand Down
191 changes: 0 additions & 191 deletions policyengine_api/libs/gateway_auth.py

This file was deleted.

24 changes: 1 addition & 23 deletions policyengine_api/libs/simulation_api_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
import httpx

from policyengine_api.gcp_logging import logger
from policyengine_api.libs.gateway_auth import (
GatewayAuthTokenProvider,
GatewayBearerAuth,
_require_all_or_none_gateway_auth_env,
)


@dataclass
Expand Down Expand Up @@ -52,24 +47,7 @@ def __init__(self):
"SIMULATION_API_URL",
"https://policyengine--policyengine-simulation-gateway-web-app.modal.run",
)
self._token_provider = GatewayAuthTokenProvider()
_require_all_or_none_gateway_auth_env()
auth = (
GatewayBearerAuth(self._token_provider)
if self._token_provider.configured
else None
)
if auth is None:
logger.log_struct(
{
"message": (
"SimulationAPIModal initialised without gateway auth; "
"all GATEWAY_AUTH_* env vars are unset."
),
},
severity="WARNING",
)
self.client = httpx.Client(timeout=30.0, auth=auth)
self.client = httpx.Client(timeout=30.0)

def run(self, payload: dict) -> ModalSimulationExecution:
"""
Expand Down
Loading
Loading