AEGIS Touchstone Testing Implementation Guide

This is the Version 1.1.0 Release of the Touchstone Testing Implementation Guide, based on FHIR Version 4.0.1. See the Directory of published versions

Turtle Format: TestScript-oauth2-standalone-launch

Raw ttl


@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:TestScript;
  fhir:nodeRole fhir:treeRoot;
  fhir:Resource.id [ fhir:value "oauth2-standalone-launch"];
  fhir:Resource.meta [
     fhir:Meta.profile [
       fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript";
       fhir:index 0;
       fhir:link <http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript>     ]
  ];
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "extensions" ];
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><h3>Ids</h3><table class=\"grid\"><tr><td>-</td></tr><tr><td>*</td></tr></table><h3>Meta</h3><table class=\"grid\"><tr><td>-</td></tr><tr><td>*</td></tr></table><p><b>url</b>: <a href=\"http://touchstone.aegis.net/touchstone/fhir/testing/TestScript/oauth2-standalone-launch\">http://touchstone.aegis.net/touchstone/fhir/testing/TestScript/oauth2-standalone-launch</a></p><p><b>version</b>: 1.1.0</p><p><b>name</b>: OAuth2StandaloneLaunch</p><p><b>status</b>: active</p><p><b>date</b>: 2020-08-27</p><p><b>publisher</b>: AEGIS.net, Inc.</p><p><b>contact</b>: Touchstone Support: <a href=\"mailto:Touchstone_Support@aegis.net\">Touchstone_Support@aegis.net</a></p><p><b>description</b>: Demonstrate the use of the oauth2-authorize operation and the new extensions variable-paramField, operation-oauth2AuthzRequestId, operation-oauth2AuthzRedirectId, assert-variable and assert-stopTestOnFail.</p><p><b>jurisdiction</b>: <span title=\"Codes: {urn:iso:std:iso:3166 US}\">United States of America</span></p><p><b>copyright</b>: (c) AEGIS.net, Inc. 2015+</p><blockquote><p><b>variable</b></p><p><b>AEGIS Touchstone Testing TestScript Variable ParamField Extension</b>: </p><p><b>name</b>: oauth2AuthzRequest1StateParam</p><p><b>sourceId</b>: oauth2AuthzRequest1</p></blockquote><blockquote><p><b>variable</b></p><p><b>AEGIS Touchstone Testing TestScript Variable ParamField Extension</b>: </p><p><b>name</b>: oauth2AuthzRequest1RedirectUri</p><p><b>sourceId</b>: oauth2AuthzRequest1</p></blockquote><blockquote><p><b>variable</b></p><p><b>AEGIS Touchstone Testing TestScript Variable ParamField Extension</b>: </p><p><b>name</b>: oauth2AuthzRedirect1AuthCode</p><p><b>sourceId</b>: oauth2AuthzRedirect1</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: authorizeEndpoint</p><p><b>defaultValue</b>: https://oauth2.aegis.net/auth</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: oauth2AuthzRequestedScopes</p><p><b>defaultValue</b>: launch/patient openid fhirUser offline_access patient/Patient.read</p></blockquote><blockquote><p><b>test</b></p><h3>Ids</h3><table class=\"grid\"><tr><td>-</td></tr><tr><td>*</td></tr></table><p><b>name</b>: Standalone Launch With Patient Scope</p><p><b>description</b>: Perform Standalone SMART launch sequence and test OpenID Connect and token refresh functionality.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td>-</td><td><b>Extension</b></td><td><b>Type</b></td><td><b>Description</b></td><td><b>EncodeRequestUrl</b></td><td><b>Url</b></td></tr><tr><td>*</td><td></td><td><span title=\"{http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes oauth2-authorize}\">OAuth2 Authorize</span></td><td>Redirect user to the authorize endpoint for target test system specified in smart configuration</td><td>false</td><td>${authorizeEndpoint}?client_id=clientId&amp;scope=${oauth2AuthzRequestedScopes}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>RequestURL</b></td><td><b>SourceId</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td></td><td>OAuth server redirects client browser to app redirect URI. Client browser redirected from OAuth server to redirect URI of client app as described in SMART authorization sequence.</td><td>request</td><td>contains</td><td>/oauth2/authcode/redirect</td><td>oauth2AuthzRedirect1</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td></td><td>Direct comparison example.</td><td>request</td><td>equals</td><td>${authorizeEndpoint}</td><td>false</td></tr></table></blockquote></blockquote></div>"
  ];
  fhir:TestScript.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/TestScript/oauth2-standalone-launch"];
  fhir:TestScript.version [ fhir:value "1.1.0"];
  fhir:TestScript.name [ fhir:value "OAuth2StandaloneLaunch"];
  fhir:TestScript.status [ fhir:value "active"];
  fhir:TestScript.date [ fhir:value "2020-08-27"^^xsd:date];
  fhir:TestScript.publisher [ fhir:value "AEGIS.net, Inc."];
  fhir:TestScript.contact [
     fhir:index 0;
     fhir:ContactDetail.name [ fhir:value "Touchstone Support" ];
     fhir:ContactDetail.telecom [
       fhir:index 0;
       fhir:ContactPoint.system [ fhir:value "email" ];
       fhir:ContactPoint.value [ fhir:value "Touchstone_Support@aegis.net" ];
       fhir:ContactPoint.use [ fhir:value "work" ]     ]
  ];
  fhir:TestScript.description [ fhir:value "Demonstrate the use of the oauth2-authorize operation and the new extensions variable-paramField, operation-oauth2AuthzRequestId, operation-oauth2AuthzRedirectId, assert-variable and assert-stopTestOnFail."];
  fhir:TestScript.jurisdiction [
     fhir:index 0;
     fhir:CodeableConcept.coding [
       fhir:index 0;
       fhir:Coding.system [ fhir:value "urn:iso:std:iso:3166" ];
       fhir:Coding.code [ fhir:value "US" ];
       fhir:Coding.display [ fhir:value "United States of America" ]     ]
  ];
  fhir:TestScript.copyright [ fhir:value "(c) AEGIS.net, Inc. 2015+"];
  fhir:TestScript.variable [
     fhir:index 0;
     fhir:Element.extension [
       fhir:index 0;
       fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-variable-paramField" ];
       fhir:Extension.valueString [ fhir:value "state" ]     ];
     fhir:TestScript.variable.name [ fhir:value "oauth2AuthzRequest1StateParam" ];
     fhir:TestScript.variable.sourceId [ fhir:value "oauth2AuthzRequest1" ]
  ], [
     fhir:index 1;
     fhir:Element.extension [
       fhir:index 0;
       fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-variable-paramField" ];
       fhir:Extension.valueString [ fhir:value "redirect_uri" ]     ];
     fhir:TestScript.variable.name [ fhir:value "oauth2AuthzRequest1RedirectUri" ];
     fhir:TestScript.variable.sourceId [ fhir:value "oauth2AuthzRequest1" ]
  ], [
     fhir:index 2;
     fhir:Element.extension [
       fhir:index 0;
       fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-variable-paramField" ];
       fhir:Extension.valueString [ fhir:value "code" ]     ];
     fhir:TestScript.variable.name [ fhir:value "oauth2AuthzRedirect1AuthCode" ];
     fhir:TestScript.variable.sourceId [ fhir:value "oauth2AuthzRedirect1" ]
  ], [
     fhir:index 3;
     fhir:TestScript.variable.name [ fhir:value "authorizeEndpoint" ];
     fhir:TestScript.variable.defaultValue [ fhir:value "https://oauth2.aegis.net/auth" ]
  ], [
     fhir:index 4;
     fhir:TestScript.variable.name [ fhir:value "oauth2AuthzRequestedScopes" ];
     fhir:TestScript.variable.defaultValue [ fhir:value "launch/patient openid fhirUser offline_access patient/Patient.read" ]
  ];
  fhir:TestScript.test [
     fhir:index 0;
     fhir:Element.id [ fhir:value "StandaloneLaunchWithPatientScope" ];
     fhir:TestScript.test.name [ fhir:value "Standalone Launch With Patient Scope" ];
     fhir:TestScript.test.description [ fhir:value "Perform Standalone SMART launch sequence and test OpenID Connect and token refresh functionality." ];
     fhir:TestScript.test.action [
       fhir:index 0;
       fhir:TestScript.test.action.operation [
         fhir:Element.extension [
           fhir:index 0;
           fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-operation-oauth2AuthzRequestId" ];
           fhir:Extension.valueId [ fhir:value "oauth2AuthzRequest1" ]         ], [
           fhir:index 1;
           fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-operation-oauth2AuthzRedirectId" ];
           fhir:Extension.valueId [ fhir:value "oauth2AuthzRedirect1" ]         ];
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.system [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes" ];
           fhir:Coding.code [ fhir:value "oauth2-authorize" ]         ];
         fhir:TestScript.setup.action.operation.description [ fhir:value "Redirect user to the authorize endpoint for target test system specified in smart configuration" ];
         fhir:TestScript.setup.action.operation.encodeRequestUrl [ fhir:value "false"^^xsd:boolean ];
         fhir:TestScript.setup.action.operation.url [ fhir:value "${authorizeEndpoint}?client_id=clientId&scope=${oauth2AuthzRequestedScopes}" ]       ]     ], [
       fhir:index 1;
       fhir:TestScript.test.action.assert [
         fhir:Element.extension [
           fhir:index 0;
           fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail" ];
           fhir:Extension.valueBoolean [ fhir:value "false"^^xsd:boolean ]         ];
         fhir:TestScript.setup.action.assert.description [ fhir:value "OAuth server redirects client browser to app redirect URI. Client browser redirected from OAuth server to redirect URI of client app as described in SMART authorization sequence." ];
         fhir:TestScript.setup.action.assert.direction [ fhir:value "request" ];
         fhir:TestScript.setup.action.assert.operator [ fhir:value "contains" ];
         fhir:TestScript.setup.action.assert.requestURL [ fhir:value "/oauth2/authcode/redirect" ];
         fhir:TestScript.setup.action.assert.sourceId [ fhir:value "oauth2AuthzRedirect1" ];
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]       ]     ], [
       fhir:index 2;
       fhir:TestScript.test.action.assert [
         fhir:Element.extension [
           fhir:index 0;
           fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-variable" ];
           fhir:Extension.valueString [ fhir:value "https://oauth2.aegis.net/auth" ]         ], [
           fhir:index 1;
           fhir:Extension.url [ fhir:value "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail" ];
           fhir:Extension.valueBoolean [ fhir:value "false"^^xsd:boolean ]         ];
         fhir:TestScript.setup.action.assert.description [ fhir:value "Direct comparison example." ];
         fhir:TestScript.setup.action.assert.direction [ fhir:value "request" ];
         fhir:TestScript.setup.action.assert.operator [ fhir:value "equals" ];
         fhir:TestScript.setup.action.assert.value [ fhir:value "${authorizeEndpoint}" ];
         fhir:TestScript.setup.action.assert.warningOnly [ fhir:value "false"^^xsd:boolean ]       ]     ]
  ].

# - ontology header ------------------------------------------------------------

 a owl:Ontology;
  owl:imports fhir:fhir.ttl.