From 3dd74c2448e6d1637c631328eef623f98a5f483c Mon Sep 17 00:00:00 2001 From: James Demery Date: Mon, 16 Nov 2026 11:12:52 -0500 Subject: [PATCH 1/2] BB2-5374: Ensure mock relationships data is available when running locally --- apps/mymedicare_cb/authorization.py | 1 + docker-compose/bluebutton_server_start.sh | 1 + docker-compose/msls-env-vars.env | 1 + .../bb-api/files/external/.env.container | 1 + .../external/prepare-environment-support.bash | 1 + ops/containers/mslsx/app.py | 56 +++++++++++++++++++ .../selenium/utility-functions.bash | 3 + 7 files changed, 64 insertions(+) diff --git a/apps/mymedicare_cb/authorization.py b/apps/mymedicare_cb/authorization.py index 50aadf745..1a82b152f 100644 --- a/apps/mymedicare_cb/authorization.py +++ b/apps/mymedicare_cb/authorization.py @@ -420,6 +420,7 @@ def retrieve_relationships_data(self, request) -> List[Dict[str, Any]]: allow_redirects=False, verify=self.verify_ssl_internal, ) + print('show me the response: ', response) log_dict = {'type': 'Authentication:relationships_retrieval', 'response_code': response.status_code} logger.info(log_dict) diff --git a/docker-compose/bluebutton_server_start.sh b/docker-compose/bluebutton_server_start.sh index c040fd4c0..1305bb395 100755 --- a/docker-compose/bluebutton_server_start.sh +++ b/docker-compose/bluebutton_server_start.sh @@ -26,6 +26,7 @@ else DJANGO_SLSX_TOKEN_ENDPOINT=${DJANGO_SLSX_TOKEN_ENDPOINT:-"https://test.medicare.gov/sso/session"} DJANGO_SLSX_SIGNOUT_ENDPOINT=${DJANGO_SLSX_SIGNOUT_ENDPOINT:-"https://test.medicare.gov/sso/signout"} DJANGO_SLSX_USERINFO_ENDPOINT=${DJANGO_SLSX_USERINFO_ENDPOINT:-"https://test.accounts.cms.gov/v1/users"} + DJANGO_SLSX_RELATIONSHIPS_ENDPOINT=${DJANGO_SLSX_RELATIONSHIPS_ENDPOINT:-"https://test.medicare.gov/account/api/proxy/relationship?my-position=user"} fi if [ "${DB_MIGRATIONS}" = true ] diff --git a/docker-compose/msls-env-vars.env b/docker-compose/msls-env-vars.env index 45f99e37d..05bed97f0 100644 --- a/docker-compose/msls-env-vars.env +++ b/docker-compose/msls-env-vars.env @@ -5,6 +5,7 @@ DJANGO_SLSX_HEALTH_CHECK_ENDPOINT=http://msls:8080/health DJANGO_SLSX_TOKEN_ENDPOINT=http://msls:8080/sso/session DJANGO_SLSX_SIGNOUT_ENDPOINT=http://msls:8080/sso/signout DJANGO_SLSX_USERINFO_ENDPOINT=http://msls:8080/v1/users +DJANGO_SLSX_RELATIONSHIPS_ENDPOINT=http://msls:8080/account/api/proxy/relationship?my-position=user DJANGO_SLSX_CLIENT_ID=bb2api DJANGO_SLSX_CLIENT_SECRET="xxxxx" diff --git a/ops/containers/bb-api/files/external/.env.container b/ops/containers/bb-api/files/external/.env.container index 627644d22..c7da300e6 100644 --- a/ops/containers/bb-api/files/external/.env.container +++ b/ops/containers/bb-api/files/external/.env.container @@ -36,6 +36,7 @@ DJANGO_SLSX_HEALTH_CHECK_ENDPOINT="${DJANGO_SLSX_HEALTH_CHECK_ENDPOINT}" DJANGO_SLSX_SIGNOUT_ENDPOINT="${DJANGO_SLSX_SIGNOUT_ENDPOINT}" DJANGO_SLSX_TOKEN_ENDPOINT="${DJANGO_SLSX_TOKEN_ENDPOINT}" DJANGO_SLSX_USERINFO_ENDPOINT="${DJANGO_SLSX_USERINFO_ENDPOINT}" +DJANGO_SLSX_RELATIONSHIPS_ENDPOINT="${DJANGO_SLSX_RELATIONSHIPS_ENDPOINT}" DJANGO_SLSX_VERIFY_SSL_EXTERNAL="${DJANGO_SLSX_VERIFY_SSL_EXTERNAL}" DJANGO_USER_ID_ITERATIONS="${DJANGO_USER_ID_ITERATIONS}" DJANGO_USER_ID_SALT="${DJANGO_USER_ID_SALT}" diff --git a/ops/containers/bb-api/scripts/external/prepare-environment-support.bash b/ops/containers/bb-api/scripts/external/prepare-environment-support.bash index d30b202eb..9c683c71a 100755 --- a/ops/containers/bb-api/scripts/external/prepare-environment-support.bash +++ b/ops/containers/bb-api/scripts/external/prepare-environment-support.bash @@ -258,6 +258,7 @@ configure_slsx () { DJANGO_SLSX_TOKEN_ENDPOINT="http://${MSLSX_HOST}:8080/sso/session" DJANGO_SLSX_SIGNOUT_ENDPOINT="http://${MSLSX_HOST}:8080/sso/signout" DJANGO_SLSX_USERINFO_ENDPOINT="http://${MSLSX_HOST}:8080/v1/users" + DJANGO_SLSX_RELATIONSHIPS_ENDPOINT="http://${MSLSX_HOST}:8080/account/api/proxy/relationship?my-position=user" DJANGO_SLSX_CLIENT_ID=bb2api DJANGO_SLSX_CLIENT_SECRET="xxxxx" diff --git a/ops/containers/mslsx/app.py b/ops/containers/mslsx/app.py index e06320bcd..17f8e2d5e 100644 --- a/ops/containers/mslsx/app.py +++ b/ops/containers/mslsx/app.py @@ -166,6 +166,7 @@ def userinfo(usr): 'lastName': user_info['last_name'], 'hicn': user_info['hicn'], 'mbi': user_info['mbi'], + 'isCspUser': True, }, }, } @@ -181,5 +182,60 @@ def signout(): return make_response(jsonify({'message': 'signed out.'}), 302) +@app.route('/account/api/proxy/relationship', methods=['GET']) +def retrieve_relationships(): + print('WE ARE IN THE OVERRIDE') + relationships_response = { + 'relationships': [ + { + 'id': '1404f7a1-c33f-480e-9925-23a34b1f7ce5', + 'userFirstName': 'John', + 'userLastName': 'Smith', + 'beneFirstName': 'Jane', + 'beneLastName': 'Smith', + 'role': 'full', + 'roleLevel': 90, + 'status': 'active', + 'expiresAt': None, + 'createdTime': 1794602487, + 'updatedTime': 1794602487, + 'proxyType': 'caregiver', + 'scopes': ['enrollment'], + }, + { + 'id': '1404f7a1-c33f-480e-9925-23a34b1f7ce5', + 'userFirstName': 'John', + 'userLastName': 'Smith', + 'beneFirstName': 'Test', + 'beneLastName': 'Smith', + 'role': 'full', + 'roleLevel': 90, + 'status': 'active', + 'expiresAt': 1826138478, + 'createdTime': 1794602487, + 'updatedTime': 1794602487, + 'proxyType': 'caregiver', + 'scopes': ['enrollment'], + }, + { + 'id': '1404f7a1-c33f-480e-9925-23a34b1f7ce5', + 'userFirstName': 'John', + 'userLastName': 'Smith', + 'beneFirstName': 'Test', + 'beneLastName': 'Smith', + 'role': 'full', + 'roleLevel': 10, + 'status': 'active', + 'expiresAt': None, + 'createdTime': 1794602487, + 'updatedTime': 1794602487, + 'proxyType': 'caregiver', + 'scopes': ['enrollment'], + }, + ] + } + return make_response(jsonify(relationships_response)) + + if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=8080) diff --git a/ops/containers/selenium/utility-functions.bash b/ops/containers/selenium/utility-functions.bash index 7b8759735..addcb419b 100644 --- a/ops/containers/selenium/utility-functions.bash +++ b/ops/containers/selenium/utility-functions.bash @@ -12,6 +12,7 @@ set_slsx () { export DJANGO_SLSX_TOKEN_ENDPOINT="https://test.medicare.gov/sso/session" export DJANGO_SLSX_SIGNOUT_ENDPOINT="https://test.medicare.gov/sso/signout" export DJANGO_SLSX_USERINFO_ENDPOINT="https://test.accounts.cms.gov/v1/users" + export DJANGO_SLSX_RELATIONSHIPS_ENDPOINT="https://test.medicare.gov/account/api/proxy/relationship?my-position=user" } set_msls () { @@ -22,11 +23,13 @@ set_msls () { export DJANGO_SLSX_TOKEN_ENDPOINT="http://mslsx:8080/sso/session" export DJANGO_SLSX_SIGNOUT_ENDPOINT="http://mslsx:8080/sso/signout" export DJANGO_SLSX_USERINFO_ENDPOINT="http://mslsx:8080/v1/users" + export DJANGO_SLSX_RELATIONSHIPS_ENDPOINT="http://mslsx:8080/account/api/proxy/relationship?my-position=user" else export DJANGO_MEDICARE_SLSX_LOGIN_URI="http://localhost:8080/sso/authorize?client_id=bb2api" export DJANGO_SLSX_HEALTH_CHECK_ENDPOINT="http://localhost:8080/health" export DJANGO_SLSX_TOKEN_ENDPOINT="http://localhost:8080/sso/session" export DJANGO_SLSX_SIGNOUT_ENDPOINT="http://localhost:8080/sso/signout" export DJANGO_SLSX_USERINFO_ENDPOINT="http://localhost:8080/v1/users" + export DJANGO_SLSX_RELATIONSHIPS_ENDPOINT="http://localhost:8080/account/api/proxy/relationship?my-position=user" fi } \ No newline at end of file From ad138e97eedcd3d475c074b40ee626d81c9ed9bd Mon Sep 17 00:00:00 2001 From: James Demery Date: Mon, 16 Nov 2026 11:32:31 -0500 Subject: [PATCH 2/2] Remove prints --- apps/mymedicare_cb/authorization.py | 1 - ops/containers/mslsx/app.py | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/mymedicare_cb/authorization.py b/apps/mymedicare_cb/authorization.py index 1a82b152f..50aadf745 100644 --- a/apps/mymedicare_cb/authorization.py +++ b/apps/mymedicare_cb/authorization.py @@ -420,7 +420,6 @@ def retrieve_relationships_data(self, request) -> List[Dict[str, Any]]: allow_redirects=False, verify=self.verify_ssl_internal, ) - print('show me the response: ', response) log_dict = {'type': 'Authentication:relationships_retrieval', 'response_code': response.status_code} logger.info(log_dict) diff --git a/ops/containers/mslsx/app.py b/ops/containers/mslsx/app.py index 17f8e2d5e..89cc3515f 100644 --- a/ops/containers/mslsx/app.py +++ b/ops/containers/mslsx/app.py @@ -184,7 +184,6 @@ def signout(): @app.route('/account/api/proxy/relationship', methods=['GET']) def retrieve_relationships(): - print('WE ARE IN THE OVERRIDE') relationships_response = { 'relationships': [ {