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(auth): add GDRIVE_NON_INTERACTIVE to avoid launching browser #324

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

shcheklein
Copy link
Member

Closes #319

Adds GDRIVE_NON_INTERACTIVE variable so that LocalWebserverAuth raises pydrive2.auth.AuthenticationError if it's called.

This is might be handy in any server side / automated environment where we can't really expect anyone interacting with a browser.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

No one will know about this env var, isatty seems more generally useful, but we do need both anyway.

@efiop efiop merged commit ea5c8f2 into main Dec 26, 2023
16 checks passed
@efiop efiop deleted the non-interactive-mode branch December 26, 2023 02:11
}
ga = GoogleAuth(settings=settings)

with MonkeyPatch.context() as m:
Copy link
Member

Choose a reason for hiding this comment

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

You can get rid of this, and add monkeypatch to the function parameter.

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

Successfully merging this pull request may close these issues.

auth: LocalWebserverAuth: fail if in non-interactive mode
3 participants