Version: 0.6.3
Filter flag is silently ignored, returning unfiltered results
Description
The [--status] option on "iriusrisk countermeasure list" ] is accepted without error but has no effect.
All countermeasures are returned regardless of the value passed. The same issue affects --risk-level.
Root cause:
countermeasure_client.py line 37-56
The get_countermeasures() method accepts filter_expression as a parameter and logs it, but never uses it to populate the POST request body. The filter_body is hardcoded with empty arrays:
def get_countermeasures(self, project_id, page=0, size=20,
filter_expression=None): # ← received
if filter_expression:
self.logger.debug(f"Using filter expression: {filter_expression}") # ← logged
params = {'page': page, 'size': size}
filter_body = {
"filters": {
"all": {
"states": [], # ← BUG: always empty
"priorities": [], # ← BUG: always empty
...
}
}
}
# filter_expression is never parsed or applied to filter_body
result = self._make_request('POST', ..., json=filter_body)
The upstream layer ([countermeasure_repository.py line 318-348 correctly builds a string expression like 'state'='implemented' from the --status CLI flag, but the API client discards it.
The V2 API endpoint POST /projects/{id}/countermeasures/query expects filters as structured arrays in the JSON body ("states": ["implemented"]), not as a query string expression. The filter_expression string was never translated into that structure.
Version: 0.6.3
Filter flag is silently ignored, returning unfiltered results
Description
The [--status] option on "iriusrisk countermeasure list" ] is accepted without error but has no effect.
All countermeasures are returned regardless of the value passed. The same issue affects --risk-level.
Root cause:
countermeasure_client.py line 37-56
The
get_countermeasures()method acceptsfilter_expressionas a parameter and logs it, but never uses it to populate the POST request body. Thefilter_bodyis hardcoded with empty arrays:The upstream layer ([countermeasure_repository.py line 318-348 correctly builds a string expression like
'state'='implemented'from the--statusCLI flag, but the API client discards it.The V2 API endpoint
POST /projects/{id}/countermeasures/queryexpects filters as structured arrays in the JSON body ("states": ["implemented"]), not as a query string expression. Thefilter_expressionstring was never translated into that structure.