feat: add hosts and postures endpoints with CRUD operations#8
Merged
Conversation
Member
Author
There was a problem hiding this comment.
❌ Changes requested. Reviewed everything up to cb39868 in 40 seconds
More details
- Looked at
617lines of code in3files - Skipped
0files when reviewing. - Skipped posting
1drafted comments based on config settings.
1. pkg/acl/hosts/hosts.go:42
- Draft comment:
Consider using a URL parameter for the host name in the DELETE /hosts endpoint instead of expecting a JSON body. This aligns with RESTful conventions and is more consistent with the GET /hosts/:name endpoint. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
This is a reasonable suggestion about API design and consistency. The code would be more RESTful and consistent if DELETE used the same URL parameter pattern as GET. However, both approaches are valid and commonly used. The current implementation works fine, and changing it would be a style preference rather than fixing a clear bug or issue.
The current implementation with JSON body is also valid and has advantages - it's more extensible if more fields need to be added later, and some argue it's more explicit. The change would be purely stylistic.
While both approaches are valid, consistency within the same API is valuable for developers using the API. The suggestion would improve the API's coherence.
While this is a reasonable suggestion for improving API consistency, it's more of a style preference than a critical issue. The current implementation is valid and functional.
Workflow ID: wflow_Qbo8sOH3KrWaWoqg
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
| p.PUT("", func(c *gin.Context) { | ||
| updatePosture(c, state) | ||
| }) | ||
| p.DELETE("", func(c *gin.Context) { |
There was a problem hiding this comment.
Consider using a URL parameter for the posture name in the DELETE /postures endpoint instead of expecting a JSON body. This aligns with RESTful conventions and is more consistent with the GET /postures/:name endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Add
/hostsand/posturesendpoints with CRUD operations and default posture handling inmain.go,hosts.go, andpostures.go./hostsand/posturesendpoints inmain.gofor managing hosts and postures.RegisterRoutesinhosts.goto handle/hostsendpoints.RegisterRoutesinpostures.goto handle/posturesendpoints.This description was created by
for cb39868. It will automatically update as commits are pushed.