#lionel_unexpected

1 messages ยท Page 1 of 1 (latest)

quartz kayakBOT
#

๐Ÿ‘‹ 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.

sterile prism
#

Hello

#

Taking a look

#

Do you have an example request after you used that login command?

lavish hatch
#

No as I stopped as soon as I see I was'nt using my key.
Do you want that I do a dummy command ?

sterile prism
#

Yeah can you test again

#

And then share the request ID?

lavish hatch
#

Hmm I just done a stripe trigger customer.subscription.deleted

#

and the last API request has this ID sub_1PDSdtFvrVE1j92WGWMvsol8

sterile prism
#

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

lavish hatch
#

๐Ÿค” 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?

sterile prism
#

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

lavish hatch
#

I believed this override for a certain amount of time...not just for one command.

sterile prism
lavish hatch
#

where do I put this "account ID" ...in $HOME/.config/stripe/config.toml ?

sterile prism
#

Let me check

lavish hatch
#

(I do not even know yet how to write this configuration file too ๐Ÿค” )

#

ok the file seems simple

sterile prism
#

Using --set

lavish hatch
#

yep I know ๐Ÿ™‚

#

how can I get the account ID and I do not know the matching key name in this file

sterile prism
#

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

lavish hatch
#

ok so no need to specify an account ID in the end?

sterile prism
#

No, sorry.

lavish hatch
#

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 ... ?

sterile prism
#

If you set this in the config then you don't need to put --api-key each time

lavish hatch
#

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...

sterile prism
#

Ah yeah

#

I do think you would need to set it on login if you logout

lavish hatch
#

so in fact, I have to login and set the config afterwards ?

sterile prism
#

Yes using this method

lavish hatch
#

so I logout. and the login give me

#

Now I will modify the configuration...

sterile prism
#

Yes

lavish hatch
#

but then it means that every time I will logout I should do that every time, it's not very practical

sterile prism
#

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.```

lavish hatch
#

ok but we cannot set up that for multiple projects...

#

but it's better than nothing I think

sterile prism
#

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

lavish hatch
#

maybe it should be ๐Ÿ˜›

sterile prism
#

Yeah I can file some feedback for that

lavish hatch
#

thanks for your time

sterile prism
#

Sure thing

lavish hatch
#

So !
I put the environment variables...
I did stripe login and ... the config file has an rk key ... ๐Ÿค”

sterile prism
#

What happens when you make your request though?

lavish hatch
#

โŒ› I struggle to find the used key ๐Ÿ‘€

sterile prism
#

Do you have a request ID?

lavish hatch
#

sub_1PDTNtFvrVE1j92WpLNbYKPM

sterile prism
#

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

lavish hatch
#

I already put STRIPE_DEVICE_NAME in my ZSH configuration

sterile prism
#

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

lavish hatch
#

yep it seems to show the most recent requests indeed ๐Ÿค”

#

even if the filter is not visible in the shown filters

sterile prism
#

Yeah I don't think we provide an explicit filter for that unfortunately

#

(That you can toggle)

lavish hatch
#

so we must trust blindfoldedly that the application shows us the good things ^^