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

VPN Domain exclusions (internal release) #3045

Merged
merged 56 commits into from
Aug 5, 2024
Merged

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Jul 30, 2024

Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

BSK PR: duckduckgo/BrowserServicesKit#918
iOS PR: duckduckgo/iOS#3164

Description

Implements domain exclusions for internal users only.

Testing

The tests were ordered in a way to try and make it easy to run them sequentially.

Make sure external users can't access domain exclusions

  1. If you're logged in as an internal user go to Debug Menu > Remove Internal User State.
  2. Open duckduckgo.com (or any other site)
  3. Open the in-app VPN status view and ensure there's no domain exclusions section.
  4. Connect the VPN.
  5. Repeat the check in step 3.

Make sure internal users can access domain exclusions through the in-app status view

  1. Login as an internal user at https://use-login.duckduckgo.com.
  2. Open duckduckgo.com and search for "What is my ip". Ensure you see your public IP.
  3. Make sure the VPN is stopped.
  4. Open the in-app VPN status view and ensure there's no domain exclusions section.
  5. Connect the VPN.
  6. Refresh the page and ensure you see the VPN IP address.
  7. Open the in-app VPN status view and ensure you see the domain exclusions section.
  8. Exclude the site, the VPN will briefly reconnect.
  9. Refresh the page and ensure you see the public IP address again.
  10. Repeat the process and check the IP is always properly reflected.

Make sure internal users can access domain exclusions through settings

  1. You can do similar steps in the previous tests, but checking also that Settings > VPN > Domain Exclusions properly shows and hides the domain exclusion section based on whether you're an internal user or not.
  2. Also check that adding a domain or removing a domain properly updates the exclusion (check for your IP in the site).

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

import NetworkProtectionProxy

protocol ExcludedDomainsViewModel {
var domains: [String] { get }
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can use a Set for this instead of an Array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered that - the issue is that the underlying data in VPNSettings is an Array as we can't store a Set. I'm not sure this will work well if we change the structure.

Will explore in follow-up work if you don't mind since it's a detail.

Comment on lines +102 to +105
AddExcludedDomainView(title: "Add Website Exclusion", buttonsState: .compressed, cancelActionTitle: "Cancel", cancelAction: { dismiss in

dismiss()
}, defaultActionTitle: "Add Website") { [weak self] domain, dismiss in
Copy link
Member

Choose a reason for hiding this comment

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

Missing localizations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK we're currently not localizing the VPN. I'll leave as-is but if this is wrong, let me know and we can follow-up.

Copy link
Member

@quanganhdo quanganhdo left a comment

Choose a reason for hiding this comment

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

Testing steps work well, thanks for the detailed instruction. I'm still going through this, will add more comments later.

I think moving the refactoring into a separate PR would've made this more focused and easier to follow (e.g. the VPNUIActionHandler extraction, simplification of the popover initializer, update to the debug info view, etc)

Copy link
Member

Choose a reason for hiding this comment

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

Not in the scope of this PR, but we should probably adopt similar domain processing logic from FireproofDomains

Copy link
Member

@quanganhdo quanganhdo left a comment

Choose a reason for hiding this comment

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

No blockers, mostly nits. Let's get this in internal users' hands 🙌

diegoreymendez added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Aug 5, 2024
Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

iOS PR: duckduckgo/iOS#3164
macOS PR: duckduckgo/macos-browser#3045

What kind of version bump will this require?: Patch

## Description

Adds BSK support for implements domain exclusions in macOS for internal
users only.
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Aug 5, 2024
… iOS. (#3164)

Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

BSK PR: duckduckgo/BrowserServicesKit#918
macOS PR: duckduckgo/macos-browser#3045

## Description

Integrates latest macOS BSK changes for supporting domain exclusions.
@diegoreymendez diegoreymendez merged commit 879b969 into main Aug 5, 2024
18 checks passed
@diegoreymendez diegoreymendez deleted the diego/exclude-domains branch August 5, 2024 21:57
diegoreymendez added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Aug 6, 2024
Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

iOS PR: duckduckgo/iOS#3164
macOS PR: duckduckgo/macos-browser#3045

What kind of version bump will this require?: Patch

## Description

Adds BSK support for implements domain exclusions in macOS for internal
users only.
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Aug 6, 2024
… iOS. (#3164)

Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

BSK PR: duckduckgo/BrowserServicesKit#918
macOS PR: duckduckgo/macos-browser#3045

## Description

Integrates latest macOS BSK changes for supporting domain exclusions.
diegoreymendez added a commit that referenced this pull request Aug 6, 2024
Task/Issue URL: https://app.asana.com/0/0/1207936340790549/f

BSK PR: duckduckgo/BrowserServicesKit#918
iOS PR: duckduckgo/iOS#3164

## Description

Implements domain exclusions for internal users only.
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