Skip to content

fix(openapi): add rate_limited to error code enum - #7

Merged
c1trua merged 1 commit into
developfrom
bugfix/openapi-rate-limited
Apr 24, 2026
Merged

fix(openapi): add rate_limited to error code enum#7
c1trua merged 1 commit into
developfrom
bugfix/openapi-rate-limited

Conversation

@c1trua

@c1trua c1trua commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Background

The runtime already returns rate limit errors with:

  • code = rate_limited
  • reason = common.rate_limited

However, the OpenAPI ErrorCode enum did not include rate_limited, so the API contract was out of sync with the actual response shape. This also affects generated types used by clients.

Main Changes

  • Added rate_limited to the ErrorCode enum in api/openapi/openapi.v1.yaml
  • Regenerated internal/transport/http/v1/gen/openapi.gen.go
  • Added the generated ErrorCodeRateLimited constant

Impact

  • OpenAPI contract
  • Generated v1 HTTP/OpenAPI bindings
  • Client-side handling of error codes generated from the contract

This change does not modify runtime rate limiting behavior. It only aligns the contract and generated code with the existing response.

Validation

Executed locally:

  • .\scripts\gen_openapi.ps1
  • go test ./internal/transport/http/server ./internal/transport/http/v1

Results:

  • internal/transport/http/server: no test files
  • internal/transport/http/v1: passed

@c1trua
c1trua merged commit 0300f8d into develop Apr 24, 2026
1 check passed
@c1trua
c1trua deleted the bugfix/openapi-rate-limited branch April 24, 2026 11:58
c1trua added a commit that referenced this pull request Jun 17, 2026
* docs(contributing): update CONTRIBUTING.md

* feat(cicd): add github actions workflow

* fix(workflow): update golanglint version

* fix(workflow): update golanglint version

* fix(lint): linter passed

* feat(oss): support cross-account assume role credentials

* ci(deploy): add manual test ECS deployment

* ci(deploy): add manual test ECS deployment (#4)

* fix(openapi): add rate_limited to error code enum (#7)

* fix(deploy): deploy test ECS by uploading images over SSH (#8)

* fix(deploy): upload images to ECS instead of pulling from Docker Hub

* fix(deploy): allow container to read test config

* fix(deploy): verify api health after test deployment

* fix(deploy): verify api stability after test deployment

* fix(deploy): clean stale compose state before test deployment

* fix(deploy): log api deployment status explicitly

* fix(deploy): prevent migrate step from consuming ssh input

* ci(deploy): auto deploy test ECS on develop push

* ci(ops): add test ECS ops workflow

* ci(ops): add test ops workflow and reduce healthcheck noise

* ci(ops): add OSS presign diagnostics

* feat(profile): add avatar upload flow (#9)

* feat: add avatar upload flow

* fix(profile): stabilize avatar upload integration tests

* feat: add https support

* fmt: reformat

* fix: autocert gateway permission error

* fix: autocert error

* fix: autocert error

* fix(gateway): fallback SNI for autocert

* Revert "Merge pull request #14 from Muxi-X/fix/gateway-sni-fallback"

This reverts commit 74bd0e0, reversing
changes made to 52e2f0d.

* Revert "Merge pull request #13 from Muxi-X/feat/https"

This reverts commit 52e2f0d, reversing
changes made to 0faebb0.

* Revert "Merge pull request #12 from Muxi-X/feat/https"

This reverts commit 0faebb0, reversing
changes made to ad6bc82.

* Revert "Merge pull request #11 from Muxi-X/feat/https"

This reverts commit ad6bc82, reversing
changes made to 7770d94.

* Revert "Merge pull request #10 from Muxi-X/feat/https"

This reverts commit 7770d94, reversing
changes made to 981c240.

* build(deploy): add nginx + certbot for https

Expose API via Nginx on 80/443 with automatic Let's Encrypt issuance/renewal while keeping a localhost debug port.

* chore: update test domain

* refactor: remove nginx config (#17)

* refactor: remove nginx config

* chore(ci): disable auto-deploy on push to develop during PR merge

* feat: add custom keyword upload endpoints (#18)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo (#19)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo

* perf(deploy): skip unchanged dependency images in test deploy

* ci(deploy-test): switch from SCP zip transfer to Alibaba Cloud ACR

- Push cixing-api image + 5 base images to ACR (Hangzhou registry)
- ECS pulls images from ACR via docker compose pull instead of gzip load
- Remove docker save/gzip/scp image transfer steps
- Remove /opt/cixing/images/ tarball cleanup
- Update docker-compose.prod.yml to reference ACR image paths
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation

* ci(deploy-test): fix docker login host error

* ci(deploy-test): push cixing-api image to Alibaba Cloud ACR

- Push image to registry.cn-hangzhou.aliyuncs.com/muxi/memento:<sha>
- Remove docker save/gzip/scp image transfer steps
- ECS pulls cixing-api from ACR, base images from Docker Hub
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation
- Note: CONFIG must also fix postgres DSN from 127.0.0.1 to postgres

* fix(deploy-test): pass ACR credentials via SSH environment

* ci(deploy-test): pull only cixing-api from ACR

* fix(oss): remove duplicate https:// prefix in qiniu upload host

* fix(oss): remove null

* fix(oss): use SrcUpHosts (upload domain) instead of GetIoHost (IO domain) for presign upload URL

* fix(oss): presign returns FormData token field instead of Authorization header for Qiniu Kodo

- storage.go: PresignPut uses FormFields { token: upToken } instead of Authorization header
- object_storage.go: PresignResult gains FormFields map
- OpenAPI spec: UploadPresignedTarget gains form_fields field, method enum adds POST
- Handlers: map FormFields through to API response
- Qiniu form upload requires multipart/form-data with token in the form body

* fix(ci): remove duplicate Configure SSH block and nginx references

* fix(oss): gofmt client.go struct field alignment

* chore(test): remove tests that reference removed OSS config fields

* fix(oss): remove unused functions and fix errcheck lint warning

* fix: remove unused functions, fix integration test for Qiniu URL style

* fix(ci): resolve lint errors and integration test failures after Qiniu migration

* fix(ci): remove dead Mirror step that references undefined ACR_REGISTRY (#20)

* ci(deploy): add prod deploy workflow, parameterize compose config (#21)

* docs: update README for v0.1.0 release
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