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

Add support for fine-grained tokens (continued) #216

Merged
merged 7 commits into from
Oct 7, 2023

Conversation

Ondkloss
Copy link
Contributor

This is a continuation of PR #208 which addresses issue #205. Essentially:

  • Adds a new flag --token-fine (-f) to support the new token format

The changes from PR #208:

  • Keep backwards compatability by going back to --token for classic tokens
  • Allow file:// uri for --token-fine
  • Attempted to merge differences
  • Re-ran Black

Issues not addressed:

  • From Add support for fine-grained tokens #205:

    I propose to add a check of all needed rights at the beginning before starting the copy process. Otherwise, if a needed right is not given, errors occur only when the particular copy job starts (in my case copying hooks).

  • With the latest version which uses logging_subprocess on win32 it fails due to logger mostly being None, but this should be unrelated to the changes performed

froggleston and others added 5 commits March 22, 2023 14:53
Add flags and example for fine-grained tokens
# Conflicts:
#	README.rst
#	github_backup/github_backup.py
)
else:
repo_url = "https://{0}@{1}/{2}/{3}.git".format(
"oauth2:" + auth,
Copy link
Owner

Choose a reason for hiding this comment

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

Why not just return the auth with oauth2: on the prefix if its not a fine-grained token?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I will review the if and else token scenarios for simplification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has now been attempted resolved.

Extracted file reading of another if/elif scenario.
@josegonzalez josegonzalez merged commit d7ba570 into josegonzalez:master Oct 7, 2023
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.

3 participants