Commit graph

13 commits

Author SHA1 Message Date
Snider
da1839f730 feat(api): webhooks + sunset headers + WithWebSocket + cmd/api migration
- webhook.go: HMAC-SHA256 WebhookSigner matching PHP WebhookSignature —
  sign/verify, X-Webhook-Signature / X-Webhook-Timestamp headers,
  VerifyRequest middleware helper, 5-minute default tolerance,
  secret generator (RFC §6)
- sunset.go: ApiSunsetWith(date, replacement, opts...) + WithSunsetNoticeURL;
  ApiSunset now emits API-Suggested-Replacement when replacement set;
  RouteDescription.NoticeURL surfaces API-Deprecation-Notice-URL (RFC §8)
- options.go + api.go + transport.go: WithWebSocket(gin.HandlerFunc)
  alongside existing WithWSHandler(http.Handler); gin form wins when
  both supplied (RFC §2.2)
- openapi.go: apiSuggestedReplacement + apiDeprecationNoticeURL as
  reusable header components; NoticeURL on a RouteDescription flips
  operation deprecated flag and emits response header doc
- cmd/api/*.go: migrated from Cobra (cli.NewCommand, StringFlag) to
  new path-based CLI API (c.Command + core.Options.String/Int/Bool);
  replaces the 1,422-line Cobra test suite with _Good/_Bad/_Ugly
  triads on the new surface
- webhook_test.go + sunset_test.go + websocket_test.go: full coverage

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 14:51:04 +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
0bb07f43f0 feat(openapi): hide undocumented routes
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 00:35:17 +00:00
Virgil
0984c2f48a docs(api): add AX usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:25:54 +00:00
Virgil
29324b0a0b feat(api): add sunset deprecation middleware
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:02:52 +00:00
Virgil
ccfbe57faf feat(openapi): document response headers 2026-04-01 22:42:13 +00:00
Virgil
eceda4e5c1 feat(openapi): support iterator-backed route descriptions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:55:33 +00:00
Virgil
7e4d8eb179 feat(openapi): add route examples to spec
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:51:02 +00:00
Virgil
071de51bb5 feat(openapi): mark deprecated operations in spec
Expose route-level deprecation in generated OpenAPI operations and cover it with a regression test.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:40:53 +00:00
Virgil
cd4e24d15f feat(api): document custom success statuses 2026-04-01 20:04:34 +00:00
Virgil
408a709a43 feat(openapi): allow route-level security overrides
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 19:54:13 +00:00
Virgil
0ed72c4952 feat(api): document explicit route parameters
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 19:12:51 +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