Skip to content

Commit c389c2b

Browse files
committed
fixing smart config url pattern
1 parent 9f323b0 commit c389c2b

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

apps/wellknown/urls.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from waffle.decorators import waffle_switch
33
from .views import (
44
openid_configuration,
5-
smart_configuration,
65
ApplicationListView,
76
ApplicationLabelView,
87
PublicApplicationListView,
@@ -11,7 +10,6 @@
1110

1211
urlpatterns = [
1312
path("openid-configuration", openid_configuration, name="openid-configuration"),
14-
path("smart-configuration", smart_configuration, name="smart-configuration"),
1513
path(
1614
"applications",
1715
waffle_switch("wellknown_applications")(ApplicationListView.as_view()),
@@ -30,9 +28,6 @@
3028
path(
3129
"openid-configuration-v2", openid_configuration, name="openid-configuration-v2"
3230
),
33-
path(
34-
"smart-configuration-v2", smart_configuration, name="smart-on-fhir-configuration-v2"
35-
),
3631
path(
3732
"applications-v2",
3833
waffle_switch("wellknown_applications")(ApplicationListView.as_view()),

apps/wellknown/views/openid.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def smart_configuration(request):
4040
"""
4141
data = OrderedDict()
4242
issuer = base_issuer(request)
43-
v2 = request.path.endswith('smart-configuration-v2') or request.path.endswith('smartConfigV2')
44-
data = build_smart_config_endpoint(data, issuer=issuer, v2=v2)
43+
data = build_smart_config_endpoint(data, issuer=issuer)
4544
return JsonResponse(data)
4645

4746

@@ -108,7 +107,7 @@ def build_endpoint_info(data=OrderedDict(), issuer=""):
108107
return data
109108

110109

111-
def build_smart_config_endpoint(data=OrderedDict(), v2=False, issuer=""):
110+
def build_smart_config_endpoint(data=OrderedDict(), issuer=""):
112111
"""
113112
construct the smart config endpoint response. Takes in output of build_endpoint_info since they share many fields
114113
issuer should be http: or https:// prefixed url.
@@ -117,7 +116,7 @@ def build_smart_config_endpoint(data=OrderedDict(), v2=False, issuer=""):
117116
:return:
118117
"""
119118

120-
data = build_endpoint_info(data, issuer=issuer, v2=v2)
119+
data = build_endpoint_info(data, issuer=issuer)
121120
del(data["userinfo_endpoint"])
122121
del(data["ui_locales_supported"])
123122
del(data["service_documentation"])

hhs_oauth_server/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from django.contrib import admin
77
from apps.accounts.views.oauth2_profile import openidconnect_userinfo
88
from apps.fhir.bluebutton.views.home import fhir_conformance, fhir_conformance_v2
9+
from apps.wellknown.views.openid import smart_configuration
910
from hhs_oauth_server.hhs_oauth_server_context import IsAppInstalled
1011

1112
admin.autodiscover()
@@ -17,6 +18,7 @@
1718
urlpatterns = [
1819
path("health", include("apps.health.urls")),
1920
re_path(r"^.well-known/", include("apps.wellknown.urls")),
21+
path("v1/fhir/.wellknown/smart-configuration", smart_configuration, name="smart_configuration"),
2022
path("forms/", include("apps.forms.urls")),
2123
path("v1/accounts/", include("apps.accounts.urls")),
2224
re_path(
@@ -32,6 +34,7 @@
3234
openidconnect_userinfo,
3335
name="openid_connect_userinfo_v2",
3436
),
37+
path("v2/fhir/.wellknown/smart-configuration", smart_configuration, name="smart_configuration"),
3538
path("v2/fhir/metadata", fhir_conformance_v2, name="fhir_conformance_metadata_v2"),
3639
path("v2/fhir/", include("apps.fhir.bluebutton.v2.urls")),
3740
path("v2/o/", include("apps.dot_ext.v2.urls")),

0 commit comments

Comments
 (0)