Skip to content

Commit 16fba49

Browse files
committed
Remove authentication from status endpoint; remove defunct version filter
Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent 3291908 commit 16fba49

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

compliance-monitor/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,11 @@ in case reports at some point contain multiple scopes).
186186
### GET /status
187187

188188
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.
191189

192190
Query parameters:
193191

194192
- `subject` (optional): restrict subject
195193
- `scopeuuid` (optional): restrict scope
196-
- `version` (optional): restrict version ([Currently bugged](https://github.com/SovereignCloudStack/standards/issues/1181))
197194

198195
### GET /metrics/{subject}
199196

compliance-monitor/monitor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,15 @@ def convert_result_rows_to_dict2(
548548
@app.get("/status")
549549
async def get_status(
550550
request: Request,
551-
account: Annotated[Optional[tuple[str, str]], Depends(auth)],
552551
conn: Annotated[connection, Depends(get_conn)],
553-
subject: str = None, scopeuuid: str = None, version: str = None,
552+
subject: str = None, scopeuuid: str = None,
554553
):
555-
check_role(account, subject, ROLES['read_any'])
556554
accept = request.headers['accept']
557555
if 'application/json' not in accept and '*/*' not in accept:
558556
# see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406
559557
raise HTTPException(status_code=406, detail="client needs to accept application/json")
560558
with conn.cursor() as cur:
561-
rows2 = db_get_relevant_results2(cur, subject, scopeuuid, version, approved_only=False)
559+
rows2 = db_get_relevant_results2(cur, subject, scopeuuid, approved_only=False)
562560
return convert_result_rows_to_dict2(rows2, get_scopes(), include_report=True)
563561

564562

0 commit comments

Comments
 (0)