Skip to content

[ BUG ] Missing comma in _payload/_aspm.py causes implicit string concatenation breaking relay node kwargs #1461

@alhumaw

Description

@alhumaw

Describe the bug

The retrieve_relay_node_payload function in _payload/_aspm.py has a missing comma between "type" and "username" in a list literal at lines 799-800. Python silently concatenates adjacent string literals, producing "typeusername" as a single key instead of two separate keys. This means neither type nor username kwargs work for ASPM relay node retrieval operations.

To Reproduce

  1. Create an ASPM service class instance
  2. Call the relay node method passing type or username as kwargs:
from falconpy import ASPM

falcon = ASPM(client_id="ID", client_secret="SECRET")
result = falcon.retrieve_relay_node(
    type="relay",
    username="admin@example.com"
)
  1. Neither type nor username 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/_aspm.py lines 799-800:

# Current (broken) - implicit string concatenation
keys = ["...", "type"
        "username", "..."]

# This produces: [..., "typeusername", ...]

Expected behavior

Passing type or username 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.retrieve_relay_node(body={
    "type": "relay",
    "username": "admin@example.com"
})

Fix: add the missing comma in src/falconpy/_payload/_aspm.py line 799:

# Before
keys = ["...", "type"
        "username", "..."]
# After
keys = ["...", "type",
        "username", "..."]

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions