Commit graph

15 commits

Author SHA1 Message Date
Snider
e54dd2e370 fix(pr#2): address CodeRabbit major/critical review findings
Go:
- codegen: pass trimmed specPath to buildArgs instead of raw g.SpecPath
- cmd/sdk: use local resolvedSpecFile to avoid mutating flag variable per-invocation
- export: write to temp file + atomic rename to prevent destination truncation on failure
- openapi: gate effectiveGraphQLPath/SwaggerPath/WSPath/SSEPath on enable flags; use effectiveSwaggerPath in effectiveAuthentikPublicPaths
- cache: reject oversized replacement before mutating LRU state for existing keys
- ratelimit: move setRateLimitHeaders before c.Next() so headers are sent; hash credential headers with SHA-256 to avoid storing raw secrets; prefer validated principal from context
- response_meta: track size separately from body buffer so Size() is accurate after body rewrites and in passthrough mode
- bridge: limit request body reads with http.MaxBytesReader (10 MiB); allow missing data key in ValidateResponse for nil/zero success responses; update recorder status in writeErrorResponse
- pkg/provider/proxy: validate target scheme and host after url.Parse to catch hostless inputs
- cmd_test: snapshot/restore global spec registry in TestAPISpecCmd_Good_RegisteredSpecGroups

PHP:
- HasApiResponses.php, config.php: add declare(strict_types=1)
- RateLimitExceededException: validate Origin against cors.allowed_origins before reflecting in CORS header
- ApiUsageService: import and use Core\Api\Models\ApiKey instead of fully-qualified Mod\ path
- SeoReportService: add SSRF protection (scheme check, private-IP rejection); add .throw() for HTTP error handling; disable automatic redirects

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-07 08:38:41 +01:00
Virgil
ec945970ee docs(api): add AX usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:51:21 +00:00
Virgil
68f5abefd0 fix(api): trim tool bridge tags
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 00:31:38 +00:00
Virgil
00c20ea6e8 refactor(api): streamline ToolBridge iterator snapshots
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:38:56 +00:00
Virgil
475027d716 refactor(api): wrap ToolBridge errors
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:36:58 +00:00
Virgil
2d1ed133f2 refactor(api): align OpenAPI client with AX principles
Use core-style error wrapping in the OpenAPI client, replace direct spec reads with streamed file I/O, and add compile-time interface assertions for ToolBridge.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:32:21 +00:00
Virgil
867221cbb8 fix(api): snapshot tool bridge iterators
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:27:19 +00:00
Virgil
0ed1cfa1b1 docs(api): add AX examples to public APIs
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:23:41 +00:00
Virgil
5da281c431 feat(bridge): support schema composition keywords
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 18:19:15 +00:00
Virgil
c6034031a3 feat(bridge): enforce additional schema constraints
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 16:50:29 +00:00
Virgil
28f9540fa8 fix(bridge): enforce tool schema enum validation
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 15:54:32 +00:00
Virgil
ac21992623 feat(api): enforce tool schema enums
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 15:46:35 +00:00
Virgil
5d5ca8aa51 feat(api): validate ToolBridge output schemas
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 13:18:10 +00:00
Virgil
6ef194754e feat(bridge): validate tool request bodies 2026-04-01 06:23:58 +00:00
Snider
753812ad57 feat(api): merge go-api + php-api into polyglot repo
Go source at root level (Option B), PHP under src/php/.
Module path: forge.lthn.ai/core/api
Package name: lthn/api

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 10:03:29 +00:00