Docker_manager doesn't accept API keys

AI-generated summary

Docker Manager Doesn’t Accept API Keys

A user, yanokwa, attempted to use the upgradeAll API call from docker_manager using a curl command with an API key. However, the endpoint returned BAD CSRF, indicating API keys are not supported. Upon reviewing the code, yanokwa found that API keys are indeed not supported, which they believe is a bug. zogstrip agreed that supporting upgrades via API would be more consistent. yanokwa has submitted a pull request (#52) to address the issue.

I’m trying to mimic the upgradeAll call in the docker_manager with the following command.

curl -X POST "https://example.com/admin/docker/upgrade" \
 -H "Content-type: application/x-www-form-urlencoded" \
 -d "api_key=1234" \
 -d "api_username=system"
 -d "path=all" 

The endpoint returns: ['BAD CSRF']

In the code, it looks like API keys aren’t supported. I think this is probably a bug. If so, may I send in a PR to fix?

4 Likes

Sure, supporting upgrade via API would make it more consistent.

2 Likes

https://github.com/discourse/docker_manager/pull/52

No rush to merge. Whenever y’all have time!

6 Likes

PR has been merged :tada: