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 basic auth support #99

Merged
merged 6 commits into from
Dec 31, 2018
Merged

Add basic auth support #99

merged 6 commits into from
Dec 31, 2018

Conversation

Pharb
Copy link
Member

@Pharb Pharb commented Dec 28, 2018

This adds support for request authentication as requested in #89 and #91 using https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired.

A small workaround was required to support Chrome, see mozilla/webextension-polyfill#91.

Some manual test cases:

  • Opening multiple basic auth sessions (e.g. with https://httpbin.org/basic-auth/user/password1, https://httpbin.org/basic-auth/user/password2) should only open a gopassbridge popup for the first auth request and the native browser auth dialog for any other auth requests, as long as another gopassbridge popup is still open. This is done to simplify the implementation.
  • Disabling the basic-auth setting in options should show the native browser auth dialog when disabled and switching back to gopassbridge for the next auth request when reenabled.
  • Closing the gopassbridge auth popup window without selecting any credentials should open the browser native auth dialog.
  • Selecting invalid credentials in gopassbridge should reopen a new gopassbridge popup window (this is the same behaviour as the native browser auth dialog)
  • Any errors in the native messaging between the popup and gopass should keep the popup open and show the error messages, until the window is either closed or some credentials are selected.

Copy link
Collaborator

@martinhoefling martinhoefling left a comment

Choose a reason for hiding this comment

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

Looks quite good in general to me. Some tests probably need to be written/adapted but it's far less complex than the passff implementation.

@martinhoefling
Copy link
Collaborator

Also tested the functionality with some basic auth dialogs on ffx and it works fine.

Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
@codecov
Copy link

codecov bot commented Dec 30, 2018

Codecov Report

Merging #99 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #99   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         469    526   +57     
  Branches       79     91   +12     
=====================================
+ Hits          469    526   +57
Impacted Files Coverage Δ
web-extension/generic.js 100% <100%> (ø) ⬆️
web-extension/gopassbridge.js 100% <100%> (ø) ⬆️
web-extension/create.js 100% <100%> (ø) ⬆️
web-extension/details.js 100% <100%> (ø) ⬆️
web-extension/background.js 100% <100%> (ø) ⬆️
web-extension/search.js 100% <100%> (ø) ⬆️
web-extension/popup.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0f0048...050acd6. Read the comment docs.

Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
@gopasspw gopasspw deleted a comment from codecov bot Dec 30, 2018
Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
Signed-off-by: Patrick Harböck <patrick.harboeck@tngtech.com>
@Pharb
Copy link
Member Author

Pharb commented Dec 31, 2018

I added the remaining tests, this PR should be complete now IMHO.

@martinhoefling When your review is done I think we can merge this to master.

@Pharb Pharb mentioned this pull request Dec 31, 2018
@Pharb Pharb added this to the 0.5 milestone Dec 31, 2018
Copy link
Collaborator

@martinhoefling martinhoefling left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

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.

None yet

2 participants