shan-zeeshan786 commented on issue #65391:
URL: https://github.com/apache/airflow/issues/65391#issuecomment-4268621413
I understand your point @potiuk about 500 representing unexpected internal
errors, and I agree that misconfigured Fernet keys fall into that category and
should not normally happen in a properly managed deployment.
However, my concern here is more about API consistency and behavior across
endpoints, rather than strictly changing the HTTP status code.
Currently, there is an inconsistency in how the Variables API behaves:
1. The **List Variables API**
(/api/v2/variables) returns the variables successfully,
but with values as null when decryption fails.
2. The **Get Variable API**
(/api/v2/variables/{key}) returns a 500 Internal Server
Error for the same scenario.
Because both APIs are accessing the same underlying data and encountering
the same decryption issue, the difference in behavior makes the API
inconsistent and harder to handle from a client perspective.
The intention is to synchronize the APIs’ behavior by aligning the Get
Variable API with the List Variables API. Specifically, when decryption fails,
the API should return a response with value as Null:
**List api output:**
{
"total_entries": 1,
"variables": [
{
"description": "Testing variable use",
"key": "Testing",
"value": null
}
]
}
**Expected output:**
{
"description": "Testing variable use",
"key": "Testing",
"value": null
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]