Skip to content

Commit 6c47b39

Browse files
committed
Align documentation and code for /status endpoint
1 parent 9b150b5 commit 6c47b39

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

compliance-monitor/README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,17 @@ The final field is the desired state; the other fields are used to determine the
183183
(within one report, version and check uniquely determine a result; the scope is given here as well
184184
in case reports at some point contain multiple scopes).
185185

186-
### GET /status/{subject}
186+
### GET /status
187187

188-
Returns the current status of the subject. Use the `Accept` header to select desired content type:
189-
190-
- `text/html` (default): a snippet of HTML suitable for the end user;
191-
- `image/png`: a PNG image of a badge;
192-
- `application/json`: a short summary in JSON format.
188+
Returns the current status of all subjects in JSON format.
189+
The request needs to be authenticated via basic auth, either with the role `read_any` for all subjects,
190+
or for the requested subject.
193191

194192
Query parameters:
195193

194+
- `subject` (optional): restrict subject
196195
- `scopeuuid` (optional): restrict scope
197-
- `version` (optional): restrict version
198-
- `privileged_view` (optional `0` or `1`, default `0`): request privileged view (see below)
199-
200-
If the privileged view is requested, then this request needs to be authenticated (via basic auth),
201-
either for the same subject or for some account with role `read_any`. This view will immediately
202-
show any non-pass result, whereas otherwise, such a result needs to be verified manually.
196+
- `version` (optional): restrict version (Currently broken)
203197

204198
### GET /metrics/{subject}
205199

compliance-monitor/monitor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ async def get_status(
553553
subject: str = None, scopeuuid: str = None, version: str = None,
554554
):
555555
check_role(account, subject, ROLES['read_any'])
556-
# note: text/html will be the default, but let's start with json to get the logic right
557556
accept = request.headers['accept']
558557
if 'application/json' not in accept and '*/*' not in accept:
559558
# see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406

0 commit comments

Comments
 (0)