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

Read github credentials from git credential helper #131

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

anguslees
Copy link
Contributor

If no github_oauth is defined, try to read it from git credential fill.

Tested with git-credential-manager.

Note: we don't provide success/fail feedback currently, so expired tokens won't
be invalidated by us.

Fixes: #129

If no `github_oauth` is defined, try to read it from `git credential fill`.

Tested with git-credential-manager.

Note: we don't provide success/fail feedback currently, so expired tokens won't
be invalidated by us.

Fixes: Skydio#129
Copy link
Collaborator

@jerry-skydio jerry-skydio left a comment

Choose a reason for hiding this comment

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

thanks this is a good start. can you also help add notes on usage to the documentation?

@jerry-skydio jerry-skydio merged commit 1d2a5f0 into Skydio:main Dec 22, 2023
2 of 5 checks passed
@anguslees anguslees deleted the gus/revup/main/git-cred branch April 3, 2024 04:20
@anguslees anguslees mentioned this pull request Apr 3, 2024
args.github_oauth = await git_ctx.credential(
protocol="https",
host=args.github_url,
path=f"/{fork_info.owner}/{fork_info.name}.git",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The leading "/" here is incorrect btw, and fails for credential helpers that do naive string matching on URL path 😞. It should be just path=f"{fork_info.owner}/{fork_info.name}.git"

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's been working for me despite this but i guess there's some subtlety about which credential helpers are being used?

Copy link
Collaborator

Choose a reason for hiding this comment

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

jerry-skydio added a commit that referenced this pull request Apr 3, 2024
The slash is incorrect according to #131 (comment)

"The leading "/" here is incorrect btw, and fails for credential helpers
that do naive string matching on URL path 😞. It should be just
path=f"{fork_info.owner}/{fork_info.name}.git""
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.

feat: Store credentials over Git credential manager
2 participants