-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: implement GET /registration_requests and /registration_requests/{id} #140
Conversation
Signed-off-by: James Ramirez <[email protected]>
…/{id} Signed-off-by: James Ramirez <[email protected]>
WalkthroughThe updates involve refining JSON parsing logic and introducing new test scripts for registration requests in the Kolide API. These changes enhance data extraction methods and extend test coverage to validate additional functionality related to registration requests, ensuring the API's reliability and adherence to specified requirements. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Out of diff range and nitpick comments (18)
docs/tables/kolide_registration_request.md (1)
21-21
: Consider adding a preposition for clarity: "List all unresolved requests for".docs/coverage.md (17)
Line range hint
3-3
: Consider using the Oxford spelling "utilising" to maintain consistency with international English standards.
Line range hint
9-9
: For British English, consider changing "Ok" to "OK".
Line range hint
10-10
: For British English, consider changing "Ok" to "OK".
Line range hint
19-19
: For British English, consider changing "Ok" to "OK".
Line range hint
20-20
: For British English, consider changing "Ok" to "OK".
Line range hint
22-22
: For British English, consider changing "Ok" to "OK".
Line range hint
23-23
: For British English, consider changing "Ok" to "OK".
Line range hint
27-27
: For British English, consider changing "Ok" to "OK".
Line range hint
40-40
: For British English, consider changing "Ok" to "OK".
Line range hint
41-41
: For British English, consider changing "Ok" to "OK".
Line range hint
42-42
: For British English, consider changing "Ok" to "OK".
43-43
: For British English, consider changing "Ok" to "OK".
46-46
: For British English, consider changing "Ok" to "OK".
47-47
: For British English, consider changing "Ok" to "OK".
Line range hint
55-55
: For British English, consider changing "Ok" to "OK".
Line range hint
56-56
: For British English, consider changing "Ok" to "OK".
Line range hint
59-59
: For British English, consider changing "ok" to "OK".
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (29)
- docs/coverage.md (1 hunks)
- docs/tables/kolide_registration_request.md (1 hunks)
- kolide/client/registration_requests.go (1 hunks)
- kolide/plugin.go (1 hunks)
- kolide/table_kolide_registration_request.go (1 hunks)
- test/end-to-end/_query/kolide_registration_request.sql (1 hunks)
- test/end-to-end/_query/kolide_registration_request_by_id.sql (1 hunks)
- test/end-to-end/_results/kolide_registration_request.bash (1 hunks)
- test/end-to-end/kolide_admin_user.bats (1 hunks)
- test/end-to-end/kolide_admin_user_by_id.bats (1 hunks)
- test/end-to-end/kolide_audit_log.bats (1 hunks)
- test/end-to-end/kolide_audit_log_by_id.bats (1 hunks)
- test/end-to-end/kolide_check.bats (1 hunks)
- test/end-to-end/kolide_check_by_id.bats (1 hunks)
- test/end-to-end/kolide_deprovisioned_person.bats (1 hunks)
- test/end-to-end/kolide_device.bats (1 hunks)
- test/end-to-end/kolide_device_by_id.bats (1 hunks)
- test/end-to-end/kolide_device_open_issue.bats (1 hunks)
- test/end-to-end/kolide_issue.bats (1 hunks)
- test/end-to-end/kolide_issue_by_id.bats (1 hunks)
- test/end-to-end/kolide_package.bats (1 hunks)
- test/end-to-end/kolide_package_by_id.bats (1 hunks)
- test/end-to-end/kolide_person.bats (1 hunks)
- test/end-to-end/kolide_person_by_id.bats (1 hunks)
- test/end-to-end/kolide_person_open_issue.bats (1 hunks)
- test/end-to-end/kolide_person_registered_device.bats (1 hunks)
- test/end-to-end/kolide_registration_request.bats (1 hunks)
- test/end-to-end/kolide_registration_request_by_id.bats (1 hunks)
- test/end-to-end/kolide_unprocessable_entity.bats (1 hunks)
Files skipped from review due to trivial changes (4)
- test/end-to-end/_query/kolide_registration_request.sql
- test/end-to-end/_query/kolide_registration_request_by_id.sql
- test/end-to-end/_results/kolide_registration_request.bash
- test/end-to-end/kolide_admin_user_by_id.bats
Additional Context Used
LanguageTool (18)
docs/coverage.md (17)
Near line 3: Would you like to use the Oxford spelling “utilizing”? The spelling ‘utilising’ is also correct.
Context: ...he observed behaviour of the Kolide API utilising credentials representing different bill...
Near line 9: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /audit_logs/{id} ...
Near line 10: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /devices/{deviceId}/open_i...
Near line 19: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /issues/{id} ...
Near line 20: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /deprovisioned_people ...
Near line 22: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /packages/{id} ...
Near line 23: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /people/{personId}/registe...
Near line 27: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ❓ | ? | ? | Ok | | GET | /person_groups ...
Near line 40: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /checks/{id} ...
Near line 41: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /exemption_requests ...
Near line 42: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | #36 | ? | ? | Ok | | GET | /exemption_requests/{id} ...
Near line 43: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | #37 | ? | ? | Ok | | PATCH | /exemption_requests/{id} ...
Near line 46: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ❓ | ? | ? | Ok | | GET | /registration_requests/{id...
Near line 47: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ❓ | ? | ? | Ok | | PATCH | /registration_requests/{id...
Near line 55: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | | GET | /admin_users/{id} ...
Near line 56: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ... | ✅ | ? | ? | Ok | [^1]: Returns a 403, not included in...
Near line 59: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ... included in billing plan [^2]: Returns ok, but registration information is missin...docs/tables/kolide_registration_request.md (1)
Near line 21: Possible missing preposition found.
Context: ...ide_registration_request;### List all unresolved requests
sql select id...
Additional comments not posted (73)
test/end-to-end/kolide_check_by_id.bats (1)
20-20
: The change to use '.rows | length' for JSON parsing aligns with the updated output format in Steampipe v0.23. This ensures that the test accurately counts the number of results.test/end-to-end/kolide_issue_by_id.bats (1)
20-20
: The update to JSON parsing using '.rows | length' is consistent with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_device_by_id.bats (1)
20-20
: Consistent update to JSON parsing using '.rows | length' across test files aligns with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_person_by_id.bats (1)
20-20
: This update to JSON parsing using '.rows | length' is consistent with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_package_by_id.bats (1)
20-20
: Consistent update to JSON parsing using '.rows | length' across test files aligns with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_audit_log_by_id.bats (1)
20-20
: This update to JSON parsing using '.rows | length' is consistent with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_registration_request_by_id.bats (1)
20-20
: Consistent update to JSON parsing using '.rows | length' across test files aligns with the changes in Steampipe v0.23, ensuring accurate result counting.test/end-to-end/kolide_deprovisioned_person.bats (2)
32-32
: The JSON parsing for the name field is correctly implemented.
38-38
: The JSON parsing and conditional output for the email field are correctly handled.test/end-to-end/kolide_unprocessable_entity.bats (2)
27-27
: The JSON parsing for counting the results is correctly implemented.
34-34
: The JSON parsing for the title field is correctly implemented.test/end-to-end/kolide_device.bats (4)
26-26
: The JSON parsing for counting the results is correctly implemented.
32-32
: The JSON parsing for the name field is correctly implemented.
38-38
: The JSON parsing and conditional output for the hardware model field are correctly handled.
43-43
: The JSON parsing for the serial field is correctly implemented.test/end-to-end/kolide_person_registered_device.bats (4)
26-26
: The JSON parsing for counting the results is correctly implemented.
32-32
: The JSON parsing for the name field is correctly implemented.
38-38
: The JSON parsing and conditional output for the hardware model field are correctly handled.
43-43
: The JSON parsing for the serial field is correctly implemented.test/end-to-end/kolide_person.bats (4)
26-26
: The JSON parsing for counting the results is correctly implemented.
32-32
: The JSON parsing for the name field is correctly implemented.
38-38
: The JSON parsing and conditional output for the email field are correctly handled.
44-44
: The JSON parsing for the has_registered_device field is correctly implemented.test/end-to-end/kolide_audit_log.bats (4)
26-26
: The JSON parsing for counting the results is correctly implemented.
33-33
: The JSON parsing for the timestamp field is correctly implemented.
39-39
: The JSON parsing for the description field is correctly implemented.
45-45
: The JSON parsing for the actor_name field is correctly implemented.kolide/client/registration_requests.go (3)
5-8
: The structure forRegistrationRequestListResponse
is correctly defined to match the expected JSON response format.
9-18
: The structure forRegistrationRequest
is correctly defined, including appropriate use ofomitempty
for optional fields.
20-23
: The handling of potential type discrepancy inRequesterInformation
is appropriately addressed with a comment and flexible type choice.kolide/plugin.go (1)
42-42
: Addition of the "kolide_registration_request" table to the plugin's table map looks correct.test/end-to-end/kolide_admin_user.bats (6)
26-26
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
32-32
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
37-37
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
43-43
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
49-49
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
55-55
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.test/end-to-end/kolide_device_open_issue.bats (6)
26-26
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
33-33
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
39-39
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
45-45
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
51-51
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
57-57
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.test/end-to-end/kolide_person_open_issue.bats (6)
26-26
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
33-33
: Adjustment to JSON parsing to use.rows
for accessing data aligns with the new JSON output format in Steampipe v0.23.
39-39
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
45-45
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
51-51
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
57-57
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.test/end-to-end/kolide_issue.bats (6)
26-26
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
33-33
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
39-39
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
45-45
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
51-51
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
57-57
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.test/end-to-end/kolide_registration_request.bats (7)
26-26
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
32-32
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
37-37
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
43-43
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
49-49
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
55-55
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
61-61
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.test/end-to-end/kolide_check.bats (8)
26-26
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
32-32
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
37-37
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
43-43
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
49-49
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
55-55
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
61-61
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.
67-67
: Adjustment to JSON parsing to use `.rows” for accessing data aligns with the new JSON output format in Steampipe v0.23.kolide/table_kolide_registration_request.go (3)
14-45
: The table structure for `kolide_registration_request” is well-defined, with appropriate column types and descriptions. List and get configurations are correctly set up.
50-56
: The function `listRegistrationRequests” is correctly implemented to interact with the Kolide API for listing registration requests.
60-65
: The function `getRegistrationRequest” is correctly implemented to interact with the Kolide API for getting a specific registration request.
Signed-off-by: James Ramirez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- test/end-to-end/kolide_deprovisioned_person.bats (1 hunks)
- test/end-to-end/kolide_unprocessable_entity.bats (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- test/end-to-end/kolide_deprovisioned_person.bats
- test/end-to-end/kolide_unprocessable_entity.bats
Description
Implement GET /registration_requests and /registration_requests/{id} endpoints, together with revising tests to handle JSON output produced in Steampiper v0.23
Related Tickets & Documents
Closes #38, #39
Steps to Verify
Untested, insufficient data