Skip to content

Commit 8e98082

Browse files
authored
chore(subscriptions): remove subscriptions functionality (#6358)
* chore(subscriptions): remove subscriptions functionality Remove unused environment variables and mocks * chore: revert package-lock.json * chore: revert package-lock.json to main * fix: remove fxa subscriptions url from config * fix: remove more unused vars from config
1 parent 74b164f commit 8e98082

File tree

7 files changed

+1
-330
lines changed

7 files changed

+1
-330
lines changed

.env

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ HIBP_NOTIFY_TOKEN=unsafe-default-token-for-dev
6262
# Domains we prefer to not link to
6363
HIBP_BREACH_DOMAIN_BLOCKLIST=a-blocked-domain.com,another-blocked-domain.org
6464

65-
# OneRep API for exposure scanning
66-
ONEREP_API_BASE=https://mozilla.api.onerep.com
67-
ONEREP_API_KEY=
68-
ONEREP_WEBHOOK_SECRET="unsafe-default-secret-for-dev"
69-
7065
# Firefox Remote Settings
7166
FX_REMOTE_SETTINGS_WRITER_SERVER=https://settings-writer.prod.mozaws.net/v1
7267
FX_REMOTE_SETTINGS_WRITER_USER=mock-user
@@ -75,72 +70,24 @@ FX_REMOTE_SETTINGS_WRITER_PASS=mock-password
7570
# DSN for Sentry error and event capturing
7671
# e.g., SENTRY_DSN=https://{key}@sentry.prod.mozaws.net/408
7772
SENTRY_DSN=
78-
SENTRY_DSN_LEGACY=
79-
80-
BREACH_RESOLUTION_ENABLED=1
81-
PRODUCT_PROMOS_ENABLED=1
82-
83-
# Experiment Flag
84-
EXPERIMENT_ACTIVE=0
8573

8674
REDIS_URL=redis://redis.mock
8775

8876
SUPPORTED_LOCALES=cs,cy,da,de,el,en,en-CA,en-GB,es-AR,es-CL,es-ES,es-MX,fi,fr,fy-NL,gn,hu,kab,ia,id,it,ja,ko,nl,nn-NO,pt-BR,pt-PT,ru,sk,sl,sq,sv-SE,th,tr,uk,vi,zh-CN,zh-TW
8977

90-
# Locales blocked from viewing Mozilla VPN promos. Use CSV without whitespace.
91-
VPN_PROMO_BLOCKED_LOCALES=zh-CN
92-
93-
# MaxMind GeoLite2 geolocation service used for VPN Banner
94-
# For Heroku deploys, the following 3 vars are generated automatically via Buildpack https://github.com/HiMamaInc/heroku-buildpack-geoip-geolite2
95-
# Staging and production environments will need variables set manually
96-
# Local environment uses a test database with limited data (preset here)
97-
GEOIP_GEOLITE2_PATH=./tests/mmdb/
98-
GEOIP_GEOLITE2_CITY_FILENAME=GeoLite2-City-Test.mmdb
99-
GEOIP_GEOLITE2_COUNTRY_FILENAME=GeoLite2-Country-Test.mmdb
100-
10178
# Educational video src urls, hosted by SRE team on a CDN
10279
EDUCATION_VIDEO_URL_RELAY=https://monitor.cdn.mozilla.net/videos/FF_Relay_version_02.mp4
10380
EDUCATION_VIDEO_URL_VPN=https://monitor.cdn.mozilla.net/videos/Mozilla_VPN.mp4
10481

10582
# Email addresses that are allowed to test and send emails
10683
ADMINS=
10784

108-
# Enable monthly cron-job, currently for sending unresolved breach reminder emails
109-
MONTHLY_CRON_ENABLED=
110-
11185
# Functional tests
11286
E2E_TEST_ENV=local
11387
E2E_TEST_SECRET=test-secret
11488
E2E_TEST_ACCOUNT_BASE_EMAIL=test-account
11589
E2E_TEST_ACCOUNT_BASE_PASSWORD=test-password
11690

117-
# Monitor Premium features
118-
# Link to start user on the subscription process. PREMIUM_ENABLED must be set to `true`.
119-
SUBSCRIPTION_BILLING_AMOUNT_MONTHLY_US=42.42
120-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_INDIVIDUAL_MONTHLY_US=424
121-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_MONTHLY_US=42
122-
123-
# SubPlat 2.0 URL, product and plan IDs, used for Plus subscriptions:
124-
FXA_SUBSCRIPTIONS_URL=https://accounts.stage.mozaws.net/subscriptions
125-
PREMIUM_PRODUCT_ID=prod_NErZh679W62lai
126-
PREMIUM_PLAN_ID_MONTHLY_US=price_1MUNq0Kb9q6OnNsL4BoJgepf
127-
PREMIUM_PLAN_ID_YEARLY_US=price_1NvqawKb9q6OnNsLRTnYrtrV
128-
129-
# SubPlat 3.0 URL and offering ID, used for Plus subscriptions:
130-
SUBPLAT_SUBSCRIPTIONS_URL=https://payments-next.stage.fxa.nonprod.webservices.mozgcp.net
131-
SUBPLAT_MONITOR_OFFERING_ID=monitorplusstage
132-
SUBPLAT_BUNDLE_OFFERING_ID=privacyprotectionplan/yearly
133-
SUBPLAT_BUNDLE_PRODUCT_ID=prod_SFb8iVuZIOPREe
134-
SUBPLAT_BUNDLE_PRICE_ID=price_1RMAopKb9q6OnNsLSGe1vLtt
135-
136-
# Mozilla privacy product URLs
137-
FIREFOX_RELAY_LANDING_URL=https://stage.fxprivaterelay.nonprod.cloudops.mozgcp.net
138-
MOZILLA_VPN_LANDING_URL=https://www-dev.allizom.org/products/vpn
139-
140-
MONTHLY_SUBSCRIBERS_QUOTA=
141-
MONTHLY_SCANS_QUOTA=
142-
STATS_TOKEN=
143-
14491
# GCP PubSub Project ID and subscription name
14592
GCP_PUBSUB_PROJECT_ID=your-project-name
14693
GCP_PUBSUB_TOPIC_NAME=hibp-breaches
@@ -150,21 +97,10 @@ GCP_PUBSUB_SUBSCRIPTION_NAME=hibp-cron
15097
NIMBUS_UUID_NAMESPACE=00000000-0000-0000-0000-000000000000
15198
NIMBUS_SIDECAR_URL=http://localhost:8001
15299

153-
# The maximum number of jobs that the email breach alert worker will process.
154-
EMAIL_BREACH_ALERT_MAX_MESSAGES = 10000
155-
156-
# The maximum number of scans and profiles allowed. May be used for alerts, and for redirecting to waitlist.
157-
MAX_MANUAL_SCANS=100
158-
MAX_INITIAL_SCANS=100
159-
MAX_PROFILES_ACTIVATED=100
160-
MAX_PROFILES_CREATED=100
161-
162100
# Used during CI to upload sourcemaps to Sentry.
163101
UPLOAD_SENTRY_SOURCEMAPS=false
164102
SENTRY_AUTH_TOKEN=
165103

166104
# Whether GA4 sends data or not. NOTE: must be set in build environment.
167105
NEXT_PUBLIC_GA4_DEBUG_MODE=true
168106

169-
# Data broker removal estimates data
170-
DATA_BROKER_REMOVAL_ESTIMATES_DATA=[]

.env.ci

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ HIBP_NOTIFY_TOKEN=unsafe-default-token-for-dev
6060
# Domains we prefer to not link to
6161
HIBP_BREACH_DOMAIN_BLOCKLIST=a-blocked-domain.com,another-blocked-domain.org
6262

63-
# OneRep API for exposure scanning
64-
ONEREP_API_BASE=https://mozilla.api.onerep.com
65-
ONEREP_API_KEY=
66-
ONEREP_WEBHOOK_SECRET="unsafe-default-secret-for-dev"
67-
6863
# Firefox Remote Settings
6964
FX_REMOTE_SETTINGS_WRITER_SERVER=https://settings-writer.prod.mozaws.net/v1
7065
FX_REMOTE_SETTINGS_WRITER_USER=
@@ -73,78 +68,21 @@ FX_REMOTE_SETTINGS_WRITER_PASS=
7368
# DSN for Sentry error and event capturing
7469
# e.g., SENTRY_DSN=https://{key}@sentry.prod.mozaws.net/408
7570
SENTRY_DSN=
76-
SENTRY_DSN_LEGACY=
77-
78-
BREACH_RESOLUTION_ENABLED=1
79-
PRODUCT_PROMOS_ENABLED=1
8071

81-
# Experiment Flag
82-
EXPERIMENT_ACTIVE=0
8372

8473
REDIS_URL=redis://redis.mock
8574

8675
SUPPORTED_LOCALES=cs,cy,da,de,el,en,en-CA,en-GB,es-AR,es-CL,es-ES,es-MX,fi,fr,fy-NL,gn,hu,kab,ia,id,it,ja,ko,nl,nn-NO,pt-BR,pt-PT,ru,sk,sl,sq,sv-SE,th,tr,uk,vi,zh-CN,zh-TW
8776

88-
# Locales blocked from viewing Mozilla VPN promos. Use CSV without whitespace.
89-
VPN_PROMO_BLOCKED_LOCALES=zh-CN
90-
91-
# MaxMind GeoLite2 geolocation service used for VPN Banner
92-
# For Heroku deploys, the following 3 vars are generated automatically via Buildpack https://github.com/HiMamaInc/heroku-buildpack-geoip-geolite2
93-
# Staging and production environments will need variables set manually
94-
# Local environment uses a test database with limited data (preset here)
95-
GEOIP_GEOLITE2_PATH=./tests/mmdb/
96-
GEOIP_GEOLITE2_CITY_FILENAME=GeoLite2-City-Test.mmdb
97-
GEOIP_GEOLITE2_COUNTRY_FILENAME=GeoLite2-Country-Test.mmdb
98-
99-
# Educational video src urls, hosted by SRE team on a CDN
100-
EDUCATION_VIDEO_URL_RELAY=https://monitor.cdn.mozilla.net/videos/FF_Relay_version_02.mp4
101-
EDUCATION_VIDEO_URL_VPN=https://monitor.cdn.mozilla.net/videos/Mozilla_VPN.mp4
102-
10377
# Email addresses that are allowed to test and send emails
10478
ADMINS=
10579

106-
# Enable monthly cron-job, currently for sending unresolved breach reminder emails
107-
MONTHLY_CRON_ENABLED=
108-
10980
# Functional tests
11081
E2E_TEST_ENV=ci # need to not be 'local' because of imports
11182
E2E_TEST_SECRET=test-secret
11283
E2E_TEST_ACCOUNT_BASE_EMAIL=test-account
11384
E2E_TEST_ACCOUNT_BASE_PASSWORD=test-password
11485

115-
# Monitor Premium features
116-
# Link to start user on the subscription process. PREMIUM_ENABLED must be set to `true`.
117-
SUBSCRIPTION_BILLING_AMOUNT_MONTHLY_US=42.42
118-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_INDIVIDUAL_MONTHLY_US=424
119-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_MONTHLY_US=42
120-
121-
# SubPlat 2.0 URL, product and plan IDs, used for Plus subscriptions:
122-
FXA_SUBSCRIPTIONS_URL=https://accounts.stage.mozaws.net/subscriptions
123-
PREMIUM_PRODUCT_ID=prod_NErZh679W62lai
124-
PREMIUM_PLAN_ID_MONTHLY_US=price_1MUNq0Kb9q6OnNsL4BoJgepf
125-
PREMIUM_PLAN_ID_YEARLY_US=price_1NvqawKb9q6OnNsLRTnYrtrV
126-
127-
# SubPlat 3.0 URL and offering ID, used for Plus subscriptions:
128-
SUBPLAT_SUBSCRIPTIONS_URL=https://payments-next.stage.fxa.nonprod.webservices.mozgcp.net
129-
SUBPLAT_MONITOR_OFFERING_ID=monitorplusstage
130-
SUBPLAT_BUNDLE_OFFERING_ID=privacyprotectionplan/yearly
131-
SUBPLAT_BUNDLE_PRODUCT_ID=prod_SFb8iVuZIOPREe
132-
SUBPLAT_BUNDLE_PRICE_ID=price_1RMAopKb9q6OnNsLSGe1vLtt
133-
134-
# Mozilla privacy product URLs
135-
FIREFOX_RELAY_LANDING_URL=https://stage.fxprivaterelay.nonprod.cloudops.mozgcp.net
136-
MOZILLA_VPN_LANDING_URL=https://www-dev.allizom.org/products/vpn
137-
138-
# This date is used to direct users who signed up after data broker scanning
139-
# was released to the welcome flow. Users who had signed up before and thus
140-
# have seen data breach results before, will be able to see their known breaches
141-
# first:
142-
BROKER_SCAN_RELEASE_DATE=2024-02-06
143-
144-
MONTHLY_SUBSCRIBERS_QUOTA=
145-
MONTHLY_SCANS_QUOTA=
146-
STATS_TOKEN=
147-
14886
# GCP PubSub Project ID and subscription name
14987
GCP_PUBSUB_PROJECT_ID=your-project-name
15088
GCP_PUBSUB_TOPIC_NAME=hibp-breaches
@@ -158,14 +96,6 @@ PUBSUB_EMULATOR_HOST="localhost:8085"
15896
NIMBUS_UUID_NAMESPACE=00000000-0000-0000-0000-000000000000
15997
NIMBUS_SIDECAR_URL=http://localhost:8001
16098

161-
# The maximum number of jobs that the email breach alert worker will process.
162-
EMAIL_BREACH_ALERT_MAX_MESSAGES = 10000
163-
164-
# The maximum number of scans and profiles allowed. May be used for alerts, and for redirecting to waitlist.
165-
MAX_MANUAL_SCANS=100
166-
MAX_INITIAL_SCANS=100
167-
MAX_PROFILES_ACTIVATED=100
168-
MAX_PROFILES_CREATED=100
16999

170100
# Used during CI to upload sourcemaps to Sentry.
171101
UPLOAD_SENTRY_SOURCEMAPS=false
@@ -175,6 +105,3 @@ SENTRY_AUTH_TOKEN=
175105
NEXT_PUBLIC_GA4_DEBUG_MODE=true
176106

177107
GA4_API_SECRET=unsafe-default-secret-for-dev
178-
179-
# Data broker removal estimates data
180-
DATA_BROKER_REMOVAL_ESTIMATES_DATA=[]

.env.local.example

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,16 @@ SMTP_URL=
77
HIBP_KANON_API_TOKEN=
88
HIBP_NOTIFY_TOKEN=
99

10-
# OneRep setup
11-
ONEREP_API_KEY=
12-
ONEREP_WEBHOOK_SECRET=
13-
1410
# Used for `npm run create-location-data`
1511
AWS_ACCESS_KEY_ID=
1612
AWS_SECRET_ACCESS_KEY=
1713

18-
19-
2014
## Settings you might want to customise
21-
2215
2316
DATABASE_URL="postgres://blurts:blurts@localhost:5432/blurts"
2417
REDIS_URL=redis://redis.mock
2518

26-
27-
2819
## Good defaults for a local setup:
29-
3020
APP_ENV=local
3121
SERVER_URL=http://localhost:6060
3222
PORT=6060
@@ -38,9 +28,6 @@ NEXTAUTH_SECRET=r7nKAKDWV0Bl53GHgQ/kA/EJCM2zvuH+8G3wZtwbXEA=
3828
EMAIL_FROM="Mozilla Monitor Stage <[email protected]>"
3929
# Whether GA4 sends data or not. NOTE: must be set in build environment.
4030
NEXT_PUBLIC_GA4_DEBUG_MODE=true
41-
SUBSCRIPTION_BILLING_AMOUNT_MONTHLY_US=42.42
42-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_INDIVIDUAL_MONTHLY_US=424
43-
SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_MONTHLY_US=42
4431

4532
# HIBP setup
4633
HIBP_KANON_API_ROOT=https://enterprise.stage-api.haveibeenpwned.com
@@ -49,33 +36,17 @@ HIBP_KANON_API_ROOT=https://enterprise.stage-api.haveibeenpwned.com
4936
SENTRY_DSN=https://[email protected]/4504612374052864
5037
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4504612374052864
5138

52-
# SubPlat 2.0 URL, product and plan IDs, used for Plus subscriptions:
53-
FXA_SUBSCRIPTIONS_URL=https://accounts.stage.mozaws.net/subscriptions
54-
PREMIUM_PRODUCT_ID=prod_NErZh679W62lai
55-
PREMIUM_PLAN_ID_MONTHLY_US=price_1MUNq0Kb9q6OnNsL4BoJgepf
56-
PREMIUM_PLAN_ID_YEARLY_US=price_1NvqawKb9q6OnNsLRTnYrtrV
57-
58-
# SubPlat 3.0 URL and offering ID, used for Plus subscriptions:
59-
SUBPLAT_SUBSCRIPTIONS_URL=https://payments-next.stage.fxa.nonprod.webservices.mozgcp.net
60-
SUBPLAT_MONITOR_OFFERING_ID=monitorplusstage
61-
SUBPLAT_BUNDLE_OFFERING_ID=privacyprotectionplan/yearly
62-
SUBPLAT_BUNDLE_PRODUCT_ID=prod_SFb8iVuZIOPREe
63-
SUBPLAT_BUNDLE_PRICE_ID=price_1RMAopKb9q6OnNsLSGe1vLtt
64-
6539
# Mozilla Accounts URLs
6640
FXA_SETTINGS_URL=https://accounts.stage.mozaws.net/settings
6741
OAUTH_CLIENT_ID=edd29a80019d61a1
42+
6843
# Set based on https://accounts.stage.mozaws.net/.well-known/openid-configuration
6944
OAUTH_AUTHORIZATION_URI=https://accounts.stage.mozaws.net/authorization
7045
OAUTH_METRICS_FLOW_URI=https://accounts.stage.mozaws.net/metrics-flow
7146
OAUTH_PROFILE_URI=https://profile.stage.mozaws.net/v1/profile
7247
OAUTH_TOKEN_URI=https://oauth.stage.mozaws.net/v1/token
7348
OAUTH_ACCOUNT_URI=https://oauth.stage.mozaws.net/v1
7449

75-
# Mozilla privacy product URLs
76-
FIREFOX_RELAY_LANDING_URL=https://stage.fxprivaterelay.nonprod.cloudops.mozgcp.net
77-
MOZILLA_VPN_LANDING_URL=https://www-dev.allizom.org/products/vpn
78-
7950
# Which environment to run end-to-end tests against:
8051
E2E_TEST_ENV=local
8152
E2E_TEST_SECRET=test-secret
@@ -86,9 +57,6 @@ E2E_TEST_ACCOUNT_BASE_PASSWORD=test-password
8657
AWS_REGION=us-east-1
8758
S3_BUCKET=firefoxmonitor-dev-monitor-cdn-dev-static-website
8859

89-
# Data broker removal estimates data
90-
DATA_BROKER_REMOVAL_ESTIMATES_DATA=[]
91-
9260
# GCP PubSub settings - see the PubSub heading in the README
9361
GCP_PUBSUB_PROJECT_ID=your-project-name
9462
GCP_PUBSUB_TOPIC_NAME=hibp-breaches

.github/workflows/functional_tests_pr.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ jobs:
8181
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
8282
OAUTH_ACCOUNT_URI: ${{ secrets.OAUTH_ACCOUNT_URI }}
8383
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET_LOCAL }}
84-
PREMIUM_PLAN_ID_MONTHLY_US: ${{ secrets.STAGE_PREMIUM_PLAN_ID_MONTHLY_US }}
85-
PREMIUM_PLAN_ID_YEARLY_US: ${{ secrets.STAGE_PREMIUM_PLAN_ID_YEARLY_US }}
86-
PREMIUM_PRODUCT_ID: ${{ secrets.STAGE_PREMIUM_PRODUCT_ID }}
8784
REDIS_URL: "redis://redis.mock"
8885
SENTRY_DSN: "Unused for the test run, but required to be present when loading env vars"
8986
EMAIL_FROM: "Unused for the test run, but required to be present when loading env vars"

src/app/functions/server/deleteAccount.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import { SubscriberRow } from "knex/types/tables";
66
import { logger } from "./logging";
77
import { deleteSubscriber } from "../../../db/tables/subscribers";
8-
import { deleteSubscription } from "../../../utils/fxa";
98
import { record } from "./glean";
109

1110
export async function deleteAccount(subscriber: SubscriberRow) {
@@ -18,21 +17,6 @@ export async function deleteAccount(subscriber: SubscriberRow) {
1817
monitorUserId: subscriber.id.toString(),
1918
},
2019
});
21-
// try to unsubscribe from subplat
22-
if (subscriber.fxa_access_token) {
23-
try {
24-
const isDeleted = await deleteSubscription(subscriber.fxa_access_token);
25-
logger.info("unsubscribe_from_subplat", {
26-
subscriber_id: subscriber.id,
27-
success: isDeleted,
28-
});
29-
} catch (ex) {
30-
logger.error("unsubscribe_from_subplat", {
31-
subscriber_id: subscriber.id,
32-
exception: ex,
33-
});
34-
}
35-
}
3620

3721
// delete user events only have keys. Keys point to empty objects
3822
await deleteSubscriber(subscriber);

src/config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const config = {
4141
oauthAccountUri: getEnvString("OAUTH_ACCOUNT_URI"),
4242
nextAuthSecret: getEnvString("NEXTAUTH_SECRET"),
4343
fxaSettingsUrl: getEnvString("FXA_SETTINGS_URL"),
44-
fxaSubscriptionsUrl: getEnvString("FXA_SUBSCRIPTIONS_URL"),
4544

4645
// If set to an empty string, emails will be logged instead of sent,
4746
// which is fine for local development:
@@ -64,19 +63,11 @@ export const config = {
6463

6564
s3Bucket: getEnvString("S3_BUCKET"),
6665

67-
firefoxRelayLandingUrl: getEnvString("FIREFOX_RELAY_LANDING_URL"),
68-
mozillaVpnLandingUrl: getEnvString("MOZILLA_VPN_LANDING_URL"),
69-
7066
deleteUnverifiedSubscribersTimer: getEnvInt(
7167
"DELETE_UNVERIFIED_SUBSCRIBERS_TIMER",
7268
{ fallbackValue: 24 * 60 * 60 },
7369
),
7470

75-
monthlyActivityFreeEmailBatchSize: getEnvInt(
76-
"MONTHLY_ACTIVITY_FREE_EMAIL_BATCH_SIZE",
77-
{ fallbackValue: 10 },
78-
),
79-
8071
nimbusUuidNamespace: getEnvString("NIMBUS_UUID_NAMESPACE"),
8172
nimbusSidecarUrl: getEnvString("NIMBUS_SIDECAR_URL"),
8273

0 commit comments

Comments
 (0)