chore(platform): configure OSVX MCP endpoint

This commit is contained in:
Chris Christiansen 2026-09-19 00:42:40 +00:00
parent aee859b3ba
commit 3ddc0c50a6
4 changed files with 18 additions and 8 deletions

View File

@ -1,6 +1,11 @@
# This file overrides .gitignore for gcloud commands. # Keep Cloud Build uploads aligned with repository exclusions.
# We want to ignore most .json files (like service accounts), but not our test payload. #!include:.gitignore
# Never upload local JSON credentials; retain the intentional test payload.
*.json
!a2h2a-test-payload.json !a2h2a-test-payload.json
# Ignore the Spire directory to avoid permission errors during source upload. # Local build/runtime directories.
node_modules/
.git/
spire-1.15.3/ spire-1.15.3/

View File

@ -44,7 +44,7 @@ steps:
--platform=managed \ --platform=managed \
--no-allow-unauthenticated \ --no-allow-unauthenticated \
--service-account=jason-vauger@$PROJECT_ID.iam.gserviceaccount.com \ --service-account=jason-vauger@$PROJECT_ID.iam.gserviceaccount.com \
--set-env-vars=GOOGLE_CLOUD_PROJECT=$PROJECT_ID,STATIC_BUCKET=opax-vauco-static,CLOUD_RUN_SERVICE=osvauco-agent,CLOUD_BUILD_TRIGGER_ID=${_OSVAUCO_TRIGGER_ID},OPAX_IAP_CLIENT_ID=357036551735-kq8nt7ld38hfqlcfb3n52ef7tala4meo.apps.googleusercontent.com \ --set-env-vars=OSVX_MCP_URL=https://osvx-mcp-zjbqp3prqq-uc.a.run.app,GOOGLE_CLOUD_PROJECT=$PROJECT_ID,STATIC_BUCKET=opax-vauco-static,CLOUD_RUN_SERVICE=osvauco-agent,CLOUD_BUILD_TRIGGER_ID=${_OSVAUCO_TRIGGER_ID},OPAX_IAP_CLIENT_ID=357036551735-kq8nt7ld38hfqlcfb3n52ef7tala4meo.apps.googleusercontent.com \
--update-secrets=MCP_SECRET=mcp-server-key:latest,GITEA_TOKEN=gitea-token:latest,GITHUB_PAT=github-pat:latest \ --update-secrets=MCP_SECRET=mcp-server-key:latest,GITEA_TOKEN=gitea-token:latest,GITHUB_PAT=github-pat:latest \
--memory=512Mi \ --memory=512Mi \
--cpu=1 \ --cpu=1 \

View File

@ -8,7 +8,7 @@ import os
from datetime import datetime from datetime import datetime
from typing import Dict, List, Optional from typing import Dict, List, Optional
OPAX_BASE_URL = os.getenv('OPAX_BASE_URL', 'https://opax.vauco.no') OSVX_MCP_URL = os.getenv('OSVX_MCP_URL')
MCP_SECRET = os.getenv('MCP_SECRET') MCP_SECRET = os.getenv('MCP_SECRET')
# MCP Tool Registry - alle tools som krever A2H2A # MCP Tool Registry - alle tools som krever A2H2A
@ -47,7 +47,9 @@ A2H2A_TOOLS = {
class A2H2AClient: class A2H2AClient:
def __init__(self): def __init__(self):
self.base_url = OPAX_BASE_URL if not OSVX_MCP_URL:
raise ValueError("OSVX_MCP_URL environment variable not set.")
self.base_url = OSVX_MCP_URL
self.headers = { self.headers = {
'X-MCP-Secret': MCP_SECRET, 'X-MCP-Secret': MCP_SECRET,
'Content-Type': 'application/json' 'Content-Type': 'application/json'

View File

@ -22,8 +22,11 @@ class OpaxClient:
Guardrail-sjekk kjøres automatisk før hvert kall. Guardrail-sjekk kjøres automatisk før hvert kall.
""" """
def __init__(self, base_url: str = "https://opax.vauco.no", guardrails=None): def __init__(self, guardrails=None):
self.base_url = base_url.rstrip("/") OSVX_MCP_URL = os.getenv('OSVX_MCP_URL')
if not OSVX_MCP_URL:
raise ValueError("OSVX_MCP_URL environment variable not set.")
self.base_url = OSVX_MCP_URL.rstrip("/")
self.guardrails = guardrails self.guardrails = guardrails
self._token: str = "" self._token: str = ""