#lionel_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1237048763458261053
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Taking a look
Do you have an example request after you used that login command?
No as I stopped as soon as I see I was'nt using my key.
Do you want that I do a dummy command ?
Hmm I just done a stripe trigger customer.subscription.deleted
and the last API request has this ID sub_1PDSdtFvrVE1j92WGWMvsol8
Hmm yeah I'm seeing the same thing. Okay one moment.
Ah
It is a one-off request basis
Not a config
So you don't run it on login
You would do stripe trigger customer.subscription.deleted --api-key sk_test_123
๐ค so it's the same for stripe listen ? It does not suffice to make stripe login --api-key ... we need to specify this parameter every time?
Yes see: https://docs.stripe.com/cli/api_keys
Ah wait you may be able to set it as an environment variable
Based on that
Ah also I think you may need to pass your account ID
I believed this override for a certain amount of time...not just for one command.
where do I put this "account ID" ...in $HOME/.config/stripe/config.toml ?
Let me check
(I do not even know yet how to write this configuration file too ๐ค )
ok the file seems simple
yep I know ๐
how can I get the account ID and I do not know the matching key name in this file
Okay apologies I made this really confusing
The easiest way to handle this is to do stripe config --list to see your current config
Then if you want to override globally you can do stripe config --set test_mode_api_key sk_test_123
I tested and that works fine
ok so no need to specify an account ID in the end?
No, sorry.
ok, will try
and if I put this in the config file, now I should probably logout and then I don't need to put --api-key each time or ... ?
If you set this in the config then you don't need to put --api-key each time
maybe I need to do it for login juste once ? (I logged out and use stripe login and it generated a new limited key)
wait, something is weird
hmm...stripe logout clears the config file ๐
I understand now why my key has been removed from the configuration...
so in fact, I have to login and set the config afterwards ?
Yes using this method
Yes
but then it means that every time I will logout I should do that every time, it's not very practical
Then the other option is to set the key at the OS-level, like in your ~/.bash_profile
That is what is referenced by https://docs.stripe.com/cli/api_keys with ```You can set two environment variables, which take precedence over all other values:
STRIPE_API_KEY: the API key to use for the CLI.```
ok but we cannot set up that for multiple projects...
but it's better than nothing I think
Yeah you would have to adjust it based on the login if you are using multiple accounts
It isn't really designed for that use-case
maybe it should be ๐
Yeah I can file some feedback for that
thanks for your time
Sure thing
So !
I put the environment variables...
I did stripe login and ... the config file has an rk key ... ๐ค
What happens when you make your request though?
โ I struggle to find the used key ๐
Do you have a request ID?
sub_1PDTNtFvrVE1j92WpLNbYKPM
That did use your secret key
To delete the Sub
Not sure if you will be able to see this, but you could also override the Source (which you can see) and that would be indicative that your secret key was used
That would be via STRIPE_DEVICE_NAME
I already put STRIPE_DEVICE_NAME in my ZSH configuration
Ah actually, you can see the requests made by that key if you go to API Keys in your Dashboard and click on the three dots
Then you can filter requests by that key
yep it seems to show the most recent requests indeed ๐ค
even if the filter is not visible in the shown filters
Yeah I don't think we provide an explicit filter for that unfortunately
(That you can toggle)
so we must trust blindfoldedly that the application shows us the good things ^^