Repository navigation
Fix/align specs with implementation #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
5ee0d34
3da54a9
9d798b4
af67e83
83acc91
80b6646
07c1360
d270d59
3df37d7
4c1d806
890265d
a7d3353
d440e69
1c462fe
2321e9f
6282964
20acee6
2753911
938d0d2
a2af16f
7573df4
e34fb89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ package handler | |
|
|
||
| import ( | ||
| "encoding/json" | ||
| "fmt" | ||
| "net/http" | ||
|
|
||
| "github.com/go-chi/chi/v5" | ||
|
|
@@ -10,6 +11,10 @@ import ( | |
| "github.com/godaddy/ans/internal/ra/service" | ||
| ) | ||
|
|
||
| const ( | ||
| maxCommentsLength = 200 | ||
| ) | ||
|
|
||
| // V1LifecycleHandler groups the V1 post-registration transitions: | ||
| // verify-acme, verify-dns, revoke. Shares the `RegistrationService` | ||
| // with V2; diverges only in DTO shape and TL-lane emission. | ||
|
|
@@ -149,6 +154,12 @@ func (h *V1LifecycleHandler) Revoke(w http.ResponseWriter, r *http.Request) { | |
| return | ||
| } | ||
|
|
||
| if len(req.Comments) > 200 { | ||
| WriteError(w, domain.NewValidationError("COMMENTS_TOO_LONG", | ||
| fmt.Sprintf("comments exceeds %d characters", maxCommentsLength))) | ||
| return | ||
| } | ||
|
Comment on lines
+159
to
+163
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Major — this guard needs a twin on the V2 lane (or a home in the shared service). The declaring spec for this constraint is Suggested fix: mirror this check in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Served historical schemas narrowed while the spec still claims they're verbatim production fetches |
||
|
|
||
| agentID := chi.URLParam(r, "agentId") | ||
| res, err := h.svc.Revoke(r.Context(), agentID, service.RevokeInput{ | ||
| Reason: domain.RevocationReason(req.Reason), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.