-
Notifications
You must be signed in to change notification settings - Fork 281
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
AuthBypassTokenDuration CLI Additions #2182
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
Please rebase when #2192 is merged 🙏 |
3b03fc9
to
0c6833b
Compare
@@ -226,6 +233,7 @@ export async function runDeploy( | |||
options: OxygenDeploymentOptions, | |||
): Promise<void> { | |||
const { | |||
authBypassTokenDuration: authBypassTokenDuration, |
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.
authBypassTokenDuration: authBypassTokenDuration, | |
authBypassTokenDuration, |
494ef9e
to
18b11a7
Compare
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.
Thanks! Let's wait for the others to review as well 🙏
description: | ||
'Specify the duration (in hours) up to 12 hours for the authentication bypass token. Defaults to `2`', | ||
required: false, | ||
dependsOn: ['auth-bypass-token'], |
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.
It might be useful to add an env
flag name to both auth-bypass-token and auth-bypass-token-duration so that devs can pass these values from env variables.
authBypassTokenDuration: '2', | ||
}; | ||
|
||
await runDeploy(params); |
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.
To get better errors:
await runDeploy(params); | |
await expect(runDeploy(params)).resolves.not.toThrow(); |
bc133cb
to
8f105df
Compare
8f105df
to
e1969ad
Compare
WHY are these changes introduced?
Issue: Issue
Added the
-auth-bypass-token-duration
flag in the Hydrogen CLI to allow developers to extend E2E tests via their auth-bypass-token.By default, tokens are valid for two hours. You can modify this duration by supplying the
--auth-bypass-token-duration
flag to thedeploy
command. The duration can be set to any whole number of hours from 1 to 12.npx shopify hydrogen deploy --auth-bypass-token --auth-bypass-token-duration=5 --token $SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN
Docs: https://github.com/Shopify/shopify-dev/pull/44952
WHAT is this pull request doing?
-auth-bypass-token-duration
flag in the Hydrogen CLI.HOW to test your changes?
I added the an auth-bypass-token-duration of 5 hours, which succeeded in deploying to Oxygen and the token expires 5 hours from when it was created.
Post-merge steps
Checklist