mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 01:04:00 -04:00
Merge pull request #2984 from GSA/remove-socketio
Remove Socket.IO dependencies and Socket infrastructure
This commit is contained in:
@@ -161,7 +161,7 @@
|
||||
"filename": "app/config.py",
|
||||
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
||||
"is_verified": false,
|
||||
"line_number": 119,
|
||||
"line_number": 118,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -634,5 +634,5 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2025-10-02T14:04:48Z"
|
||||
"generated_at": "2025-10-07T17:43:26Z"
|
||||
}
|
||||
|
||||
2
.github/workflows/deploy-demo.yml
vendored
2
.github/workflows/deploy-demo.yml
vendored
@@ -64,7 +64,6 @@ jobs:
|
||||
LOGIN_DOT_GOV_INITIAL_SIGNIN_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=NONCE&prompt=select_account&redirect_uri=https://notify-demo.app.cloud.gov/sign-in&response_type=code&scope=openid+email&state=STATE"
|
||||
LOGIN_DOT_GOV_CERTS_URL: "https://secure.login.gov/api/openid_connect/certs"
|
||||
API_PUBLIC_URL: ${{ secrets.API_PUBLIC_URL }}
|
||||
API_PUBLIC_WS_URL: ${{ secrets.API_PUBLIC_WS_URL }}
|
||||
with:
|
||||
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
@@ -90,7 +89,6 @@ jobs:
|
||||
--var LOGIN_DOT_GOV_CERTS_URL="$LOGIN_DOT_GOV_CERTS_URL"
|
||||
--var LOGIN_PEM="$LOGIN_PEM"
|
||||
--var API_PUBLIC_URL="$API_PUBLIC_URL"
|
||||
--var API_PUBLIC_WS_URL="$API_PUBLIC_WS_URL"
|
||||
--strategy rolling
|
||||
|
||||
- name: Deploy egress proxy
|
||||
|
||||
2
.github/workflows/deploy-prod.yml
vendored
2
.github/workflows/deploy-prod.yml
vendored
@@ -64,7 +64,6 @@ jobs:
|
||||
LOGIN_DOT_GOV_INITIAL_SIGNIN_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=NONCE&prompt=select_account&redirect_uri=https://beta.notify.gov/sign-in&response_type=code&scope=openid+email&state=STATE"
|
||||
LOGIN_DOT_GOV_CERTS_URL: "https://secure.login.gov/api/openid_connect/certs"
|
||||
API_PUBLIC_URL: ${{ secrets.API_PUBLIC_URL }}
|
||||
API_PUBLIC_WS_URL: ${{ secrets.API_PUBLIC_WS_URL }}
|
||||
with:
|
||||
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
@@ -90,7 +89,6 @@ jobs:
|
||||
--var LOGIN_DOT_GOV_CERTS_URL="$LOGIN_DOT_GOV_CERTS_URL"
|
||||
--var LOGIN_PEM="$LOGIN_PEM"
|
||||
--var API_PUBLIC_URL="$API_PUBLIC_URL"
|
||||
--var API_PUBLIC_WS_URL="$API_PUBLIC_WS_URL"
|
||||
--strategy rolling
|
||||
|
||||
- name: Deploy egress proxy
|
||||
|
||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -70,7 +70,6 @@ jobs:
|
||||
LOGIN_DOT_GOV_INITIAL_SIGNIN_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=NONCE&prompt=select_account&redirect_uri=https://notify-staging.app.cloud.gov/sign-in&response_type=code&scope=openid+email&state=STATE"
|
||||
LOGIN_DOT_GOV_CERTS_URL: "https://secure.login.gov/api/openid_connect/certs"
|
||||
API_PUBLIC_URL: ${{ secrets.API_PUBLIC_URL }}
|
||||
API_PUBLIC_WS_URL: ${{ secrets.API_PUBLIC_WS_URL }}
|
||||
with:
|
||||
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
@@ -96,7 +95,6 @@ jobs:
|
||||
--var LOGIN_DOT_GOV_CERTS_URL="$LOGIN_DOT_GOV_CERTS_URL"
|
||||
--var LOGIN_PEM="$LOGIN_PEM"
|
||||
--var API_PUBLIC_URL="$API_PUBLIC_URL"
|
||||
--var API_PUBLIC_WS_URL="$API_PUBLIC_WS_URL"
|
||||
--strategy rolling
|
||||
|
||||
|
||||
|
||||
@@ -143,7 +143,6 @@ navigation = {
|
||||
def _csp(config):
|
||||
asset_domain = config["ASSET_DOMAIN"]
|
||||
api_public_url = config["API_PUBLIC_URL"]
|
||||
api_public_ws_url = config["API_PUBLIC_WS_URL"]
|
||||
|
||||
return {
|
||||
"default-src": ["'self'", asset_domain],
|
||||
@@ -162,7 +161,6 @@ def _csp(config):
|
||||
"https://www.googletagmanager.com",
|
||||
"https://www.google-analytics.com",
|
||||
"https://dap.digitalgov.gov",
|
||||
"https://cdn.socket.io",
|
||||
],
|
||||
"connect-src": list(
|
||||
dict.fromkeys(
|
||||
@@ -171,7 +169,6 @@ def _csp(config):
|
||||
"https://gov-bam.nr-data.net",
|
||||
"https://www.google-analytics.com",
|
||||
f"{api_public_url}",
|
||||
f"{api_public_ws_url}",
|
||||
]
|
||||
)
|
||||
),
|
||||
@@ -193,16 +190,7 @@ def create_app(application):
|
||||
# @application.context_processor
|
||||
# def inject_feature_flags():
|
||||
# this is where feature flags can be easily added as a dictionary within context
|
||||
# feature_socket_enabled = application.config.get("FEATURE_SOCKET_ENABLED", True)
|
||||
|
||||
# current_app.logger.info(
|
||||
# f"FEATURE_SOCKET_ENABLED value in __init__.py coming \
|
||||
# from config is {application.config.get('FEATURE_SOCKET_ENABLED')} and \
|
||||
# the ending value is {feature_socket_enabled}"
|
||||
# )
|
||||
# return dict(
|
||||
# FEATURE_SOCKET_ENABLED=feature_socket_enabled,
|
||||
# )
|
||||
# feature_enabled = application.config.get("FEATURE_ENABLED", True)
|
||||
|
||||
@application.context_processor
|
||||
def inject_initial_signin_url():
|
||||
|
||||
@@ -13,7 +13,6 @@ class Config(object):
|
||||
NOTIFY_ENVIRONMENT = getenv("NOTIFY_ENVIRONMENT", "development")
|
||||
API_HOST_NAME = getenv("API_HOST_NAME", "localhost")
|
||||
API_PUBLIC_URL = getenv("API_PUBLIC_URL", "localhost")
|
||||
API_PUBLIC_WS_URL = getenv("API_PUBLIC_WS_URL", "localhost")
|
||||
|
||||
ADMIN_BASE_URL = getenv("ADMIN_BASE_URL", "http://localhost:6012")
|
||||
HEADER_COLOUR = "#81878b" # mix of dark-grey and mid-grey
|
||||
@@ -131,7 +130,6 @@ class Test(Development):
|
||||
ASSET_PATH = "https://static.example.com/"
|
||||
API_HOST_NAME = "http://you-forgot-to-mock-an-api-call-to"
|
||||
API_PUBLIC_URL = "http://you-forgot-to-mock-an-api-call-to"
|
||||
API_PUBLIC_WS_URL = "ws://you-forgot-to-mock-an-api-call-to"
|
||||
REDIS_URL = "redis://you-forgot-to-mock-a-redis-call-to"
|
||||
LOGO_CDN_DOMAIN = "static-logos.test.com"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
from functools import partial
|
||||
|
||||
from flask import (
|
||||
@@ -59,7 +58,6 @@ def view_job(service_id, job_id):
|
||||
|
||||
filter_args = parse_filter_args(request.args)
|
||||
filter_args["status"] = set_status_filters(filter_args)
|
||||
api_public_url = os.environ.get("API_PUBLIC_URL")
|
||||
|
||||
notifications = None
|
||||
more_than_one_page = False
|
||||
@@ -74,7 +72,6 @@ def view_job(service_id, job_id):
|
||||
|
||||
return render_template(
|
||||
"views/jobs/job.html",
|
||||
api_public_url=api_public_url,
|
||||
job=job,
|
||||
status=request.args.get("status", ""),
|
||||
counts=_get_job_counts(job),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{% if not job.finished_processing %}
|
||||
<p class="max-width-full">Status updates automatically while processing. Refresh the page if needed.</p>
|
||||
{% endif %}
|
||||
<div data-job-id="{{ job.id }}" data-job-finished="{{ 'true' if job.finished_processing else 'false' }}" data-host="{{ api_public_url }}">
|
||||
<div data-job-id="{{ job.id }}" data-job-finished="{{ 'true' if job.finished_processing else 'false'}}">
|
||||
<div class='tabs ajax-block-container' data-key="counts">
|
||||
{{ pill(counts, status, {'smaller': True}) }}
|
||||
</div>
|
||||
|
||||
@@ -8,4 +8,3 @@ redis_enabled: 1
|
||||
nr_agent_id: '1134302465'
|
||||
nr_app_id: '1083160688'
|
||||
API_PUBLIC_URL: https://notify-api-demo.app.cloud.gov
|
||||
API_PUBLIC_WS_URL: wss://notify-api-demo.app.cloud.gov
|
||||
|
||||
@@ -8,4 +8,3 @@ redis_enabled: 1
|
||||
nr_agent_id: '1050708682'
|
||||
nr_app_id: '1050708682'
|
||||
API_PUBLIC_URL: https://notify-api-production.app.cloud.gov
|
||||
API_PUBLIC_WS_URL: wss://notify-api-production.app.cloud.gov
|
||||
|
||||
@@ -8,4 +8,3 @@ redis_enabled: 1
|
||||
nr_agent_id: '1134291385'
|
||||
nr_app_id: '1031640326'
|
||||
API_PUBLIC_URL: https://notify-api-staging.app.cloud.gov
|
||||
API_PUBLIC_WS_URL: wss://notify-api-staging.app.cloud.gov
|
||||
|
||||
@@ -80,8 +80,7 @@ const javascripts = () => {
|
||||
paths.npm + 'query-command-supported/dist/queryCommandSupported.min.js',
|
||||
paths.npm + 'textarea-caret/index.js',
|
||||
paths.npm + 'cbor-js/cbor.js',
|
||||
paths.npm + 'd3/dist/d3.min.js',
|
||||
paths.npm + 'socket.io-client/dist/socket.io.min.js'
|
||||
paths.npm + 'd3/dist/d3.min.js'
|
||||
]);
|
||||
|
||||
// Concatenate all streams
|
||||
|
||||
@@ -63,4 +63,3 @@ applications:
|
||||
LOGIN_DOT_GOV_CERTS_URL: ((LOGIN_DOT_GOV_CERTS_URL))
|
||||
|
||||
API_PUBLIC_URL: ((API_PUBLIC_URL))
|
||||
API_PUBLIC_WS_URL: ((API_PUBLIC_WS_URL))
|
||||
|
||||
90
package-lock.json
generated
90
package-lock.json
generated
@@ -21,7 +21,6 @@
|
||||
"python": "^0.0.4",
|
||||
"query-command-supported": "1.0.0",
|
||||
"sass-embedded": "^1.93.2",
|
||||
"socket.io-client": "^4.8.1",
|
||||
"textarea-caret": "3.1.0",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-source-stream": "^2.0.0"
|
||||
@@ -3719,12 +3718,6 @@
|
||||
"@sinonjs/commons": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@socket.io/component-emitter": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",
|
||||
"integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tootallnate/quickjs-emscripten": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",
|
||||
@@ -6468,6 +6461,7 @@
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
|
||||
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
@@ -6806,49 +6800,6 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client": {
|
||||
"version": "6.6.3",
|
||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz",
|
||||
"integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-parser": "~5.2.1",
|
||||
"ws": "~8.17.1",
|
||||
"xmlhttprequest-ssl": "~2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client/node_modules/ws": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
|
||||
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-parser": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz",
|
||||
"integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
@@ -12584,7 +12535,8 @@
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mute-stdout": {
|
||||
"version": "2.0.0",
|
||||
@@ -14865,34 +14817,6 @@
|
||||
"npm": ">= 3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-client": {
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz",
|
||||
"integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.2",
|
||||
"engine.io-client": "~6.6.1",
|
||||
"socket.io-parser": "~4.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-parser": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz",
|
||||
"integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/socks": {
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz",
|
||||
@@ -16432,14 +16356,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/xmlhttprequest-ssl": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz",
|
||||
"integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
"python": "^0.0.4",
|
||||
"query-command-supported": "1.0.0",
|
||||
"sass-embedded": "^1.93.2",
|
||||
"socket.io-client": "^4.8.1",
|
||||
"textarea-caret": "3.1.0",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-source-stream": "^2.0.0"
|
||||
|
||||
@@ -20,8 +20,7 @@ def test_owasp_useful_headers_set(
|
||||
assert search(
|
||||
r"script-src 'self' static\.example\.com https:\/\/js-agent\.new"
|
||||
r"relic\.com https:\/\/gov-bam\.nr-data\.net https:\/\/www\.googletagmanager\."
|
||||
r"com https:\/\/www\.google-analytics\.com https:\/\/dap\.digitalgov\.gov "
|
||||
r"https:\/\/cdn\.socket\.io",
|
||||
r"com https:\/\/www\.google-analytics\.com https:\/\/dap\.digitalgov\.gov",
|
||||
csp,
|
||||
)
|
||||
assert search(r"'nonce-[^']+';", csp)
|
||||
@@ -42,7 +41,6 @@ def test_owasp_useful_headers_set(
|
||||
"https://gov-bam.nr-data.net",
|
||||
"https://www.google-analytics.com",
|
||||
config["API_PUBLIC_URL"],
|
||||
config["API_PUBLIC_WS_URL"],
|
||||
}
|
||||
actual_sources = set(connect_src.strip().split()[1:])
|
||||
assert (
|
||||
|
||||
Reference in New Issue
Block a user