-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove metric and enforce token validation #151
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
|
authUser.account, | ||
authUser.id | ||
) | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of writing an if here, can't we write an else
on the if below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly, because if token.audience !== 'admin'
the metric would also be sent.
@@ -2,12 +2,12 @@ import { isUserPartOfBuyerOrg } from '../resolvers/Queries/Users' | |||
|
|||
export const validateAdminToken = async ( | |||
context: Context, | |||
adminUserAuthToken: string | |||
adminUserAuthToken: string, | |||
metricFields: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of providing an additional field here, can't we extract this info from context
? This should reduce the amount of changes on this PR and cognitive load while reading the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't get the operation
field through the context. I think this is relevant to the metric so we need to pass it somehow. Maybe we could only pass this field and build the rest using the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, in this case lets keep like this.
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
Remove metric and enforce new token validation. More info on: https://vtex-dev.atlassian.net/browse/B2BTEAM-1757