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-3648: Add Spec for Shared Tests and Implement Features for the Failing Tests #86

Merged
merged 6 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1.2']
ruby-version: ['3.3.6']

steps:
- uses: actions/checkout@v2
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1.2']
ruby-version: ['3.3.6']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.3.6
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.1.2
ruby 3.3.6
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1.2
FROM ruby:3.3.6

ENV INSTALL_PATH=/opt/inferno/
ENV APP_ENV=production
Expand All @@ -11,9 +11,9 @@ ADD Gemfile* $INSTALL_PATH
ADD lib/smart_app_launch/version.rb $INSTALL_PATH/lib/smart_app_launch/version.rb

RUN gem install bundler
# The below RUN line is commented out for development purposes, because any change to the
# The below RUN line is commented out for development purposes, because any change to the
# required gems will break the dockerfile build process.
# If you want to run in Deploy mode, just run `bundle install` locally to update
# If you want to run in Deploy mode, just run `bundle install` locally to update
# Gemfile.lock, and uncomment the following line.
# RUN bundle config set --local deployment 'true'
RUN bundle install
Expand Down
61 changes: 32 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ PATH
remote: .
specs:
smart_app_launch_test_kit (0.4.6)
inferno_core (>= 0.4.2)
inferno_core (>= 0.6.2)
json-jwt (~> 1.15.3)
jwt (~> 2.6)
tls_test_kit (~> 0.2.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.7.8)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -23,13 +23,13 @@ GEM
base64 (0.2.0)
bcp47 (0.3.3)
i18n
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindata (2.5.0)
blueprinter (0.25.2)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
connection_pool (2.5.0)
crack (1.0.0)
bigdecimal
rexml
Expand Down Expand Up @@ -81,20 +81,20 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-multipart (1.1.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fhir_client (5.0.3)
fhir_client (6.0.0)
activesupport (>= 3)
addressable (>= 2.3)
fhir_dstu2_models (>= 1.1.1)
fhir_models (>= 4.2.1)
fhir_models (>= 5.0.0)
fhir_stu3_models (>= 3.1.1)
nokogiri (>= 1.10.4)
oauth2 (~> 1.1)
Expand All @@ -106,7 +106,7 @@ GEM
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.11.4)
fhir_models (4.3.0)
fhir_models (5.0.0)
bcp47 (>= 0.3)
date_time_precision (>= 0.8)
mime-types (>= 3.0)
Expand All @@ -126,22 +126,23 @@ GEM
mustermann (~> 1.0)
mustermann-contrib (~> 1.0)
rack (~> 2.0)
hanami-utils (2.1.0)
hanami-utils (2.2.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-transformer (~> 1.0, < 2)
hansi (0.2.1)
hashdiff (1.1.0)
http-accept (1.7.0)
http-cookie (1.0.7)
http-cookie (1.0.8)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
inferno_core (0.4.43)
inferno_core (0.6.2)
activesupport (~> 6.1.7.5)
base62-rb (= 0.3.1)
blueprinter (= 0.25.2)
concurrent-ruby (= 1.3.4)
dotenv (~> 2.7)
dry-configurable (= 1.0.0)
dry-container (= 0.10.0)
Expand All @@ -155,6 +156,7 @@ GEM
hanami-controller (= 2.0.0)
hanami-router (= 2.0.0)
oj (= 3.11.0)
pastel (~> 0.8.0)
pry
pry-byebug
puma (~> 5.6.7)
Expand All @@ -173,17 +175,17 @@ GEM
aes_key_wrap
bindata
httpclient
jwt (2.9.3)
jwt (2.10.1)
base64
kramdown (2.4.0)
rexml
logger (1.6.1)
kramdown (2.5.1)
rexml (>= 3.3.9)
logger (1.6.5)
method_source (1.1.0)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.1001)
minitest (5.25.1)
mime-types-data (3.2025.0204)
minitest (5.25.4)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
Expand All @@ -194,12 +196,12 @@ GEM
hansi (~> 0.2.0)
mustermann (= 1.1.2)
netrc (0.11.0)
nio4r (2.7.3)
nokogiri (1.16.7-arm64-darwin)
nio4r (2.7.4)
nokogiri (1.18.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.18.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.18.2-x86_64-linux-gnu)
racc (~> 1.4)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -222,13 +224,13 @@ GEM
puma (5.6.9)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (13.2.1)
rdoc (6.7.0)
psych (>= 4.0.0)
redis-client (0.22.2)
redis-client (0.23.2)
connection_pool
reline (0.5.9)
io-console (~> 0.5)
Expand All @@ -237,8 +239,8 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.8)
rouge (4.4.0)
rexml (3.4.0)
rouge (4.5.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand Down Expand Up @@ -269,7 +271,7 @@ GEM
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
thor (1.2.2)
tilt (2.4.0)
tilt (2.6.0)
tls_test_kit (0.2.2)
inferno_core (>= 0.4.2)
tty-color (0.6.0)
Expand All @@ -289,14 +291,15 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-20
x86_64-darwin-22
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
75 changes: 75 additions & 0 deletions lib/smart_app_launch/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
require_relative 'version'

module SMARTAppLaunch
class Metadata < Inferno::TestKit
id :smart_app_launch_test_kit
title 'SMART App Launch Test Kit'
description <<~DESCRIPTION
The SMART App Launch Test Kit primarily validates the conformance of an
authorization server implementation to a specified version of the [SMART
Application Launch Framework Implementation
Guide](http://hl7.org/fhir/smart-app-launch/index.html). This Test Kit also
provides Brand Bundle Publisher testing for the User-access Brands and Endpoints
specification. This Test Kit supports following versions of the SMART App
Launch IG: [STU1](https://hl7.org/fhir/smart-app-launch/1.0.0/),
[STU2](http://hl7.org/fhir/smart-app-launch/STU2/), and
[STU2.2](http://hl7.org/fhir/smart-app-launch/STU2.2/).
<!-- break -->

This Test Kit is [open
source](https://github.com/inferno-framework/smart-app-launch-test-kit#license)
and freely available for use or adoption by the health IT community including
EHR vendors, health app developers, and testing labs. It is built using the
[Inferno Framework](https://inferno-framework.github.io/inferno-core/). The
Inferno Framework is designed for reuse and aims to make it easier to build test
kits for any FHIR-based data exchange.

To run tests for a SMART App Launch authorization server, select one of the
"SMART App Launch" suites. To run tests for a Brand Bundle Publisher, select
the "SMART User-access Brands and Endpoints" suite.

## Status

The SMART App Launch Test Kit primarily verifies that systems correctly
implement the SMART App Launch IG for providing authorization and/or
authentication services to client applications accessing HL7 FHIR APIs.

The test kit currently tests the following requirements:
- Standalone Launch
- EHR Launch

It also tests the ability of a Brand Bundle Publisher to publish a valid brand
bundle as described in the User-access Brands and Endpoints specification.

See the test descriptions within the test kit for detail on the specific
validations performed as part of testing these requirements.

## Repository

The SMART App Launch Test Kit GitHub repository can be [found
here](https://github.com/inferno-framework/smart-app-launch-test-kit).

## Providing Feedback and Reporting Issues

We welcome feedback on the tests, including but not limited to the following
areas:

- Validation logic, such as potential bugs, lax checks, and unexpected failures.
- Requirements coverage, such as requirements that have been missed, tests that
necessitate features that the IG does not require, or other issues with the
interpretation of the IG's requirements.
- User experience, such as confusing or missing information in the test UI.

Please report any issues with this set of tests in the [issues
section](https://github.com/inferno-framework/smart-app-launch-test-kit/issues)
of the repository.
DESCRIPTION
suite_ids [:smart, :smart_stu2, :smart_stu2_2, :smart_access_brands]
tags ['SMART App Launch', 'Endpoint Publication']
last_updated LAST_UPDATED
version VERSION
maturity 'Medium'
authors ['Stephen MacVicar']
repo 'https://github.com/inferno-framework/smart-app-launch-test-kit'
end
end
5 changes: 4 additions & 1 deletion lib/smart_app_launch/smart_access_brands_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class SMARTAccessBrandsSuite < Inferno::TestSuite
id 'smart_access_brands'
title 'SMART User-access Brands and Endpoints STU2.2'
short_title 'SMART User-access Brands'
version VERSION

description <<~DESCRIPTION
The SMART User-access Brands Test Suite verifies that Brand Bundle Publishers publish valid User-access
Expand Down Expand Up @@ -34,6 +33,10 @@ class SMARTAccessBrandsSuite < Inferno::TestSuite
Bundle as an input and leaving the User Access Brand Publication URL input blank.
INSTRUCTIONS

source_code_url('https://github.com/inferno-framework/smart-app-launch-test-kit')
download_url('https://github.com/inferno-framework/smart-app-launch-test-kit/releases')
report_issue_url('https://github.com/inferno-framework/smart-app-launch-test-kit/issues')

VALIDATION_MESSAGE_FILTERS = [
/\A\S+: \S+: URL value '.*' does not resolve/,
%r{\A\S+: \S+: Bundled or contained reference not found within the bundle/resource} # Validator issue with Brand profile: https://chat.fhir.org/#narrow/stream/291844-FHIR-Validator/topic/SMART.20v2.2E2.20User.20Access.20Brands.3A.20Brand.20validation.20error.3F/near/466321024
Expand Down
13 changes: 7 additions & 6 deletions lib/smart_app_launch/smart_stu1_suite.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'tls_test_kit'

require_relative 'jwks'
require_relative 'version'
require_relative 'discovery_stu1_group'
require_relative 'standalone_launch_group'
require_relative 'ehr_launch_group'
Expand All @@ -12,7 +11,6 @@ module SMARTAppLaunch
class SMARTSTU1Suite < Inferno::TestSuite
id 'smart'
title 'SMART App Launch STU1'
version VERSION

resume_test_route :get, '/launch' do |request|
request.query_parameters['iss']
Expand All @@ -34,15 +32,18 @@ class SMARTSTU1Suite < Inferno::TestSuite
}

description <<~DESCRIPTION
The SMART App Launch Test Suite verifies that systems correctly implement
the [SMART App Launch IG](http://hl7.org/fhir/smart-app-launch/1.0.0/)
for providing authorization and/or authentication services to client
applications accessing HL7® FHIR® APIs. To get started, please first register
The SMART App Launch Test Suite verifies that systems correctly implement
the [SMART App Launch IG](http://hl7.org/fhir/smart-app-launch/1.0.0/)
for providing authorization and/or authentication services to client
applications accessing HL7® FHIR® APIs. To get started, please first register
the Inferno client as a SMART App with the following information:

* SMART Launch URI: `#{config.options[:launch_uri]}`
* OAuth Redirect URI: `#{config.options[:redirect_uri]}`
DESCRIPTION
source_code_url('https://github.com/inferno-framework/smart-app-launch-test-kit')
download_url('https://github.com/inferno-framework/smart-app-launch-test-kit/releases')
report_issue_url('https://github.com/inferno-framework/smart-app-launch-test-kit/issues')

group do
title 'Standalone Launch'
Expand Down
Loading