diff --git a/dummy-authorization-server-service/README.md b/dummy-authorization-server-service/README.md index b7b7ac9fba2f138637200c1a6475ec698efee385..aa0368e627e52da59cbeca548a18979bb80096a3 100644 --- a/dummy-authorization-server-service/README.md +++ b/dummy-authorization-server-service/README.md @@ -12,12 +12,21 @@ and a secret that can be configured depending on the used audience. | userId | User for whom the token is generated | | audienceId | ID of the audience used to retrieve secret in Gazelle configurations. | +The response body to this request will be the content of the generated token. + ## Available user ID | User ID | |----------| | aamrein | +## Install the tool + +Sources are available [here](https://gitlab.inria.fr/gazelle/applications/test-execution/simulator/access-token-provider) + +Deploy the `app.dummy-authorization-server-service-X.X.X.war` artifact in a wildfly 18 server. +No specific wildfly configuration is needed for the tool to work. + ## Configure Audiences Edit the file `/opt/simulators/audience.properties`, add a property for each audience that needs to be configured : diff --git a/dummy-authorization-server-service/src/main/resources/soapui/DummyAccessTokenProvider.xml b/dummy-authorization-server-service/src/main/resources/soapui/DummyAccessTokenProvider.xml index 54861a052a306411c692855929eee5d4f7013a47..93b4d01d9ac9641a639488d9e08c99a63e7a4945 100644 --- a/dummy-authorization-server-service/src/main/resources/soapui/DummyAccessTokenProvider.xml +++ b/dummy-authorization-server-service/src/main/resources/soapui/DummyAccessTokenProvider.xml @@ -146,6 +146,18 @@ <con:params/> <con:element>data</con:element> </con:representation> + <con:representation type="RESPONSE"> + <con:mediaType xsi:nil="true"/> + <con:status>204</con:status> + <con:params/> + <con:element>data</con:element> + </con:representation> + <con:representation type="RESPONSE"> + <con:mediaType xsi:nil="true"/> + <con:status>204</con:status> + <con:params/> + <con:element>data</con:element> + </con:representation> <con:request name="Request 1" id="1039bbd9-95cf-452e-ad96-4cfb23827782" mediaType="application/json"> <con:settings/> <con:endpoint>http://localhost:8780</con:endpoint> @@ -177,7 +189,7 @@ <con:testCase id="f4ab98d6-051e-4e34-9dca-7aac5409f375" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Request" searchProperties="true"> <con:settings/> - <con:testStep type="restrequest" name="Mock-token 1 - Request 1" id="fa834a0a-6dc7-4d84-a15a-f13224626c4e"> + <con:testStep type="restrequest" name="Valid request" id="fa834a0a-6dc7-4d84-a15a-f13224626c4e"> <con:settings/> <con:config service="http://localhost:8780" resourcePath="/authorization-server/mock-token" methodName="Mock-token 1" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> @@ -215,6 +227,84 @@ </con:testStep> <con:properties/> </con:testCase> + <con:testCase id="81ffbff9-1a6a-4389-951a-3f8ed143f4e8" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" + name="Unknown UserID" searchProperties="true"> + <con:settings/> + <con:testStep type="restrequest" name="Unknown userID" id="0821bbbe-9ed6-490b-88f5-c46be620eae6"> + <con:settings/> + <con:config service="http://localhost:8780" resourcePath="/authorization-server/mock-token" methodName="Mock-token 1" + xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <con:restRequest name="Unknown userID" id="1039bbd9-95cf-452e-ad96-4cfb23827782" mediaType="application/json"> + <con:settings> + <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting> + </con:settings> + <con:endpoint>http://localhost:8780</con:endpoint> + <con:request/> + <con:originalUri>http://localhost/authorization-server/mock-token</con:originalUri> + <con:assertion type="Valid HTTP Status Codes" id="60be561e-c058-42cd-882f-0e60e9226c65" name="Valid HTTP Status Codes"> + <con:configuration> + <codes>204</codes> + </con:configuration> + </con:assertion> + <con:credentials> + <con:authType>No Authorization</con:authType> + </con:credentials> + <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> + <con:jmsPropertyConfig/> + <con:parameters> + <con:entry key="audienceId" value="audience43"/> + <con:entry key="userId" value="aamrein"/> + </con:parameters> + <con:parameterOrder> + <con:entry>userId</con:entry> + <con:entry>audienceId</con:entry> + <con:entry>purposeOfUse</con:entry> + <con:entry>resourceId</con:entry> + </con:parameterOrder> + </con:restRequest> + </con:config> + </con:testStep> + <con:properties/> + </con:testCase> + <con:testCase id="0b0c480f-8389-40e2-83bf-1adfad6f874f" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" + name="Unknown Audience" searchProperties="true"> + <con:settings/> + <con:testStep type="restrequest" name="Unknown audience" id="b3d2c1e7-36a2-43ad-8056-5ff54b75677b"> + <con:settings/> + <con:config service="http://localhost:8780" resourcePath="/authorization-server/mock-token" methodName="Mock-token 1" + xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <con:restRequest name="Unknown audience" id="1039bbd9-95cf-452e-ad96-4cfb23827782" mediaType="application/json"> + <con:settings> + <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting> + </con:settings> + <con:endpoint>http://localhost:8780</con:endpoint> + <con:request/> + <con:originalUri>http://localhost/authorization-server/mock-token</con:originalUri> + <con:assertion type="Valid HTTP Status Codes" id="60be561e-c058-42cd-882f-0e60e9226c65" name="Valid HTTP Status Codes"> + <con:configuration> + <codes>204</codes> + </con:configuration> + </con:assertion> + <con:credentials> + <con:authType>No Authorization</con:authType> + </con:credentials> + <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> + <con:jmsPropertyConfig/> + <con:parameters> + <con:entry key="audienceId" value="audience"/> + <con:entry key="userId" value="wbars"/> + </con:parameters> + <con:parameterOrder> + <con:entry>userId</con:entry> + <con:entry>audienceId</con:entry> + <con:entry>purposeOfUse</con:entry> + <con:entry>resourceId</con:entry> + </con:parameterOrder> + </con:restRequest> + </con:config> + </con:testStep> + <con:properties/> + </con:testCase> <con:properties/> </con:testSuite> <con:properties/>