Skip to content

test: add self-hosted zero-config mode tests#2

Merged
saurabhjain1592 merged 1 commit into
mainfrom
test/selfhosted-zero-config
Dec 20, 2025
Merged

test: add self-hosted zero-config mode tests#2
saurabhjain1592 merged 1 commit into
mainfrom
test/selfhosted-zero-config

Conversation

@saurabhjain1592

Copy link
Copy Markdown
Member

Summary

Add comprehensive tests for the zero-configuration self-hosted mode where users can run AxonFlow without any API keys, license keys, or credentials.

This tests the "first run" experience:

  1. User starts the agent with SELF_HOSTED_MODE=true and SELF_HOSTED_MODE_ACKNOWLEDGED=I_UNDERSTAND_NO_AUTH
  2. User connects the SDK with no credentials
  3. SDK requests succeed without authentication errors

Test Coverage

Category Tests
Client Initialization 3 tests - no credentials, empty credentials, non-localhost requires auth
Gateway Mode 3 tests - pre-check with empty/whitespace tokens, full flow with audit
Proxy Mode 1 test - executeQuery with empty token
Policy Enforcement 2 tests - SQL injection and PII still blocked
Health Check 1 test - healthCheck without credentials
First-Time User 1 test - complete first-time user flow
Auth Headers 1 test - verify no auth headers sent for localhost

All tests use WireMock for mocking the agent endpoints.

How to Run

mvn test -Dtest=SelfHostedZeroConfigTest

Related

  • getaxonflow/axonflow-enterprise#682 - Issue: Zero-config self-hosted mode tests
  • getaxonflow/axonflow-enterprise#683 - Agent-level tests (merged)

Tests for the zero-configuration self-hosted mode where users can run
AxonFlow without any API keys, license keys, or credentials.

Test coverage includes:
- Client creation without credentials for localhost (using WireMock)
- Gateway Mode (getPolicyApprovedContext, auditLLMCall) with empty tokens
- Proxy Mode (executeQuery) without authentication
- Policy enforcement (SQL injection, PII) still works without auth
- Health check without credentials
- First-time user experience validation
- Verification that auth headers are not sent for localhost

Related: getaxonflow/axonflow-enterprise#682
@saurabhjain1592 saurabhjain1592 merged commit 8a17c37 into main Dec 20, 2025
9 checks passed
saurabhjain1592 added a commit that referenced this pull request Jan 6, 2026
Adds comprehensive tests for self-hosted zero-config mode using WireMock.

Test coverage:
- Client initialization without credentials for localhost
- Gateway Mode with empty/whitespace user tokens
- Proxy Mode without authentication
- Policy enforcement (SQL injection, PII) still works
- Health check without credentials
- First-time user experience simulation
- Verification that auth headers not sent for localhost

Part of Issue #682 (axonflow-enterprise)
@saurabhjain1592 saurabhjain1592 deleted the test/selfhosted-zero-config branch January 11, 2026 13:20
saurabhjain1592 added a commit that referenced this pull request Jun 16, 2026
…orkflow perms + example SDK bump

Three security alerts on axonflow-sdk-java:

1. CodeQL java/insecure-trustmanager (#8, high) at HttpClientFactory.java.
   The trust-all path is an intentional, double-gated development escape
   hatch for self-signed certs (requires BOTH insecureSkipVerify(true) AND
   AXONFLOW_INSECURE_TLS env var). Rather than remove the dev affordance,
   this adds a hard production guard: when a production-like deployment
   environment is detected (ENVIRONMENT / AXONFLOW_ENVIRONMENT / APP_ENV /
   SPRING_PROFILES_ACTIVE / NODE_ENV / ... carrying a 'prod'/'production'
   token), the insecure path is REFUSED outright, TLS verification stays
   enabled, and a SECURITY error is logged naming the signalling variable.
   New tests prove the guard PREVENTS the insecure path (not just logs),
   handles compound values (prod,metrics), and does not false-positive on
   non-production values. Alert to be dismissed-by-design on #2711 now that
   the production path is belt-and-suspenders hardened. Real code change ->
   VERSION bumped 8.5.0 -> 8.5.1 + CHANGELOG.

2. CodeQL actions/missing-workflow-permissions (#9, med) on
   heartbeat-real-stack.yml: added a top-level least-privilege
   'permissions: contents: read' block (workflow only checks out + tests).
   Block kept identical to the axonflow-sdk-typescript fix for coherence.

3. Dependabot #2 (med): examples/wcp-retry-idempotency/pom.xml pinned a
   stale com.getaxonflow:axonflow-sdk 5.5.0 (vulnerable < 6.0.0); bumped to
   the current released 8.5.0.

Refs getaxonflow/axonflow-enterprise#2711

Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
saurabhjain1592 added a commit that referenced this pull request Jun 16, 2026
…orkflow perms + example SDK bump (#193)

Three security alerts on axonflow-sdk-java:

1. CodeQL java/insecure-trustmanager (#8, high) at HttpClientFactory.java.
   The trust-all path is an intentional, double-gated development escape
   hatch for self-signed certs (requires BOTH insecureSkipVerify(true) AND
   AXONFLOW_INSECURE_TLS env var). Rather than remove the dev affordance,
   this adds a hard production guard: when a production-like deployment
   environment is detected (ENVIRONMENT / AXONFLOW_ENVIRONMENT / APP_ENV /
   SPRING_PROFILES_ACTIVE / NODE_ENV / ... carrying a 'prod'/'production'
   token), the insecure path is REFUSED outright, TLS verification stays
   enabled, and a SECURITY error is logged naming the signalling variable.
   New tests prove the guard PREVENTS the insecure path (not just logs),
   handles compound values (prod,metrics), and does not false-positive on
   non-production values. Alert to be dismissed-by-design on #2711 now that
   the production path is belt-and-suspenders hardened. Real code change ->
   VERSION bumped 8.5.0 -> 8.5.1 + CHANGELOG.

2. CodeQL actions/missing-workflow-permissions (#9, med) on
   heartbeat-real-stack.yml: added a top-level least-privilege
   'permissions: contents: read' block (workflow only checks out + tests).
   Block kept identical to the axonflow-sdk-typescript fix for coherence.

3. Dependabot #2 (med): examples/wcp-retry-idempotency/pom.xml pinned a
   stale com.getaxonflow:axonflow-sdk 5.5.0 (vulnerable < 6.0.0); bumped to
   the current released 8.5.0.

Refs getaxonflow/axonflow-enterprise#2711

Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant