#lizabog

1 messages · Page 1 of 1 (latest)

winged scrollBOT
rapid plinth
#

Hello, not quite clear on your question. Are these actual secret keys from other accounts that you are storing? (presumably from an OAuth flow?)

quasi cipher
#

yep from an auth flow

rapid plinth
#

And what issue is happening when you try to retrieve them?

quasi cipher
#

It's not finding them, i'm not even seeing a get request in the logs

rapid plinth
#

What isn't finding them? Are you making API requests and Stripe is returning something? Or is Stripe erroring and saying it can't find something?

quasi cipher
#

The stripe app, it's making an api call that's getting a 404 (even though when i send a curl request i get a 200, so i do know the secret is being saved), And i'm not seeing the failed request in the logs

rapid plinth
#

Can you send me the full response that you are getting?

#

And to be clear, a curl request with the same secret is working, but with some client library you are seeing a 404?

quasi cipher
#

the request is coming from the stripe app just a sec adding responses.

#

{
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such secret: '***_token'",
"request_log_url": "https://dashboard.stripe.com/acct_1HMbzqBuYbBGWEPr/test/logs/req_laxgbciFWQ0DAA?t=1686151805",
"type": "invalid_request_error"
}

Learn more about error codes and how to resolve them.

#

{
"id": "appsecret_5110LuiVx0ff6lNzz4p1CYdV2UYrnO",
"object": "apps.secret",
"created": 1686148719,
"expires_at": 1686166719,
"livemode": false,
"name": "****_token",
"scope": {
"type": "user",
"user": "usr_LmFtZY1NBXuaCg"
}

rapid plinth
#

Can you send me the code for the request that you are making? (with the secret key redacted)

#

Checking in to our logs to see what I can find.

quasi cipher
#

import Stripe from 'stripe';
import {
createHttpClient,
STRIPE_API_KEY,
} from '@stripe/ui-extension-sdk/http_client';

const stripe = new Stripe(STRIPE_API_KEY, {
httpClient: createHttpClient(),
apiVersion: '2022-11-15',
});
stripe.apps.secrets
.find({
scope: { type: 'user', user: userContext.id },
name: '****_token',
expand: ['payload'],
})

winged scrollBOT
rapid plinth
#

Thank you. And what are you doing when you see the 200? Is it the same call or a similar one?

quasi cipher
#

i'm sending the same call but when connected from the account in which i uploaded the app, or just doing a curl:
curl https://api.stripe.com/v1/apps/secrets/find
-u sk_test_
-d name=
_token
-d "scope[type]"=user
-d "scope.user"= usr_Jx8WIk0xEmvBAz
-G

rapid plinth
#

Thanks, and do you have the response from a successful request that you made this way?

#

Can be helpful to compare

quasi cipher
#

Yep sent it above
{ "id": "appsecret_5110LuiVx0ff6lNzz4p1CYdV2UYrnO", "object": "apps.secret", "created": 1686148719, "expires_at": 1686166719, "livemode": false, "name": "_token", "scope": { "type": "user", "user": "usr_LmFtZY1NBXuaCg" }

rapid plinth
#

gotcha, apologies for the mixup

quasi cipher
#

🙌

long nimbus
#

👋 stepping in here as Pompey needs to step away

#

Give me a moment to catch up

long nimbus
#

We are still looking into this. Unclear what exactly is going on.

quasi cipher
#

Thank you

rapid plinth
#

To clarify, is that same stripe.apps.secrets.find code working on one of your accounts but not the other?

#

And does that same curl request work across both accounts?

quasi cipher
#

yes exactly

rapid plinth
#

And you have set this secret for each user across the two accounts?

quasi cipher
#

yep

rapid plinth
#

I'm still having trouble looking up the successful request in our logs. Can you try printing out lastResponse.requestId on the object that you get back as the successful response?

quasi cipher
rapid plinth
#

We are still not having much luck, it looks like we will have to escalate this and get back to you. Can you write in to https://support.stripe.com/?contact=true and then DM me your email address?

#

It doesn't need to be too detailed of a description. Just your app code, the responses that you were getting and that you were talking to Pompey on Discord. I can fill in other details from this thread and escalate

winged scrollBOT
rapid plinth
quasi cipher
#

can you elaborate on "may actually not exist for usr_LmFtZY1NBXuaCg on acct_1HMbzqBuYbBGWEPr", is it possible it exists for another account? i'm still able to get it just fine even without setting it again, but not from the app

rapid plinth
#

Are you using the API keys from acct_1HMbzqBuYbBGWEPr when doing this? I do see logs of curl requests to get this but only from acct_1HJgaRCYdV2UYrnO so far

#

I do see that you set this secret for that user on acct_1HMbzqBuYbBGWEPr on 5/14 but that secret was also set to expire that day so as far as I can see there isn't a valid secret for that user on acct_1HMbzqBuYbBGWEPr specifically

#

Sorry to take a step back, these secrets exist per user per account. So at the moment it looks like this is a difference of the secret still existing and being valid on acct_1HJgaRCYdV2UYrnO but the secret that was set on acct_1HMbzqBuYbBGWEPr has expired and was not set again.

quasi cipher
#

We were under the impression the secrets exist per user per app

rapid plinth
#

So this call in your node code will look something like stripe.apps.secrets.create

quasi cipher
#

await stripe.apps.secrets.create({ scope: { type: constants.USER , user: userId }, name: constants.TOKEN, payload: token, expires_at: timeStampInFiveHours, });

rapid plinth
#

So in your logs I see a bunch of these create requests in the logs for the account that can look up these secret, for the account that cannot look up the secret I am not seeing any requests to create this secret recently

#

Have you checked in to your app's logic around when that create call is made? From here, it looks like on one account your app is creating new secrets when needed but on the other account for some reason this call is not being made. I think the next step would be for you to step through your code when running on acct_1HMbzqBuYbBGWEPr to see why this create call is not being called

quasi cipher
#

Thankyou🙌

rapid plinth
#

Of course! Thanks for your patience. Let us know if you run in to anything else