dockware
dockware copied to clipboard
Enable API / Set API Token via environment variable
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?
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
As we have this featur now for store-api access key we will also provide it for admin integration token asap
boostday work -> admin api key!!! same as storefront :)