Problem
When using APIGate as a reverse proxy for Hoster, ALL requests require API key authentication. There's no way to configure a route as "public" to allow unauthenticated access.
Use Case
Hoster (deployment marketplace) needs:
- Public frontend (
/*) - Marketplace browsing without login
- Authenticated API (
/api/*) - Requires API key with header injection
- Authenticated apps (
*.apps.domain) - Deployed apps
Currently, even the marketplace landing page requires an API key, which breaks the user experience.
Proposed Solution
Add auth_required field to routes (default: true for backward compatibility):
Database Migration
ALTER TABLE routes ADD COLUMN auth_required INTEGER NOT NULL DEFAULT 1;
Route Domain Model
type Route struct {
// ... existing fields ...
AuthRequired bool `json:"auth_required"` // Default: true
}
Proxy Handler Change
Move route matching BEFORE auth check:
- Match route first
- If
route.AuthRequired == false: skip API key validation, forward request
- If
route.AuthRequired == true: current flow (validate key, inject headers, etc.)
Admin API
Accept auth_required in route create/update:
{
"name": "hoster-frontend",
"path_pattern": "/*",
"upstream_id": "xxx",
"auth_required": false
}
CLI
apigate routes create --name frontend --path "/*" --upstream hoster --auth=false
Behavior When auth_required=false
- No API key required
- No rate limiting applied
- No quota tracking
- Anonymous usage still logged for analytics
- Request/response transforms still work
- Upstream auth injection still works
Related
This was previously discussed in issue #22 but implementation was not completed.
Environment
- APIGate: latest
- Hoster: using APIGate for auth/billing proxy
Problem
When using APIGate as a reverse proxy for Hoster, ALL requests require API key authentication. There's no way to configure a route as "public" to allow unauthenticated access.
Use Case
Hoster (deployment marketplace) needs:
/*) - Marketplace browsing without login/api/*) - Requires API key with header injection*.apps.domain) - Deployed appsCurrently, even the marketplace landing page requires an API key, which breaks the user experience.
Proposed Solution
Add
auth_requiredfield to routes (default:truefor backward compatibility):Database Migration
Route Domain Model
Proxy Handler Change
Move route matching BEFORE auth check:
route.AuthRequired == false: skip API key validation, forward requestroute.AuthRequired == true: current flow (validate key, inject headers, etc.)Admin API
Accept
auth_requiredin route create/update:{ "name": "hoster-frontend", "path_pattern": "/*", "upstream_id": "xxx", "auth_required": false }CLI
apigate routes create --name frontend --path "/*" --upstream hoster --auth=falseBehavior When
auth_required=falseRelated
This was previously discussed in issue #22 but implementation was not completed.
Environment