Describe the bug
The cspm_service_account_validate_payload function in _payload/_cspm_registration.py has a missing comma between "project_id" and "service_account_conditions" in a list literal at lines 220-221. Python silently concatenates adjacent string literals, producing "project_idservice_account_conditions" as a single key instead of two separate keys. This means neither project_id nor service_account_conditions kwargs work for GCP CSPM service account validation operations.
To Reproduce
- Create a CSPMRegistration service class instance
- Call the GCP service account validation method passing
project_id or service_account_conditions as kwargs:
from falconpy import CSPMRegistration
falcon = CSPMRegistration(client_id="ID", client_secret="SECRET")
result = falcon.validate_gcp_service_account(
project_id="my-gcp-project-123",
service_account_conditions=[{"feature": "cloud-security"}]
)
- Neither
project_id nor service_account_conditions appear in the request body sent to the API. The kwargs are silently ignored.
The root cause is a missing comma in src/falconpy/_payload/_cspm_registration.py lines 220-221:
# Current (broken) - implicit string concatenation
keys = ["...", "project_id"
"service_account_conditions", "..."]
# This produces: [..., "project_idservice_account_conditions", ...]
Expected behavior
Passing project_id or service_account_conditions as keyword arguments should include them in the JSON body sent to the API, consistent with the documented kwargs in the operation docstring.
Environment (please complete the following information):
- OS: All
- Python: All supported versions
- FalconPy: --
Additional context
Workaround: pass a pre-built body dict to bypass the payload builder:
result = falcon.validate_gcp_service_account(body={
"project_id": "my-gcp-project-123",
"service_account_conditions": [{"feature": "cloud-security"}]
})
Fix: add the missing comma in src/falconpy/_payload/_cspm_registration.py line 220:
# Before
keys = ["...", "project_id"
"service_account_conditions", "..."]
# After
keys = ["...", "project_id",
"service_account_conditions", "..."]
Describe the bug
The
cspm_service_account_validate_payloadfunction in_payload/_cspm_registration.pyhas a missing comma between"project_id"and"service_account_conditions"in a list literal at lines 220-221. Python silently concatenates adjacent string literals, producing"project_idservice_account_conditions"as a single key instead of two separate keys. This means neitherproject_idnorservice_account_conditionskwargs work for GCP CSPM service account validation operations.To Reproduce
project_idorservice_account_conditionsas kwargs:project_idnorservice_account_conditionsappear in the request body sent to the API. The kwargs are silently ignored.The root cause is a missing comma in
src/falconpy/_payload/_cspm_registration.pylines 220-221:Expected behavior
Passing
project_idorservice_account_conditionsas keyword arguments should include them in the JSON body sent to the API, consistent with the documented kwargs in the operation docstring.Environment (please complete the following information):
Additional context
Workaround: pass a pre-built body dict to bypass the payload builder:
Fix: add the missing comma in
src/falconpy/_payload/_cspm_registration.pyline 220: