Open MKlimentowicz opened 1 year ago
Ah @MKlimentowicz the --interactive
sadly doesn't work like that but we should fix it. The error you're getting is because --interactive
will prompt an input from the terminal itself which actions don't support.
There's a few things you can do to get around this:
STRIPE_API_KEY
environment variable, then you wouldn't need to log in or pass any flags--api-key
flag on every commandstripe config
command to modify the config file directly with the api key: https://stripe.com/docs/cli/config. This is the closest in spirit to the login flow since you'd be writing the same data to the same location that the login
command would be usingAny ideas on passing the --api-key in live mode? Just want to run some integ tests there on every deployment. Tried the above suggestions but doesn't work,
stripe listen --forward-to somelivesite/api/webhook
FATAL Error while authenticating with Stripe: Authorization failed, status=403, body={
"error": {
"message": "For security reasons, the Stripe CLI only permits the use of restricted keys when in live mode. To generate restricted keys for use in live mode, use the stripe login
command.",
"type": "invalid_request_error"
}
}
I guess meanwhile I'll stick with local testing
Thank you
@Cherchercher Have you managed to resolve this issue? It looks like you might need to use the --live flag to ensure that the listener identifies live endpoints correctly. You may find more details in the Stripe CLI documentation: StripeCLI
I want to forward stripe webhooks to a local address in my automated tests in a github action. Unfortunately the interactive login with api key does not work.
Issue
I get this error
Enter your API key: inappropriate ioctl for device
when I try to execute thisstripe login --interactive --api-key ${{ secrets.STRIPE_TEST_API_KEY }}
Expected Behavior
Successful login
Steps to reproduce
Docs: https://stripe.com/docs/stripe-cli#install (apt)
Traceback
Enter your API key: inappropriate ioctl for device
Environment
Github Actions - Linux - Ubuntu latest