-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
SKU credential (in VPN) should be cached indefinitely until redeemed or expired #29345
Comments
fix brave/brave-browser#29345 If we fail to get subs credential from guardian, we should keep skus credential till it's expired.
Set QA/NO because it seems very difficult to simulate subs credential fetching failure. |
Even blocklisting/routing to |
@stephendonner to simulate, we had to edit the code - so that the first call fails on purpose (ex: it goes to a bad URL). The second call then would work. We can't make |
@stephendonner @bsclifton Although it's difficult to test with official build, we can check there is no failure.
|
@stephendonner @bsclifton labelled as |
Moving this into |
This affects macOS, too, but a check on Windows should suffice, here. |
Verification
|
Brave | 1.50.110 Chromium: 112.0.5615.49 (Official Build) (64-bit) |
---|---|
Revision | bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936} |
OS | Windows 10 Version 22H2 (Build 19045.2788) |
Steps:
- installed
1.50.110
- launched Brave
- loaded
account.brave.software
(dev
, as a stopgap) - entered throwaway email from
temp-mail.org
to create new account - logged back in via link in email
- purchased
Brave VPN & Firewall
- confirmed I saw
You have active credentials loaded!
green banner/messaging - clicked on the
VPN
button in the browser toolbar - clicked to toggle to
Connected
- loaded
brave://local-state
- examined the value for
brave.vpn.subscriber_credentials
Confirmed via both brave://local-state
as well as general usage that Brave VPN
credentials are working as expected 👍
just-purchased state |
Connected |
brave://local-state |
---|---|---|
![]() |
![]() |
![]() |
Description
A pool of SKU credentials are issued for the client when they connect over account.brave.com. These credentials are each good for 24 hours (each having their own 24 hour time window) and have a boolean tracking them for if they're "spent".
The credentials are considered "spent" after they are presented. In the VPN code, that happens here:
https://github.com/brave/brave-core/blob/12648373743b58d164a00e0c2a4e00f76e2ab9cd/components/brave_vpn/browser/brave_vpn_service.cc#L719-L776
I believe we're missing a case for when Guardian VPN authorization fails for some reason (service outage, etc). When the credential is presented (above), we need to cache this (save to local state). We need to re-use that until:
OR
expires_at
(GMT) is reachedRight now, I believe we're not handling failure scenario for Guardian VPN API. This may not even be a problem with Guardian- the customer themselves may have an outage during the call. We then try to present the credential AGAIN - and there are no unspent credentials that meet the current time window.
brave_vpn.subscriber_credential
will haveskus_credential
value.When not failed,
brave_vpn.subscriber_credential
will havecredential
value.The text was updated successfully, but these errors were encountered: