feat(ui): add new findings table (#9699)

This commit is contained in:
Alejandro Bailo
2026-01-12 15:44:25 +01:00
committed by GitHub
parent 0472eb74d2
commit d38be934a3
55 changed files with 2121 additions and 913 deletions
+4
View File
@@ -143,8 +143,12 @@ class BaseScanProviderFilter(FilterSet):
class CommonFindingFilters(FilterSet):
# We filter providers from the scan in findings
# Both 'provider' and 'provider_id' parameters are supported for API consistency
# Frontend uses 'provider_id' uniformly across all endpoints
provider = UUIDFilter(field_name="scan__provider__id", lookup_expr="exact")
provider__in = UUIDInFilter(field_name="scan__provider__id", lookup_expr="in")
provider_id = UUIDFilter(field_name="scan__provider__id", lookup_expr="exact")
provider_id__in = UUIDInFilter(field_name="scan__provider__id", lookup_expr="in")
provider_type = ChoiceFilter(
choices=Provider.ProviderChoices.choices, field_name="scan__provider__provider"
)
+308 -73
View File
@@ -879,12 +879,28 @@ paths:
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_id]
schema:
type: string
format: uuid
- in: query
name: filter[provider_id__in]
schema:
type: array
items:
type: string
format: uuid
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -894,7 +910,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -912,8 +927,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -923,7 +939,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -1436,12 +1451,28 @@ paths:
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_id]
schema:
type: string
format: uuid
- in: query
name: filter[provider_id__in]
schema:
type: array
items:
type: string
format: uuid
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -1451,7 +1482,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -1469,8 +1499,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -1480,7 +1511,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -1901,12 +1931,28 @@ paths:
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_id]
schema:
type: string
format: uuid
- in: query
name: filter[provider_id__in]
schema:
type: array
items:
type: string
format: uuid
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -1916,7 +1962,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -1934,8 +1979,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -1945,7 +1991,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -2364,12 +2409,28 @@ paths:
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_id]
schema:
type: string
format: uuid
- in: query
name: filter[provider_id__in]
schema:
type: array
items:
type: string
format: uuid
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -2379,7 +2440,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -2397,8 +2457,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -2408,7 +2469,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -2815,12 +2875,28 @@ paths:
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_id]
schema:
type: string
format: uuid
- in: query
name: filter[provider_id__in]
schema:
type: array
items:
type: string
format: uuid
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -2830,7 +2906,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -2848,8 +2923,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -2859,7 +2935,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -4627,8 +4702,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -4648,14 +4724,16 @@ paths:
* `mongodbatlas` - MongoDB Atlas
* `iac` - IaC
* `oraclecloud` - Oracle Cloud Infrastructure
* `alibabacloud` - Alibaba Cloud
- in: query
name: filter[provider_type__in]
schema:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -4677,6 +4755,7 @@ paths:
* `mongodbatlas` - MongoDB Atlas
* `iac` - IaC
* `oraclecloud` - Oracle Cloud Infrastructure
* `alibabacloud` - Alibaba Cloud
explode: false
style: form
- name: filter[search]
@@ -4782,8 +4861,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -4803,14 +4883,16 @@ paths:
* `mongodbatlas` - MongoDB Atlas
* `iac` - IaC
* `oraclecloud` - Oracle Cloud Infrastructure
* `alibabacloud` - Alibaba Cloud
- in: query
name: filter[provider_type__in]
schema:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -4832,6 +4914,7 @@ paths:
* `mongodbatlas` - MongoDB Atlas
* `iac` - IaC
* `oraclecloud` - Oracle Cloud Infrastructure
* `alibabacloud` - Alibaba Cloud
explode: false
style: form
- name: filter[search]
@@ -4992,8 +5075,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5003,7 +5087,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -5021,8 +5104,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5032,7 +5116,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -5185,8 +5268,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5196,7 +5280,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -5214,8 +5297,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5225,7 +5309,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -5374,6 +5457,7 @@ paths:
schema:
type: string
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5383,7 +5467,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -5402,6 +5485,7 @@ paths:
items:
type: string
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5411,7 +5495,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -5600,8 +5683,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5611,7 +5695,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -5629,8 +5712,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5640,7 +5724,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -5776,8 +5859,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5787,7 +5871,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -5805,8 +5888,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -5816,7 +5900,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -6599,8 +6682,9 @@ paths:
name: filter[provider]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -6610,7 +6694,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -6628,8 +6711,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -6639,7 +6723,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -6659,8 +6742,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -6670,7 +6754,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -6688,8 +6771,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -6699,7 +6783,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -7313,8 +7396,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -7324,7 +7408,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -7342,8 +7425,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -7353,7 +7437,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -7700,8 +7783,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -7711,7 +7795,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -7729,8 +7812,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -7740,7 +7824,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -7982,8 +8065,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -7993,7 +8077,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -8011,8 +8094,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -8022,7 +8106,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -8270,8 +8353,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -8281,7 +8365,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -8299,8 +8382,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -8310,7 +8394,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -9121,8 +9204,9 @@ paths:
name: filter[provider_type]
schema:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -9132,7 +9216,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
* `aws` - AWS
* `azure` - Azure
@@ -9150,8 +9233,9 @@ paths:
type: array
items:
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
enum:
- alibabacloud
- aws
- azure
- gcp
@@ -9161,7 +9245,6 @@ paths:
- m365
- mongodbatlas
- oraclecloud
- alibabacloud
description: |-
Multiple values may be separated by commas.
@@ -15717,6 +15800,44 @@ components:
required:
- atlas_public_key
- atlas_private_key
- type: object
title: Alibaba Cloud Static Credentials
properties:
access_key_id:
type: string
description: The Alibaba Cloud access key ID for authentication.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret for authentication.
security_token:
type: string
description: The STS security token for temporary credentials
(optional).
required:
- access_key_id
- access_key_secret
- type: object
title: Alibaba Cloud RAM Role Assumption
properties:
role_arn:
type: string
description: The ARN of the RAM role to assume (e.g., acs:ram::1234567890123456:role/ProwlerRole).
access_key_id:
type: string
description: The Alibaba Cloud access key ID of the RAM user
that will assume the role.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret of the RAM
user that will assume the role.
role_session_name:
type: string
description: An identifier for the role session (optional,
defaults to 'ProwlerSession').
required:
- role_arn
- access_key_id
- access_key_secret
writeOnly: true
required:
- secret
@@ -16727,7 +16848,7 @@ components:
* `iac` - IaC
* `oraclecloud` - Oracle Cloud Infrastructure
* `alibabacloud` - Alibaba Cloud
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
uid:
type: string
title: Unique identifier for the provider, set by the provider
@@ -16844,7 +16965,7 @@ components:
- oraclecloud
- alibabacloud
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
description: |-
Type of provider to create.
@@ -16906,7 +17027,7 @@ components:
- oraclecloud
- alibabacloud
type: string
x-spec-enum-id: eca8c51e6bd28935
x-spec-enum-id: 684bf4173d2b754f
description: |-
Type of provider to create.
@@ -17682,6 +17803,44 @@ components:
required:
- atlas_public_key
- atlas_private_key
- type: object
title: Alibaba Cloud Static Credentials
properties:
access_key_id:
type: string
description: The Alibaba Cloud access key ID for authentication.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret for authentication.
security_token:
type: string
description: The STS security token for temporary credentials
(optional).
required:
- access_key_id
- access_key_secret
- type: object
title: Alibaba Cloud RAM Role Assumption
properties:
role_arn:
type: string
description: The ARN of the RAM role to assume (e.g., acs:ram::1234567890123456:role/ProwlerRole).
access_key_id:
type: string
description: The Alibaba Cloud access key ID of the RAM user that
will assume the role.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret of the RAM user
that will assume the role.
role_session_name:
type: string
description: An identifier for the role session (optional, defaults
to 'ProwlerSession').
required:
- role_arn
- access_key_id
- access_key_secret
writeOnly: true
required:
- secret_type
@@ -18007,6 +18166,44 @@ components:
required:
- atlas_public_key
- atlas_private_key
- type: object
title: Alibaba Cloud Static Credentials
properties:
access_key_id:
type: string
description: The Alibaba Cloud access key ID for authentication.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret for authentication.
security_token:
type: string
description: The STS security token for temporary credentials
(optional).
required:
- access_key_id
- access_key_secret
- type: object
title: Alibaba Cloud RAM Role Assumption
properties:
role_arn:
type: string
description: The ARN of the RAM role to assume (e.g., acs:ram::1234567890123456:role/ProwlerRole).
access_key_id:
type: string
description: The Alibaba Cloud access key ID of the RAM user
that will assume the role.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret of the RAM
user that will assume the role.
role_session_name:
type: string
description: An identifier for the role session (optional,
defaults to 'ProwlerSession').
required:
- role_arn
- access_key_id
- access_key_secret
writeOnly: true
required:
- secret_type
@@ -18346,6 +18543,44 @@ components:
required:
- atlas_public_key
- atlas_private_key
- type: object
title: Alibaba Cloud Static Credentials
properties:
access_key_id:
type: string
description: The Alibaba Cloud access key ID for authentication.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret for authentication.
security_token:
type: string
description: The STS security token for temporary credentials
(optional).
required:
- access_key_id
- access_key_secret
- type: object
title: Alibaba Cloud RAM Role Assumption
properties:
role_arn:
type: string
description: The ARN of the RAM role to assume (e.g., acs:ram::1234567890123456:role/ProwlerRole).
access_key_id:
type: string
description: The Alibaba Cloud access key ID of the RAM user that
will assume the role.
access_key_secret:
type: string
description: The Alibaba Cloud access key secret of the RAM user
that will assume the role.
role_session_name:
type: string
description: An identifier for the role session (optional, defaults
to 'ProwlerSession').
required:
- role_arn
- access_key_id
- access_key_secret
writeOnly: true
required:
- secret
+53
View File
@@ -4110,6 +4110,37 @@ class TestFindingViewSet:
assert response.status_code == status.HTTP_200_OK
assert len(response.json()["data"]) == 2
def test_finding_filter_by_provider_id_alias(
self, authenticated_client, findings_fixture
):
"""Test that provider_id filter alias works identically to provider filter."""
response = authenticated_client.get(
reverse("finding-list"),
{
"filter[provider_id]": findings_fixture[0].scan.provider.id,
"filter[inserted_at]": TODAY,
},
)
assert response.status_code == status.HTTP_200_OK
assert len(response.json()["data"]) == 2
def test_finding_filter_by_provider_id_in_alias(
self, authenticated_client, findings_fixture
):
"""Test that provider_id__in filter alias works identically to provider__in filter."""
response = authenticated_client.get(
reverse("finding-list"),
{
"filter[provider_id__in]": [
findings_fixture[0].scan.provider.id,
findings_fixture[1].scan.provider.id,
],
"filter[inserted_at]": TODAY,
},
)
assert response.status_code == status.HTTP_200_OK
assert len(response.json()["data"]) == 2
@pytest.mark.parametrize(
"filter_name",
(
@@ -4331,6 +4362,28 @@ class TestFindingViewSet:
== latest_scan_finding.status
)
def test_findings_latest_filter_by_provider_id_alias(
self, authenticated_client, latest_scan_finding
):
"""Test that provider_id filter alias works on latest findings endpoint."""
response = authenticated_client.get(
reverse("finding-latest"),
{"filter[provider_id]": latest_scan_finding.scan.provider.id},
)
assert response.status_code == status.HTTP_200_OK
assert len(response.json()["data"]) == 1
def test_findings_latest_filter_by_provider_id_in_alias(
self, authenticated_client, latest_scan_finding
):
"""Test that provider_id__in filter alias works on latest findings endpoint."""
response = authenticated_client.get(
reverse("finding-latest"),
{"filter[provider_id__in]": str(latest_scan_finding.scan.provider.id)},
)
assert response.status_code == status.HTTP_200_OK
assert len(response.json()["data"]) == 1
def test_findings_metadata_latest(self, authenticated_client, latest_scan_finding):
response = authenticated_client.get(
reverse("finding-metadata_latest"),