redash
redash copied to clipboard
Unable to clear `AWS Secret Key`
Issue Summary
I can't delete the AWS Secret Key in the Amazon Athena data source credentials from the GUI.
This behavior becomes problematic when switching from an IAM user to an instance IAM role.
Also, making a request to the POST /api/data_sources/ endpoint didn't change the result, so I guessed that the backend needed to be fixed.
$ curl -XPOST -d '{
"id": 13,
"name": "service-logs",
"type": "athena",
"syntax": "sql",
"paused": 0,
"pause_reason": null,
"supports_auto_limit": false,
"options": {
"aws_access_key": "",
"aws_secret_key": "",
"region": "ap-northeast-1",
"s3_staging_dir": "s3://xxx",
"schema": "yyy"
},
"queue_name": "queries",
"scheduled_queue_name": "scheduled_queries",
"groups": {
"2": false
}
}' -H "Content-Type: application/json" -H "Authorization: xxx" "https://redash.example.com/api/data_sources/13"
I don't know if similar issues occur with other AWS data sources. (eg. Elasticsearch)
Steps to Reproduce
- Create new Amazon Athena Data Source with
AWS Secret Key. - Clear
AWS Secret Key, then save. - Open again, key will be restored.
Technical details:
- Redash Version: 10.1.0.b50633
- Browser/OS: Google Chrome 126.0.6478.127
- How did you install Redash: EKS
I don't know what to fix yet, but it may be necessary to set an empty string in options or enable operations to delete keys. I would like to create a PR. https://github.com/getredash/redash/blob/9b2f635692741396def5b78e0ba0d564a852de6f/redash/utils/configuration.py#L72-L83