Skip to content
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

feat: Don't open browser auth if inside container #1645

Merged
merged 1 commit into from Feb 19, 2021
Merged

Conversation

hisenb3rg
Copy link
Contributor

@hisenb3rg hisenb3rg commented Feb 17, 2021

What does this PR do?

Allows running auth command when inside a docker container by:

  • not trying to open a browser via xdg open (breaks if not present or in container)
  • providing a better auth prompt/message
  • doubling the auth timeout period, so users have more time open browser
    manually

This makes it possible to use auth command via "docker scan" on soon to be released scan plugin for docker linux.

How should this be manually tested?

Run "snyk auth" inside a container.

What are the relevant tickets?

https://snyksec.atlassian.net/browse/DC-1077

@hisenb3rg hisenb3rg marked this pull request as ready for review February 17, 2021 16:52
@hisenb3rg hisenb3rg requested review from a team as code owners February 17, 2021 16:52
@snyk snyk deleted a comment from github-actions bot Feb 17, 2021
@@ -25,7 +26,7 @@ const debug = Debug('snyk-auth');
let attemptsLeft = 0;

function resetAttempts() {
attemptsLeft = 30;
attemptsLeft = isDocker() ? 60 : 30;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2021

Messages
📖 You are modifying something in test/smoke directory, yet you are not on the branch starting with smoke/. You can prefix your branch with smoke/ and Smoke tests will trigger for this PR.

Generated by 🚫 dangerJS against da53738

Allow running auth command when inside a docker container by:
* not trying to open a browser via xdg open (breaks if not present)
* providing a better auth prompt/message
* doubling the auth timeout period, so users have more time open browser
  manually
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2021

Expected release notes (by @jurglic)

features:
Don't open browser auth if inside container (da53738)

others (will not be included in Semantic-Release notes):
remove dev-release package publishing (b91a33f)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants