dockware icon indicating copy to clipboard operation
dockware copied to clipboard

Enable API / Set API Token via environment variable

Open Donderda opened this issue 3 years ago • 3 comments

I'm implementing a third party tool which uses shopware's admin-api. It would be nice if I could use dockware for automated API testing. Therefore, it would be a nice feature if I could configure the API Key for the admin user via docker-compose / environment variables.

Would this be possible?

Donderda avatar Jun 09 '21 07:06 Donderda

Hi

this is indeed a great idea

so 3 options here :)

a) we also have dockware used with cypress where we use the admin api to prepare things. this is done using the mode to fetch a token by authenticating with the default credentials. maybe this could help you to work independent from the token..but would obviously only work if you have a (temp) default installation of shopware https://github.com/mollie/Shopware6/blob/master/tests/Cypress/cypress/support/services/shopware/AdminAPIClient.js

b) could you try to inject a bootstrap script to update the token? im not quite sure where its stored and how to update it, but maybe you have a mysql script already? then you could run that script like this: https://docs.dockware.io/development/custom-images

c) if (b) did work, then could you send us the script, then I would add it to the official image, or you can do a PR if you want, but the script would be fine

thanks

boxblinkracer avatar Jun 09 '21 07:06 boxblinkracer

As we have this featur now for store-api access key we will also provide it for admin integration token asap

martinweinmayr avatar Apr 01 '22 13:04 martinweinmayr

boostday work -> admin api key!!! same as storefront :)

boxblinkracer avatar Sep 14 '22 13:09 boxblinkracer