Skip to content

Commit d6e3781

Browse files
authored
Apply audit remediation
Apply audit remediation from the 2026-06-10 review.
1 parent 8d7043b commit d6e3781

7 files changed

Lines changed: 47 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ on:
55
branches: [ main ]
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
test:
1013
runs-on: ubuntu-latest
14+
timeout-minutes: 20
1115
steps:
1216
- name: Checkout
1317
uses: actions/checkout@v6
@@ -75,7 +79,7 @@ jobs:
7579
- name: Setup Python
7680
uses: actions/setup-python@v6
7781
with:
78-
python-version: "3.11"
82+
python-version: "3.12"
7983

8084
- name: Install dependencies
8185
run: |

.github/workflows/dependabot_auto_merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
auto-merge:
1010
if: github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'dependabot/')
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 10
1213
permissions:
1314
contents: write
1415
pull-requests: write

.github/workflows/execution-report-heartbeat.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ env:
2424
GCP_WORKLOAD_IDENTITY_PROVIDER: projects/303168642265/locations/global/workloadIdentityPools/github-actions/providers/github-main
2525
GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT: ibkr-platform-deploy@interactivebrokersquant.iam.gserviceaccount.com
2626

27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref_name }}
29+
cancel-in-progress: false
30+
2731
jobs:
2832
heartbeat:
2933
name: Check execution report heartbeat
3034
runs-on: ubuntu-latest
35+
timeout-minutes: 15
3136
permissions:
3237
contents: read
3338
id-token: write

.github/workflows/runtime-guard.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,15 @@ env:
3232
GCP_WORKLOAD_IDENTITY_PROVIDER: projects/303168642265/locations/global/workloadIdentityPools/github-actions/providers/github-main
3333
GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT: ibkr-platform-deploy@interactivebrokersquant.iam.gserviceaccount.com
3434

35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.ref_name }}
37+
cancel-in-progress: false
38+
3539
jobs:
3640
guard:
3741
name: Check Cloud Run runtime
3842
runs-on: ubuntu-latest
43+
timeout-minutes: 15
3944
permissions:
4045
contents: read
4146
id-token: write

.github/workflows/sync-cloud-run-env.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ env:
4949
GCP_RUNTIME_SERVICE_ACCOUNT: ibkr-platform-runtime@interactivebrokersquant.iam.gserviceaccount.com
5050
GCP_ARTIFACT_REGISTRY_REPOSITORY: cloud-run-source-deploy
5151

52+
concurrency:
53+
group: ${{ github.workflow }}-${{ github.ref_name }}
54+
cancel-in-progress: false
55+
5256
jobs:
5357
sync-cloud-run-env:
5458
name: Deploy / Sync Cloud Run
5559
runs-on: ubuntu-latest
60+
timeout-minutes: 20
5661
permissions:
5762
contents: read
5863
id-token: write

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

tests/test_request_handling.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
from application.cycle_result import StrategyCycleResult
44

55

6+
def route_methods(strategy_module):
7+
return {
8+
rule.rule: sorted(rule.methods - {"HEAD", "OPTIONS"})
9+
for rule in strategy_module.app.url_map.iter_rules()
10+
}
11+
12+
13+
def test_cloud_run_route_contracts_are_registered(strategy_module):
14+
assert route_methods(strategy_module) == {
15+
"/": ["GET", "POST"],
16+
"/precheck": ["GET", "POST"],
17+
"/probe": ["GET", "POST"],
18+
"/health": ["GET"],
19+
"/static/<path:filename>": ["GET"],
20+
}
21+
22+
23+
def test_health_route_returns_ok(strategy_module):
24+
with strategy_module.app.test_request_context("/health", method="GET"):
25+
body, status = strategy_module.health()
26+
27+
assert status == 200
28+
assert body == "OK"
29+
30+
631
def test_handle_request_get_returns_safe_message(strategy_module, monkeypatch):
732
def fail_if_called():
833
raise AssertionError("GET should not execute strategy")

0 commit comments

Comments
 (0)