# Docker\_manager doesn't accept API keys

**URL:** <https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040>\
**Category:** Bug\
**Tags:** pr-welcome\
**Created:** [February 25, 2019, 3:58pm UTC](https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040 "2019-02-25T15:58:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanokwa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yanokwa/32/105083_2.png) [@yanokwa](https://meta.discourse.org/u/yanokwa)\
**Post date:** [February 25, 2019, 3:58pm UTC](https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040/1 "2019-02-25T15:58:04Z")

</div>

I’m trying to mimic the [upgradeAll call in the docker\_manager](https://github.com/discourse/docker_manager/blob/master/manager-client/app/models/repo.js#L126-L132) with the following command.

```plaintext
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](https://github.com/discourse/docker_manager/blob/master/app/controllers/docker_manager/application_controller.rb#L9-L13). I think this is probably a bug. If so, may I send in a PR to fix?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [February 26, 2019, 11:22am UTC](https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040/3 "2019-02-26T11:22:07Z")

</div>

> [@yanokwa](#):
>
> If so, may I send in a PR to fix?

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

---

<div class="post-metadata">

**Author:** ![yanokwa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yanokwa/32/105083_2.png) [@yanokwa](https://meta.discourse.org/u/yanokwa)\
**Post date:** [February 26, 2019, 6:42pm UTC](https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040/4 "2019-02-26T18:42:31Z")

</div>

[https://github.com/discourse/docker\_manager/pull/52](https://github.com/discourse/docker_manager/pull/52)

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

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [February 27, 2019, 9:01pm UTC](https://meta.discourse.org/t/docker-manager-doesnt-accept-api-keys/110040/5 "2019-02-27T21:01:36Z")

</div>

PR has been merged 🎉
