Skip to content

Commit 844c911

Browse files
authored
BB2-3497: fix auth version redirects (#1297)
* Redirects all auth to v2 path. Auth paths are the same, so v1 or v2 go to v2 callback moving forward. Prevents forking, v1->v2 is less confusing than v2->v1. * deafult to v2 * Permission page fixed * Fix test
1 parent 3d6a4bb commit 844c911

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

apps/dot_ext/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88

99
base_urlpatterns = [
10-
path("authorize/", views.AuthorizationView.as_view(), name="authorize"),
10+
path("authorize/", views.AuthorizationView.as_view(version=2), name="authorize"),
1111
re_path(
1212
r"^authorize/(?P<uuid>[\w-]+)/$",
13-
views.ApprovalView.as_view(),
13+
views.ApprovalView.as_view(version=2),
1414
name="authorize-instance",
1515
),
1616
path("token/", views.TokenView.as_view(), name="token"),

apps/mymedicare_cb/tests/test_callback_slsx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def catchall(url, request):
252252
self.assertIn("client_id=test", response.url)
253253
self.assertIn("redirect_uri=test.com", response.url)
254254
self.assertIn("response_type=token", response.url)
255-
self.assertIn("http://www.google.com/v1/o/authorize/", response.url)
255+
self.assertIn("http://www.google.com/v2/o/authorize/", response.url)
256256
# assert login
257257
self.assertNotIn("_auth_user_id", self.client.session)
258258

apps/mymedicare_cb/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def authenticate(request):
8484

8585

8686
@never_cache
87-
def callback(request, version=1):
87+
def callback(request, version=2):
8888
try:
8989
authenticate(request)
9090
except ValidationError as e:

apps/testclient/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_links(request, **kwargs):
178178
if 'token' in request.session:
179179
return render(request, HOME_PAGE,
180180
context={"session_token": request.session['token'],
181-
"api_ver": request.session.get('api_ver', 'v1')})
181+
"api_ver": request.session.get('api_ver', 'v2')})
182182
else:
183183
return render(request, HOME_PAGE, context={"session_token": None})
184184

docker-compose/run_selenium_tests_remote.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ export USE_NEW_PERM_SCREEN
118118
export USE_MSLSX=false
119119

120120
# stop all before run selenium remote tests
121-
docker-compose -f docker-compose.selenium.remote.yml down --remove-orphans
122-
docker-compose -f docker-compose.selenium.remote.yml run selenium-remote-tests bash -c "SELENIUM_GRID=${SELENIUM_GRID} pytest ${PYTEST_SHOW_TRACE_OPT} ${TESTS_LIST}"
121+
docker compose -f docker-compose.selenium.remote.yml down --remove-orphans
122+
docker compose -f docker-compose.selenium.remote.yml run selenium-remote-tests bash -c "SELENIUM_GRID=${SELENIUM_GRID} pytest ${PYTEST_SHOW_TRACE_OPT} ${TESTS_LIST}"
123123

124124
# Stop containers after use
125125
echo_msg
126126
echo_msg "Stopping containers..."
127127
echo_msg
128128

129-
docker-compose -f docker-compose.selenium.remote.yml stop
129+
docker compose -f docker-compose.selenium.remote.yml stop

0 commit comments

Comments
 (0)