brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.05k stars 2.23k forks source link

Have environment specific partitioning for cached credentials #38973

Open bsclifton opened 1 month ago

bsclifton commented 1 month ago

Description

This came up when looking at the root cause for https://github.com/brave/brave-browser/issues/36321

Basically, we have helper methods for caching a presented credential when working with VPN. This can help in case there's a service outage - we won't throw away unused credentials. https://github.com/brave/brave-core/blob/ee2745aaf2e53ee58b34a59453a45b0301eca2ce/components/brave_vpn/browser/brave_vpn_service_helper.h#L30-L44

However, we just store the last used credential without any environment context. It would be great to separate out and cache the credential on a per-environment basis. For example, if someone used Prod and got a credential but didn't use... then used staging and got a credential but didn't use. There should be two cached credentials; one in prod, one in staging. That is not possible today.

bsclifton commented 1 month ago

Related https://github.com/brave/brave-browser/issues/38883