Skip to content

making authentication failures 1000% better - #790

Merged
joshaber merged 21 commits into
masterfrom
dude-wheres-my-user
Jan 30, 2017
Merged

joshaber merged 21 commits into
masterfrom
dude-wheres-my-user

Conversation

@shiftkey

@shiftkey shiftkey commented Jan 12, 2017 •

Copy link
Copy Markdown
Member

Fixes #772
Fixes #828

  • ignore whatever you have setup for credentials, use GIT_ASKPASS even if no account setup
  • get a useful authentication error when no account or invalid credentials
  • fetch should return a more clear error
  • push should return a more clear error, and skip fetching if it fails
  • pull should return a more clear error
  • confirm repro for credential-osxkeychain is not a git command #772 displays an accurate error message

Comment thread app/src/lib/git/core.ts
'GIT_ASKPASS': getAskPassTrampolinePath(),
// supported since Git 2.3, this is used to ensure we never interactively prompt
// for credentials - even as a fallback
'GIT_TERMINAL_PROMPT': '0',

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member Author

As a first pass, this is the error message you'll see when you encounter any sort of authentication error when pushing or pulling:

@shiftkey

shiftkey commented Jan 25, 2017 •

Copy link
Copy Markdown
Member Author

So there should be two, more accurate errors now appearing whenever you fetch/push/pull. These are essentially the underlying Git messages, but as we're now controlling the entire auth process we can now do some better poking at messages.

You don't have the right credentials:

The remote isn't valid, or it doesn't respond like it's a remote repository:

@cheshire137 I have a theory that #772 is related to the account being added, but us not having a valid user token to send when making authenticated requests, but I haven't been able to understand how the app can get into that state. If we're all good, you shouldn't see an error here after this lands on the beta channel - but I think you're still going to see the "Authentication Failed" message for now.

@desktop/core I think there's some additional work here to do around getting the user to sign in when authentication fails. I've opened #851 and #852 to track things that may need to be in-scope for the beta...

@shiftkey

Copy link
Copy Markdown
Member Author

Ready for review 🦅

@shiftkey shiftkey changed the title [WIP] making authentication failures 1000% better making authentication failures 1000% better Jan 25, 2017
@joshaber joshaber self-assigned this Jan 26, 2017

@joshaber joshaber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👖

return gitStore.performFailableOperation(() => {
const setUpstream = branch.upstream ? false : true
return pushRepo(repository, user, remote.name, branch.name, setUpstream)
.then(() => this._refreshRepository(repository))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/lib/git/fetch.ts Outdated
successExitCodes: new Set([ 0 ]),
env: envForAuthentication(user),
expectedErrors: new Set([
GitError.HTTPSAuthenticationFailed,

This comment was marked as spam.

@joshaber
joshaber merged commit dd7a8e3 into master Jan 30, 2017
@joshaber
joshaber deleted the dude-wheres-my-user branch January 30, 2017 15:31
@zeke zeke mentioned this pull request Feb 3, 2017
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.

2 participants