-
Notifications
You must be signed in to change notification settings - Fork 1
More backporting pyrefly + vacuum #203
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 all commits
afa9568
bf4d97c
79ba29c
c26519f
d572780
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 |
|---|---|---|
|
|
@@ -7,7 +7,27 @@ | |
| owasp-define-error-validation: | ||
| - "$.paths['/api/shutdown'].get.responses" | ||
|
|
||
| {% endraw %}{% if backend_uses_graphql %}{% raw %}# /api/graphql's 200 response body is arbitrary JSON shaped by the caller's GraphQL query/GraphiQL page; | ||
| {% endraw %}{% if is_circuit_python_driver %}{% raw %}# A generated driver only ever manages a single physical device connection at a time, so its | ||
|
Contributor
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. If the route is id/attribute, then that would be a little common singular pattern a lot right, not just for drivers? We may need a refactor later to make vacuum better suited |
||
| # resource paths are intentionally singular ("driver", not "drivers") rather than REST-collection plural. | ||
| resources-plural: | ||
| - "$.paths['/api/driver/data-from-serial-port']" | ||
| - "$.paths['/api/driver/device-info-from-serial-port']" | ||
| - "$.paths['/api/driver/device-connection']" | ||
| - "$.paths['/api/driver/send-raw-command']" | ||
| - "$.paths['/api/driver/measurement-types']" | ||
|
Contributor
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. NIT: isn't types already plural?
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. Issue is not with measurement-types its with driver. Resources plural is ensuring that resources are in fact plural. In this case switching those all our to be drivers felt off specially since some of those debug commands are not using sensor_ids. Wonder if the better answer is we should actually drop driver. And it should become
Contributor
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. Ah. I think I was thinking of "driver" originally as more of a "category", because there was were other routes having to do with "mDNS". Yeah, definitely due for some refactoring, and definitely not in this PR |
||
| - "$.paths['/api/driver/{sensor_id}']" | ||
| - "$.paths['/api/driver/{sensor_id}/name']" | ||
| - "$.paths['/api/driver/{sensor_id}/reset']" | ||
| - "$.paths['/api/driver/{sensor_id}/clear-memory']" | ||
| - "$.paths['/api/driver/{sensor_id}/measure/export']" | ||
|
|
||
| # no-request-body flags DELETE with a body as non-RESTful. DELETE /device-connection removes a | ||
| # device by mDNS service name with no resource ID in the path, so the service name must travel | ||
| # in the body. The rule stays enabled for future endpoints; only this one is exempted. | ||
| no-request-body: | ||
| - "$.paths['/api/driver/device-connection'].delete" | ||
|
|
||
| {% endraw %}{% endif %}{% raw %}{% endraw %}{% if backend_uses_graphql %}{% raw %}# /api/graphql's 200 response body is arbitrary JSON shaped by the caller's GraphQL query/GraphiQL page; | ||
| # there is no single representative example to attach without misleadingly implying a fixed response shape. | ||
| response-body-example: | ||
| - "$.paths['/api/graphql'].get.responses['200']" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.