Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FI-2370: Add SMART App Launch #146

Merged
merged 14 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PATH
specs:
us_core_test_kit (0.6.2)
inferno_core (>= 0.4.2)
smart_app_launch_test_kit (>= 0.4.0)
tls_test_kit (~> 0.2.0)

GEM
Expand Down Expand Up @@ -249,6 +250,10 @@ GEM
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
smart_app_launch_test_kit (0.4.0)
inferno_core (>= 0.4.2)
jwt (~> 2.6)
tls_test_kit (~> 0.2.0)
sqlite3 (1.6.9)
mini_portile2 (~> 2.8.0)
sqlite3 (1.6.9-arm64-darwin)
Expand Down
30 changes: 30 additions & 0 deletions config/presets/inferno_reference_server_311_preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "standalone_client_id",
"type": "text",
"title": "Standalone Client ID",
"description": "Client ID provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "standalone_client_secret",
"type": "text",
"title": "Standalone Client Secret",
"description": "Client Secret provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "ehr_client_id",
"type": "text",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "ehr_client_secret",
"type": "text",
"optional": false,
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "client_auth_type",
"type": "text",
"value": "confidential_symmetric"
},
{
"name": "patient_ids",
"type": "text",
Expand Down
30 changes: 30 additions & 0 deletions config/presets/inferno_reference_server_400_preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "standalone_client_id",
"type": "text",
"title": "Standalone Client ID",
"description": "Client ID provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "standalone_client_secret",
"type": "text",
"title": "Standalone Client Secret",
"description": "Client Secret provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "ehr_client_id",
"type": "text",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "ehr_client_secret",
"type": "text",
"optional": false,
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "client_auth_type",
"type": "text",
"value": "confidential_symmetric"
},
{
"name": "patient_ids",
"type": "text",
Expand Down
30 changes: 30 additions & 0 deletions config/presets/inferno_reference_server_501_preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "standalone_client_id",
"type": "text",
"title": "Standalone Client ID",
"description": "Client ID provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "standalone_client_secret",
"type": "text",
"title": "Standalone Client Secret",
"description": "Client Secret provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "ehr_client_id",
"type": "text",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "ehr_client_secret",
"type": "text",
"optional": false,
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "client_auth_type",
"type": "text",
"value": "confidential_symmetric"
},
{
"name": "patient_ids",
"type": "text",
Expand Down
30 changes: 30 additions & 0 deletions config/presets/inferno_reference_server_610_preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "standalone_client_id",
"type": "text",
"title": "Standalone Client ID",
"description": "Client ID provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "standalone_client_secret",
"type": "text",
"title": "Standalone Client Secret",
"description": "Client Secret provided during registration of Inferno as a standalone application",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "ehr_client_id",
"type": "text",
"value": "SAMPLE_CONFIDENTIAL_CLIENT_ID"
},
{
"name": "ehr_client_secret",
"type": "text",
"optional": false,
"value": "SAMPLE_CONFIDENTIAL_CLIENT_SECRET"
},
{
"name": "client_auth_type",
"type": "text",
"value": "confidential_symmetric"
},
{
"name": "patient_ids",
"type": "text",
Expand Down
165 changes: 165 additions & 0 deletions lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
require 'smart_app_launch_test_kit'
require_relative '../us_core_options'

module USCoreTestKit
class SmartAppLaunchGroup < Inferno::TestGroup
id :us_core_smart_app_launch
title 'SMART App Launch'

group do
required_suite_options USCoreOptions::SMART_1_REQUIREMENT
id :us_core_smart_standalone_launch_stu1
title 'Standalone Launch'
optional

group from: :smart_discovery,
run_as_group: true
group from: :smart_standalone_launch,
run_as_group: true

group from: :smart_openid_connect do
run_as_group
optional
config(
inputs: {
id_token: { name: :standalone_id_token },
client_id: { name: :standalone_client_id },
requested_scopes: { name: :standalone_requested_scopes },
access_token: { name: :standalone_access_token },
smart_credentials: { name: :standalone_smart_credentials }
}
)
end

group from: :smart_token_refresh do
run_as_group
optional
config(
inputs: {
refresh_token: { name: :standalone_refresh_token },
client_id: { name: :standalone_client_id },
client_secret: { name: :standalone_client_secret },
received_scopes: { name: :standalone_received_scopes }
}
)
end
end

group do
required_suite_options USCoreOptions::SMART_1_REQUIREMENT
id :us_core_smart_ehr_launch_stu1
title 'EHR Launch'
optional

group from: :smart_discovery,
run_as_group: true
group from: :smart_ehr_launch,
run_as_group: true

group from: :smart_openid_connect do
run_as_group
optional
config(
inputs: {
id_token: { name: :ehr_id_token },
client_id: { name: :ehr_client_id },
requested_scopes: { name: :ehr_requested_scopes },
access_token: { name: :ehr_access_token },
smart_credentials: { name: :ehr_smart_credentials }
}
)
end

group from: :smart_token_refresh do
run_as_group
optional
config(
inputs: {
refresh_token: { name: :ehr_refresh_token },
client_id: { name: :ehr_client_id },
client_secret: { name: :ehr_client_secret },
received_scopes: { name: :ehr_received_scopes }
}
)
end
end

group do
required_suite_options USCoreOptions::SMART_2_REQUIREMENT
id :us_core_smart_standalone_launch_stu2
title 'Standalone Launch'
optional

group from: :smart_discovery_stu2,
run_as_group: true
group from: :smart_standalone_launch_stu2,
run_as_group: true

group from: :smart_openid_connect do
run_as_group
optional
config(
inputs: {
id_token: { name: :standalone_id_token },
client_id: { name: :standalone_client_id },
requested_scopes: { name: :standalone_requested_scopes },
access_token: { name: :standalone_access_token },
smart_credentials: { name: :standalone_smart_credentials }
}
)
end

group from: :smart_token_refresh do
run_as_group
optional
config(
inputs: {
refresh_token: { name: :standalone_refresh_token },
client_id: { name: :standalone_client_id },
client_secret: { name: :standalone_client_secret },
received_scopes: { name: :standalone_received_scopes }
}
)
end
end

group do
required_suite_options USCoreOptions::SMART_2_REQUIREMENT
id :us_core_smart_ehr_launch_stu2
title 'EHR Launch'
optional

group from: :smart_discovery_stu2,
run_as_group: true
group from: :smart_ehr_launch_stu2,
run_as_group: true

group from: :smart_openid_connect do
run_as_group
optional
config(
inputs: {
id_token: { name: :ehr_id_token },
client_id: { name: :ehr_client_id },
requested_scopes: { name: :ehr_requested_scopes },
access_token: { name: :ehr_access_token },
smart_credentials: { name: :ehr_smart_credentials }
}
)
end

group from: :smart_token_refresh do
run_as_group
optional
config(
inputs: {
refresh_token: { name: :ehr_refresh_token },
client_id: { name: :ehr_client_id },
client_secret: { name: :ehr_client_secret },
received_scopes: { name: :ehr_received_scopes }
}
)
end
end
end
end
Loading
Loading