diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 0000000..3beb05b --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1,28 @@ +{:linters {:aliased-namespace-symbol {:level :warning} + :case-symbol-test {:level :warning} + :condition-always-true {:level :warning} + :bb.edn-task-missing-docstring {:level :warning} + :docstring-no-summary {:level :warning} + :docstring-leading-trailing-whitespace {:level :warning} + :dynamic-var-not-earmuffed {:level :warning} + :equals-false {:level :warning} + :equals-true {:level :warning} + :def-fn {:level :warning} + :reduce-without-init {:level :warning} + :keyword-binding {:level :warning} + :main-without-gen-class {:level :error} + :minus-one {:level :warning} + :missing-docstring {:level :warning} + :plus-one {:level :warning} + :redundant-fn-wrapper {:level :warning} + :redundant-call {:level :warning} + :refer {:level :warning + :exclude [clojure.test]} + :single-key-in {:level :warning} + :shadowed-var {:level :warning} + :unused-alias {:level :warning} + :used-underscored-binding {:level :warning} + :unsorted-imports {:level :warning} + :unsorted-required-namespaces {:level :warning} + :warn-on-reflection {:level :warning} + :unresolved-namespace {:level :warning}}} diff --git a/mauth-protocol-test-suite/.version b/mauth-protocol-test-suite/.version new file mode 100644 index 0000000..0ea3a94 --- /dev/null +++ b/mauth-protocol-test-suite/.version @@ -0,0 +1 @@ +0.2.0 diff --git a/mauth-protocol-test-suite/CHANGELOG.md b/mauth-protocol-test-suite/CHANGELOG.md new file mode 100644 index 0000000..ac26d0e --- /dev/null +++ b/mauth-protocol-test-suite/CHANGELOG.md @@ -0,0 +1,12 @@ +# 0.2.0 +* Add MWS(V1) test suite. + +# 0.1.2 +* Use valid UTF-8 codes in `get-vanilla-query-param-key-ordering`. + +# 0.1.1 +* Fix query param ordering in case `post-vanilla-body-query`. +* Use UTF-8 URL encoding instead of Windows-1252 encoding in `get-vanilla-query-param-value-ordering`. + +# 0.1.0 +* Created MWSV2 test suite. diff --git a/mauth-protocol-test-suite/LICENSE b/mauth-protocol-test-suite/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/mauth-protocol-test-suite/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mauth-protocol-test-suite/NOTICE b/mauth-protocol-test-suite/NOTICE new file mode 100644 index 0000000..b64bbce --- /dev/null +++ b/mauth-protocol-test-suite/NOTICE @@ -0,0 +1,4 @@ +Medidata mAuth Protocol 4 Test Suite + +This product includes software developed at +Amazon.com, Inc. (https://www.amazon.com/). diff --git a/mauth-protocol-test-suite/README.md b/mauth-protocol-test-suite/README.md new file mode 100644 index 0000000..4dbb748 --- /dev/null +++ b/mauth-protocol-test-suite/README.md @@ -0,0 +1,28 @@ +# mauth-protocol-test-suite + +This repo contains test cases for mAuth digital signature protocols and was created to aid in the development of mAuth clients in a language agnostic way. Currently the repo contains cases for the MWS and MWSV2 protocols. The MWSV2 protocol specification is described [here](https://learn.mdsol.com/display/CA/MAuth+Protocol+V2+Specification). The repo also serves as an description of mAuth protocol specifications with examples. + +## Usage + +This repo should be added to each mAuth client via git submodules (see documentation [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and run as part of the test suite for that mAuth client to ensure it conforms to the mAuth protocol specification. mAuth clients are expected to write some glue code that will allow them to run the cases provided here with their testing tool (Rspec etc). + +### Test Cases + +For each there are four files with the following extensions: `.req`, `.sts`, `.sig`, `.authz`. + +The `.req` files contain a JSON hash of the attributes of an unsigned request. +The `.sts` files contain the `string_to_sign` (the string that will be passed through mAuth client's hashing algorithm) for that request. +The `.sig` files contain the digital signature of that request. +The `.authz` files contain a JSON hash of the authentication headers that would be added to that request in order to sign it. + +For each case, clients that sign requests should run three tests: +1. Given the request attributes in the `.req` file, the client should generate a string_to_sign that matches the `.sts` file. +2. Given the string_to_sign in the `.sts` file, the client should generate a digital signature that matches the `.sig` file. +3. Given the signature in the `.sig` file, the client should generate authentication headers that match the headers in the `.authz` file. + +Clients that authenticate requests should also run an additional test: +1. Combining the authentication headers in the `.authz` file and the request attributes in the `.req` file into a signed request, the client should consider the request authentic. + +### Signing Parameters + +The mAuth client running these tests should sign requests with the [provided RSA private key](./signing-params/rsa-key) and authenticate requests with the [provided RSA public key](./signing-params/rsa-key-pub). All requests should be signed and authenticated with the `app_uuid` and `request_time` provided in [signing-config.json](./signing-config.json). If the testing mAuth client does not accept the request time as an argument some library that mocks time APIs (i.e. Timecop for Ruby) should be used. diff --git a/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.authz b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.authz new file mode 100644 index 0000000..da32c92 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.authz @@ -0,0 +1,4 @@ +{ + "X-MWS-Authentication": "MWS 836a454e-7f14-4192-8f5a-2a9d3d66f70c:HIrmHSjmK7Q91Xwm+zYvudeIV+RcOMJoEc7bUfeM6+1ReQ7tsd1ankm1BFSTy3a/iCMPx4k5F4NKxxCdCunYV5QdM51hQiJfHB6ALg1WfSnfNnZtOWZAC78R2X3709G4mozJCB0GJ3ERm5GMUiL4ncuGz4wWuw3RGJHDwcFH7F55NnCgdL2nBJ8e0MLGGaDd8np8Kk0HQOyAT867t+g0/SHR7ZN/cfQILtdFKmMRC0Jpx8Sv4NQwsfYq/LldPTBb2EPKyzcbk7JKc5CKPcSZ3GMlYS8DpTAL94PQKfRQd8pcI/bFqUX/uwcqiCFlLFSj15UBOsiVYsif2crTrc5lKQ==", + "X-MWS-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.req b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.req new file mode 100644 index 0000000..4d1d10f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body_filepath": "./white_1x1.png" +} diff --git a/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.sig b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.sig new file mode 100644 index 0000000..ce68bd4 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/binary-body/binary-body.sig @@ -0,0 +1 @@ +HIrmHSjmK7Q91Xwm+zYvudeIV+RcOMJoEc7bUfeM6+1ReQ7tsd1ankm1BFSTy3a/iCMPx4k5F4NKxxCdCunYV5QdM51hQiJfHB6ALg1WfSnfNnZtOWZAC78R2X3709G4mozJCB0GJ3ERm5GMUiL4ncuGz4wWuw3RGJHDwcFH7F55NnCgdL2nBJ8e0MLGGaDd8np8Kk0HQOyAT867t+g0/SHR7ZN/cfQILtdFKmMRC0Jpx8Sv4NQwsfYq/LldPTBb2EPKyzcbk7JKc5CKPcSZ3GMlYS8DpTAL94PQKfRQd8pcI/bFqUX/uwcqiCFlLFSj15UBOsiVYsif2crTrc5lKQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/binary-body/readme.md b/mauth-protocol-test-suite/protocols/MWS/binary-body/readme.md new file mode 100644 index 0000000..b802682 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/binary-body/readme.md @@ -0,0 +1,2 @@ +This case for binary request bodies is slightly different than the other cases. mAuth clients running this test should read in the [blank.jpeg](./blank.jpeg) file as the request body. +The `.sts` file is intentionally omitted because the MWS protocol uses the binary request body itself as a part of the `string_to_sign`. diff --git a/mauth-protocol-test-suite/protocols/MWS/binary-body/white_1x1.png b/mauth-protocol-test-suite/protocols/MWS/binary-body/white_1x1.png new file mode 100644 index 0000000..3d95bc8 Binary files /dev/null and b/mauth-protocol-test-suite/protocols/MWS/binary-body/white_1x1.png differ diff --git a/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.authz b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.authz new file mode 100644 index 0000000..a20099f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.authz @@ -0,0 +1,4 @@ +{ + "X-MWS-Authentication": "MWS 836a454e-7f14-4192-8f5a-2a9d3d66f70c:gFXLfvetWAf7UhpcVjre+JoWrMj8+Oy9LhcVrbKWEhW8Etga6aFtSmh760bHouJ7CAWkUjYfDtdXznOSjeqXTygbi+i+5Id63mndkMhR2O/WmsWHms/otUx8DsKQH9GdmuhftCs1xIR3LDtzSH8O1bJNdz3+O6Qg7/jXttb+ib5xnytvbKbK5yV1GIh07pgMlPJ0bYpk/21lVMHEGhNW1ZUejumlaqz+OUJqREfX5ZX2hkOy2mnCqzP/b4azvM0/W3muRr7yPYNpRLUiycze84652R45ogz7ofL5ixEFTaKv6p2DEIm7ya5dYgX9BJ8nnHXDjGVGOVTjccfFOWVy+g==", + "X-MWS-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.req b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.req new file mode 100644 index 0000000..e2eda61 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sig b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sig new file mode 100644 index 0000000..e7b0543 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sig @@ -0,0 +1 @@ +gFXLfvetWAf7UhpcVjre+JoWrMj8+Oy9LhcVrbKWEhW8Etga6aFtSmh760bHouJ7CAWkUjYfDtdXznOSjeqXTygbi+i+5Id63mndkMhR2O/WmsWHms/otUx8DsKQH9GdmuhftCs1xIR3LDtzSH8O1bJNdz3+O6Qg7/jXttb+ib5xnytvbKbK5yV1GIh07pgMlPJ0bYpk/21lVMHEGhNW1ZUejumlaqz+OUJqREfX5ZX2hkOy2mnCqzP/b4azvM0/W3muRr7yPYNpRLUiycze84652R45ogz7ofL5ixEFTaKv6p2DEIm7ya5dYgX9BJ8nnHXDjGVGOVTjccfFOWVy+g== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sts b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sts new file mode 100644 index 0000000..ad7e426 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-unreserved/get-unreserved.sts @@ -0,0 +1,5 @@ +GET +/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz + +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.authz b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.authz new file mode 100644 index 0000000..10b5b9e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.authz @@ -0,0 +1,4 @@ +{ + "X-MWS-Authentication": "MWS 836a454e-7f14-4192-8f5a-2a9d3d66f70c:MPm21IiAVd/mkeVRKsPJOQG6tFa55n/aGNxsUdpfwQJYESGDcqvNda0gG3QuOgsYdgKI8OjgWuhpCQEExb101uS90KVkWXwcuRt/AFtgswTkt0pkE5PHrrCFz/rbcGNnY3BtI37TBBfQqTVx406B0PRHLkKU2898hhRM1yzeLE/HHCY2zNR9nlgmm2dIBhxltCfHSLRtc7ACecSsWh5s3mgrSRxvOfQpzIRKmbChP9B9Ltq3Iv/Cmt3CxX0bPdxW1vn17L/KITqu5bnggDDeDKFJUMm8cMBQYQAlfVpZKfcC9EamRKGTrdE4JcQEAX46G1RvWAnG/40rAFhOKOdkLg==", + "X-MWS-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.req b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.req new file mode 100644 index 0000000..dd3d13f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sig b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sig new file mode 100644 index 0000000..e9b2afa --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sig @@ -0,0 +1 @@ +MPm21IiAVd/mkeVRKsPJOQG6tFa55n/aGNxsUdpfwQJYESGDcqvNda0gG3QuOgsYdgKI8OjgWuhpCQEExb101uS90KVkWXwcuRt/AFtgswTkt0pkE5PHrrCFz/rbcGNnY3BtI37TBBfQqTVx406B0PRHLkKU2898hhRM1yzeLE/HHCY2zNR9nlgmm2dIBhxltCfHSLRtc7ACecSsWh5s3mgrSRxvOfQpzIRKmbChP9B9Ltq3Iv/Cmt3CxX0bPdxW1vn17L/KITqu5bnggDDeDKFJUMm8cMBQYQAlfVpZKfcC9EamRKGTrdE4JcQEAX46G1RvWAnG/40rAFhOKOdkLg== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sts b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sts new file mode 100644 index 0000000..cbf5b4f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/get-vanilla/get-vanilla.sts @@ -0,0 +1,5 @@ +GET +/ + +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.authz b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.authz new file mode 100644 index 0000000..ed58118 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.authz @@ -0,0 +1,4 @@ +{ + "X-MWS-Authentication": "MWS 836a454e-7f14-4192-8f5a-2a9d3d66f70c:3sZcrtMcRGq7OtpJaSE1+I0P69HPhpWKShJi7l08LoQF2BvNojUzJq7a6Dvn/97VXV6waYEn6xUjAd3+kOqLB5a92J10z58gtj+WkwcfwuynAeUInFn6k2p+/I9YON5e4JeqzmFGNOo79xlRFcHJkrVfE9I5SISfQnL1a8KX21yZky0Ol7P7qrbj0tl1DhIHb49Gy2M4/N5LTz6x8NghkoO5IH66+HJyRiJ6kIIEGYI8SAVARC2tjIKbOZdDjCOqNLJneNxvH+zbthBeVvGTvsoNDurXeLKmAsG96bUg5ATZo2eXea9BbBDBP8oZX6e3QR1SQ0wY9jF4VZY2wg3Ang==", + "X-MWS-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.req b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.req new file mode 100644 index 0000000..d731ce5 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body": "{}" +} diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sig b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sig new file mode 100644 index 0000000..37ebeff --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sig @@ -0,0 +1 @@ +3sZcrtMcRGq7OtpJaSE1+I0P69HPhpWKShJi7l08LoQF2BvNojUzJq7a6Dvn/97VXV6waYEn6xUjAd3+kOqLB5a92J10z58gtj+WkwcfwuynAeUInFn6k2p+/I9YON5e4JeqzmFGNOo79xlRFcHJkrVfE9I5SISfQnL1a8KX21yZky0Ol7P7qrbj0tl1DhIHb49Gy2M4/N5LTz6x8NghkoO5IH66+HJyRiJ6kIIEGYI8SAVARC2tjIKbOZdDjCOqNLJneNxvH+zbthBeVvGTvsoNDurXeLKmAsG96bUg5ATZo2eXea9BbBDBP8oZX6e3QR1SQ0wY9jF4VZY2wg3Ang== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sts b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sts new file mode 100644 index 0000000..7de271e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body-empty/post-vanilla-body-empty.sts @@ -0,0 +1,5 @@ +POST +/ +{} +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.authz b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.authz new file mode 100644 index 0000000..cc71c9c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.authz @@ -0,0 +1,4 @@ +{ + "X-MWS-Authentication": "MWS 836a454e-7f14-4192-8f5a-2a9d3d66f70c:0AZItNlEpsZAtAOEZ43KjHlxDvD/q/oVLYsvXYzFJrL8wa4KkPm1wm1BVdP/mlIW/opJYVXAfqTxKi8yBJ11BWLLHd/QDBJ4K/hXK+x0M3QBrFVNPlLaDx5cJshZzxMvNxCm7r+BnnNIZZykSVZ3lTJEiur0oK3St+tNbMFzutry3DF+vRH04dcjwl3JFsWUZyaX/AFV5Llt3Fq8rOOf1va1i5ePZqEWBnWDahE/oAKXDnYvRxxje4daWraKBt5PbkOzqpfA676XvgodQ+ajqbvo+8qaBha7gPixqOD5T+YiupBL5cvQdgI4t3nKBIbRUgDt5q/nYdN6hKlk+YWKTQ==", + "X-MWS-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.req b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.req new file mode 100644 index 0000000..ddd3aed --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body": "request body string" +} diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sig b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sig new file mode 100644 index 0000000..b99194b --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sig @@ -0,0 +1 @@ +0AZItNlEpsZAtAOEZ43KjHlxDvD/q/oVLYsvXYzFJrL8wa4KkPm1wm1BVdP/mlIW/opJYVXAfqTxKi8yBJ11BWLLHd/QDBJ4K/hXK+x0M3QBrFVNPlLaDx5cJshZzxMvNxCm7r+BnnNIZZykSVZ3lTJEiur0oK3St+tNbMFzutry3DF+vRH04dcjwl3JFsWUZyaX/AFV5Llt3Fq8rOOf1va1i5ePZqEWBnWDahE/oAKXDnYvRxxje4daWraKBt5PbkOzqpfA676XvgodQ+ajqbvo+8qaBha7gPixqOD5T+YiupBL5cvQdgI4t3nKBIbRUgDt5q/nYdN6hKlk+YWKTQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sts b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sts new file mode 100644 index 0000000..460ef09 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWS/post-vanilla-body/post-vanilla-body.sts @@ -0,0 +1,5 @@ +POST +/ +request body string +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.authz b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.authz new file mode 100644 index 0000000..c90d905 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:Wumsdgza5Ib4jibTe/whcDgN+1qV/jqcdz59+Hz0ArZYxiVNBQ+U5b33mtagh/6tTY7TsXoi/5jwvFTZ6JE1kRk+wMumVpd1zYDI0JGFbbJvE1Y7szTLomb/Hv8dYfbjXqZBjUsHfoR++QA6GSoM+8plLsXc2IaUZtII/GjDWn7yfea60V08ja4ZcqlUxN1JSpsxTFSaUhUMJMG8gyMGFIM7bb+0TlEbzLSm0tlrvg6yAWt2KQeF7ZMbt6O8BqFU5L00CF7MRF+3AbkL5rmOaKF6Q/VWYYqSVbraqyBzDi2T1d6onrXcImjHsXHbzJi/2EBQcvFmWQBhDSo8QvICzQ==;", + "MCC-Time": 1585082925 +} \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.req b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.req new file mode 100644 index 0000000..aa68e2b --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/authentication-only-after-decoding.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?ሴ=bar", + "body": null +} \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/readme.md b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/readme.md new file mode 100644 index 0000000..4a39da2 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/authentication-only-after-decoding/readme.md @@ -0,0 +1 @@ +This is an authentication only case to handle the possibility that the authenticating mAuth client may get a URL that has already been decoded by a web server. \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.authz b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.authz new file mode 100644 index 0000000..558407e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:GzqJ3TZRuaT6OjC+ghUWu3ZAn+BdWtGxnHWhG5498t05k189UzbN8iLhgE8GyMw8Z4VPYDtoSSbeCvEuF8unJL8Bwe4qFz3279z3mRFlY2q8AA2XeAV8XBlu4m/W9b4/40u4IP73/pMifJdIvfgnmrfkOYHGis64uOI/M571zcP+yewOh+vVs4oD8FXd4Wj1+C7sUngsoKne6Zu12Ft2hk6WeTOJKxduNm4hswlEMqAVg6XAa8NRjAM3TC3+1DpQSPH4cH67knsmE/jtp3ijwR8tsx1eCzE2rk7l60KVOJLY9G5R+ElNk8BTxMZ1E80amxEMRGnYiu3G+aszShztlA==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.req b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.req new file mode 100644 index 0000000..4d1d10f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body_filepath": "./white_1x1.png" +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sig b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sig new file mode 100644 index 0000000..cf6bf40 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sig @@ -0,0 +1 @@ +GzqJ3TZRuaT6OjC+ghUWu3ZAn+BdWtGxnHWhG5498t05k189UzbN8iLhgE8GyMw8Z4VPYDtoSSbeCvEuF8unJL8Bwe4qFz3279z3mRFlY2q8AA2XeAV8XBlu4m/W9b4/40u4IP73/pMifJdIvfgnmrfkOYHGis64uOI/M571zcP+yewOh+vVs4oD8FXd4Wj1+C7sUngsoKne6Zu12Ft2hk6WeTOJKxduNm4hswlEMqAVg6XAa8NRjAM3TC3+1DpQSPH4cH67knsmE/jtp3ijwR8tsx1eCzE2rk7l60KVOJLY9G5R+ElNk8BTxMZ1E80amxEMRGnYiu3G+aszShztlA== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sts b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sts new file mode 100644 index 0000000..b65cc48 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/binary-body.sts @@ -0,0 +1,5 @@ +POST +/ +c6dbd16977de74990f4db8da81393b3faccbf3f8fa80b005deec64ae8c45dcea64d5eebe287110a1b0efedd7aa9b6557a1b9172c9a148815748133a1af14d75f +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/readme.md b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/readme.md new file mode 100644 index 0000000..96b48e0 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/readme.md @@ -0,0 +1 @@ +This case for binary request bodies is slightly different than the other cases. mAuth clients running this test should read in the [blank.jpeg](./blank.jpeg) file as the request body. \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/binary-body/white_1x1.png b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/white_1x1.png new file mode 100644 index 0000000..3d95bc8 Binary files /dev/null and b/mauth-protocol-test-suite/protocols/MWSV2/binary-body/white_1x1.png differ diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.authz new file mode 100644 index 0000000..eb74467 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:yNa5TBlFcRoZwwPLwxvVD+x0eVwwMn6hY02/qI+6Vx7qtcE4hgKFyJrXNkir0f+fog3u9LoM38/DT96O4TKEMhdrTseUGN4xpsqYLajvmn0AvW5oaMh62DaB39xdZmu5QF/M69fhoLPNUpaFR3r2pmmqRf5VXHzgq5J3c2vwKyB2+7AklOqb8WLpPtNAm7bsrhxB4KRLeJF+Za+nSQK9cPX4c01FizVAomjRKwQE8QPStqllAQY8jocOqK2nHLx8dXosYD1XOoq/dMyujV/I+dRXBAnzdC0XhrP0bZUrZxnOV72G1PrsvaUEJrwFjaFAyhCN2CPCW8+91hhDuyYSgw==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.req b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.req new file mode 100644 index 0000000..dd31f61 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "//example//", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sig new file mode 100644 index 0000000..3aa689f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sig @@ -0,0 +1 @@ +yNa5TBlFcRoZwwPLwxvVD+x0eVwwMn6hY02/qI+6Vx7qtcE4hgKFyJrXNkir0f+fog3u9LoM38/DT96O4TKEMhdrTseUGN4xpsqYLajvmn0AvW5oaMh62DaB39xdZmu5QF/M69fhoLPNUpaFR3r2pmmqRf5VXHzgq5J3c2vwKyB2+7AklOqb8WLpPtNAm7bsrhxB4KRLeJF+Za+nSQK9cPX4c01FizVAomjRKwQE8QPStqllAQY8jocOqK2nHLx8dXosYD1XOoq/dMyujV/I+dRXBAnzdC0XhrP0bZUrZxnOV72G1PrsvaUEJrwFjaFAyhCN2CPCW8+91hhDuyYSgw== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sts new file mode 100644 index 0000000..8939002 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-multiple-slashes/get-normalize-multiple-slashes.sts @@ -0,0 +1,5 @@ +GET +/example/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.authz new file mode 100644 index 0000000..746a784 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:1QtqZex8dD5AgXUgu6P8544djp5axGN3acfs/1WnAnr6mHFE3OqhzZj8Iit+1/7/zUgc0Yo4r/KI9gm6pimjRiuT2zEXg+NhFYPNvb0aS2ug36pl7W4KR4KZUNigehbzUOBlyAzBeTUu0xjWe6YF/srS6Vpwpgk4XA0U6OwfmbgxoRe/ljUJTR3Aa6hEk03hgbjDIVT0m9jnkcdcNCPx8KNAX6fzjWxWds3xQQ3qJK7sr5EP4fBQdwHV9BtqBdbfSq6IBEt0SWPj7xXNkTUFyS7q8L5E8deSgZlmj6X7yCbzcFqV00vgz5So50xy6hUD848BuvvjyEb9fkM7AJdAEA==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.req b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.req new file mode 100644 index 0000000..bce2b56 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/example1/example2/../..", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sig new file mode 100644 index 0000000..8e0a0e0 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sig @@ -0,0 +1 @@ +1QtqZex8dD5AgXUgu6P8544djp5axGN3acfs/1WnAnr6mHFE3OqhzZj8Iit+1/7/zUgc0Yo4r/KI9gm6pimjRiuT2zEXg+NhFYPNvb0aS2ug36pl7W4KR4KZUNigehbzUOBlyAzBeTUu0xjWe6YF/srS6Vpwpgk4XA0U6OwfmbgxoRe/ljUJTR3Aa6hEk03hgbjDIVT0m9jnkcdcNCPx8KNAX6fzjWxWds3xQQ3qJK7sr5EP4fBQdwHV9BtqBdbfSq6IBEt0SWPj7xXNkTUFyS7q8L5E8deSgZlmj6X7yCbzcFqV00vgz5So50xy6hUD848BuvvjyEb9fkM7AJdAEA== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sts new file mode 100644 index 0000000..f82c22f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-parent-in-path/get-normalize-parent-in-path.sts @@ -0,0 +1,5 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.authz new file mode 100644 index 0000000..eb74467 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:yNa5TBlFcRoZwwPLwxvVD+x0eVwwMn6hY02/qI+6Vx7qtcE4hgKFyJrXNkir0f+fog3u9LoM38/DT96O4TKEMhdrTseUGN4xpsqYLajvmn0AvW5oaMh62DaB39xdZmu5QF/M69fhoLPNUpaFR3r2pmmqRf5VXHzgq5J3c2vwKyB2+7AklOqb8WLpPtNAm7bsrhxB4KRLeJF+Za+nSQK9cPX4c01FizVAomjRKwQE8QPStqllAQY8jocOqK2nHLx8dXosYD1XOoq/dMyujV/I+dRXBAnzdC0XhrP0bZUrZxnOV72G1PrsvaUEJrwFjaFAyhCN2CPCW8+91hhDuyYSgw==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.req b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.req new file mode 100644 index 0000000..5b7015f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/./example/", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sig new file mode 100644 index 0000000..3aa689f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sig @@ -0,0 +1 @@ +yNa5TBlFcRoZwwPLwxvVD+x0eVwwMn6hY02/qI+6Vx7qtcE4hgKFyJrXNkir0f+fog3u9LoM38/DT96O4TKEMhdrTseUGN4xpsqYLajvmn0AvW5oaMh62DaB39xdZmu5QF/M69fhoLPNUpaFR3r2pmmqRf5VXHzgq5J3c2vwKyB2+7AklOqb8WLpPtNAm7bsrhxB4KRLeJF+Za+nSQK9cPX4c01FizVAomjRKwQE8QPStqllAQY8jocOqK2nHLx8dXosYD1XOoq/dMyujV/I+dRXBAnzdC0XhrP0bZUrZxnOV72G1PrsvaUEJrwFjaFAyhCN2CPCW8+91hhDuyYSgw== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sts new file mode 100644 index 0000000..8939002 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-normalize-self-in-path/get-normalize-self-in-path.sts @@ -0,0 +1,5 @@ +GET +/example/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.authz new file mode 100644 index 0000000..053ff7a --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication":"MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:2bIcLieLjEQWpCquR7X6b74vP5sl0IIoPNPfrotF8DR24clNoq9Qr31aJjSLwEqxz+UCdv9TK9GOyZLvLH8JsXFFSwMu1TKInF3knZRQH4dsIBXuWuTlbfYu/dXFYdOeV36oCXUBWfsX7ixoLEzdEmtzobwavLIHLIxYv9iUU1vhQ4UCfBga7ekay/g/az8fVInwrPkgErFsDOCaTwJ9mAJ0pp20qPRPgMZEbflpWy9DGo89qRihSz5iDV9949W6LVj1bfsfNoxdXgK9fYxz84NhqghkWMx0TL4alKWJrvXCN4yj6+dRjx9Vv36+iCvSROVGQVxEP2WAcYro6DH6Ug==;", + "MCC-Time":1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.req b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.req new file mode 100644 index 0000000..e2eda61 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sig new file mode 100644 index 0000000..4f988e4 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sig @@ -0,0 +1 @@ +2bIcLieLjEQWpCquR7X6b74vP5sl0IIoPNPfrotF8DR24clNoq9Qr31aJjSLwEqxz+UCdv9TK9GOyZLvLH8JsXFFSwMu1TKInF3knZRQH4dsIBXuWuTlbfYu/dXFYdOeV36oCXUBWfsX7ixoLEzdEmtzobwavLIHLIxYv9iUU1vhQ4UCfBga7ekay/g/az8fVInwrPkgErFsDOCaTwJ9mAJ0pp20qPRPgMZEbflpWy9DGo89qRihSz5iDV9949W6LVj1bfsfNoxdXgK9fYxz84NhqghkWMx0TL4alKWJrvXCN4yj6+dRjx9Vv36+iCvSROVGQVxEP2WAcYro6DH6Ug== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sts new file mode 100644 index 0000000..9a629e5 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-unreserved/get-unreserved.sts @@ -0,0 +1,5 @@ +GET +/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.authz new file mode 100644 index 0000000..af37e64 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:qCMdbOuvixBxDZ5oSnImtwCiy1OwKjldCrmCYOQYSmXLDpqg+/IB2IvvEvIuTuRhaSD09gA2vRBtmhv4GnZPXaeqU3+XvEg/8WcI0U2K8L7e0psE96sY2hE7MjZIvtjmdEkaUEkdKMJERMhdVipNFoeZk8qKLhSB+Qif3K6zrWyydvkhq/IYC1MTexkR2fl2b03VqaceD9d9mqyuIMl3MYLJlzGRfuIUZtB3X1vlsW/tyy656rJIvU4Mw/ImLo8xn6buhoJ8dlBhzggv4hfp0TvnyA3L2OIJ9gSrT95Gykl8jm2qsedFxRK43kLmm+3u1rzfrxgWL5l3szCtYFWEVA==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.req b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.req new file mode 100644 index 0000000..74aaf7d --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/%cf%80", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sig new file mode 100644 index 0000000..c85de20 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sig @@ -0,0 +1 @@ +qCMdbOuvixBxDZ5oSnImtwCiy1OwKjldCrmCYOQYSmXLDpqg+/IB2IvvEvIuTuRhaSD09gA2vRBtmhv4GnZPXaeqU3+XvEg/8WcI0U2K8L7e0psE96sY2hE7MjZIvtjmdEkaUEkdKMJERMhdVipNFoeZk8qKLhSB+Qif3K6zrWyydvkhq/IYC1MTexkR2fl2b03VqaceD9d9mqyuIMl3MYLJlzGRfuIUZtB3X1vlsW/tyy656rJIvU4Mw/ImLo8xn6buhoJ8dlBhzggv4hfp0TvnyA3L2OIJ9gSrT95Gykl8jm2qsedFxRK43kLmm+3u1rzfrxgWL5l3szCtYFWEVA== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sts new file mode 100644 index 0000000..a33ff0a --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-utf8-normalize-case/get-utf8-normalize-case.sts @@ -0,0 +1,5 @@ +GET +/%CF%80 +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.authz new file mode 100644 index 0000000..d7a09c1 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:33M+uDemy89PkTYi+vhTu5bfRtqpqPSFslPZdjAkAg5L32kPS9zIyw66t1ji4S5O1zj4lXL0sKM06H50vyQrAg06eoJRQ5iNMFuwkh0n/z6Ufq+L+/mOxNn0AAhSEbOqrMe4QbBnSbJsrY1tYey298WQ/1NIu3kRXVaru4Ncl1rly5LVwtXCsvk/Y4NqQS+LAtQecwTl3P1XykFG0YqKjcdGdywFgNr6RdipdJZYKMVzcdhDYP3UTOtMdzvU2pJ55AHbrQWMLGYs4pjKJAiHBV//AGEWXkGcoeO4+RkAu3AvfnrkB/JXgLXQW2xDSRScS8KvHdadFJzvH+I9wxWH4g==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.req new file mode 100644 index 0000000..be80343 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?k=%7E", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sig new file mode 100644 index 0000000..a66e93b --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sig @@ -0,0 +1 @@ +33M+uDemy89PkTYi+vhTu5bfRtqpqPSFslPZdjAkAg5L32kPS9zIyw66t1ji4S5O1zj4lXL0sKM06H50vyQrAg06eoJRQ5iNMFuwkh0n/z6Ufq+L+/mOxNn0AAhSEbOqrMe4QbBnSbJsrY1tYey298WQ/1NIu3kRXVaru4Ncl1rly5LVwtXCsvk/Y4NqQS+LAtQecwTl3P1XykFG0YqKjcdGdywFgNr6RdipdJZYKMVzcdhDYP3UTOtMdzvU2pJ55AHbrQWMLGYs4pjKJAiHBV//AGEWXkGcoeO4+RkAu3AvfnrkB/JXgLXQW2xDSRScS8KvHdadFJzvH+I9wxWH4g== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sts new file mode 100644 index 0000000..ae19161 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-encoded-tilde/get-vanilla-query-encoded-tilde.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +k=~ \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.authz new file mode 100644 index 0000000..382667c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:iOpmok3/N4wsf3YxL7cX44rempQDMUIn4DaGSs4ztZFruh7ptGcFM6I4fwiSZXbbmeNpN9XHXiaTz27bP/LrsFDIhFBN3GFwAL1ndpaO7eN76IfnaI46haNaEMGmRDf3mV/7Q6ChR8B/5DH6cbNgGsIAwes92xXp3yn25DKHT1puKu8XKxVRQ3D0zKV19Knc4AKgXM642RYc5q8Jqb4BFheq+PxmcoVgmeZXXN43zx3/YRlqETD4u3ATKjIwJSh3bFNRxC4PO4qPhR5BrHMxVHdUmue1+ynCEdYB8bt2K/uw3oGsYUCLZPRWHUuY5yWeTILhfKmXHqB94NVVX1ZBxw==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.req new file mode 100644 index 0000000..53142f3 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?key=a&key=", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sig new file mode 100644 index 0000000..aeaa076 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sig @@ -0,0 +1 @@ +iOpmok3/N4wsf3YxL7cX44rempQDMUIn4DaGSs4ztZFruh7ptGcFM6I4fwiSZXbbmeNpN9XHXiaTz27bP/LrsFDIhFBN3GFwAL1ndpaO7eN76IfnaI46haNaEMGmRDf3mV/7Q6ChR8B/5DH6cbNgGsIAwes92xXp3yn25DKHT1puKu8XKxVRQ3D0zKV19Knc4AKgXM642RYc5q8Jqb4BFheq+PxmcoVgmeZXXN43zx3/YRlqETD4u3ATKjIwJSh3bFNRxC4PO4qPhR5BrHMxVHdUmue1+ynCEdYB8bt2K/uw3oGsYUCLZPRWHUuY5yWeTILhfKmXHqB94NVVX1ZBxw== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sts new file mode 100644 index 0000000..eb5a1fd --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-no-value/get-vanilla-query-no-value.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +key=&key=a \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.authz new file mode 100644 index 0000000..7276879 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:acWV/VV/YuJ2Ze9hXM4vTshiFGCEi/WZCPTwC22JpiGLL/SKzU0EYQ0ZrTdMfXjGos1hWie+qpCgsr9XZZfq9RzJrSfPG7B5zZJft1OS+leZp/ie8UYMI8zg+ZnDXZ4egcQQEqm+8qpyzgbLqGs3R2GUCAJq5Cbc0VIcOyQYUpsbpJpy+DDGceIq5F1L3VoyLap+2vRFq6fe4J1e1ryzljX14N4voUsTeIsUFL+Mk4mdfECKOXFHeMR88K7e7VwIUHQ2jwrYbeWQ3XHKxYlVnRj+7CAAVwgiwPLK7/9YqfbCYufPOzQJufgkYD4L27JarzIsNRpJn4AIf4bpCCpkcw==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.req new file mode 100644 index 0000000..c0ff36e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?%c2%b1=val&%C2%B2=val&c=val&C=val", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sig new file mode 100644 index 0000000..bcb3b13 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sig @@ -0,0 +1 @@ +acWV/VV/YuJ2Ze9hXM4vTshiFGCEi/WZCPTwC22JpiGLL/SKzU0EYQ0ZrTdMfXjGos1hWie+qpCgsr9XZZfq9RzJrSfPG7B5zZJft1OS+leZp/ie8UYMI8zg+ZnDXZ4egcQQEqm+8qpyzgbLqGs3R2GUCAJq5Cbc0VIcOyQYUpsbpJpy+DDGceIq5F1L3VoyLap+2vRFq6fe4J1e1ryzljX14N4voUsTeIsUFL+Mk4mdfECKOXFHeMR88K7e7VwIUHQ2jwrYbeWQ3XHKxYlVnRj+7CAAVwgiwPLK7/9YqfbCYufPOzQJufgkYD4L27JarzIsNRpJn4AIf4bpCCpkcw== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sts new file mode 100644 index 0000000..c71ba74 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-key-ordering/get-vanilla-query-param-key-ordering.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +C=val&c=val&%C2%B1=val&%C2%B2=val \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.authz new file mode 100644 index 0000000..34a3d06 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:wcxEbXT2VmlsF8dhzaJn4f96xNrohJinuR/Wb1zzOiQ9oHq13DJVBQ9TUhYr1PfTSSDSC9ZhKkdnLMR74+uRtpiCq7B/Yz7Y0fXFVZh8dvk/tERnqzK9z3VgPJzD5jRYpOrSAuohdM/EO+U75VYVMknd2vWa6gvWv3cpxwSl4c2RtrFoYnG/0zl5sQJOt7fXFgBu/HmtkzMLD+w0SH9gaY+HmVN5WeZQ8YHFKol4SBNfa+qj/L37xY4m9N8pDlG/BTl0rsg+2wwm7H5+of8+b+cDU8KHsmiUG8hUqod/jSacNFw35/76m3b4FU/yf9bT5VWq/KSaUpN0jBB0PSwUeQ==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.req new file mode 100644 index 0000000..66b761c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?key=%C2%A3&key=%c2%a2&key=C&key=c", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sig new file mode 100644 index 0000000..e1a988d --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sig @@ -0,0 +1 @@ +wcxEbXT2VmlsF8dhzaJn4f96xNrohJinuR/Wb1zzOiQ9oHq13DJVBQ9TUhYr1PfTSSDSC9ZhKkdnLMR74+uRtpiCq7B/Yz7Y0fXFVZh8dvk/tERnqzK9z3VgPJzD5jRYpOrSAuohdM/EO+U75VYVMknd2vWa6gvWv3cpxwSl4c2RtrFoYnG/0zl5sQJOt7fXFgBu/HmtkzMLD+w0SH9gaY+HmVN5WeZQ8YHFKol4SBNfa+qj/L37xY4m9N8pDlG/BTl0rsg+2wwm7H5+of8+b+cDU8KHsmiUG8hUqod/jSacNFw35/76m3b4FU/yf9bT5VWq/KSaUpN0jBB0PSwUeQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sts new file mode 100644 index 0000000..8b0e0bb --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-param-value-ordering/get-vanilla-query-param-value-ordering.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +key=C&key=c&key=%C2%A2&key=%C2%A3 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.authz new file mode 100644 index 0000000..fbfc203 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:u3lxfCNnZr9rysjQY8lcV/Gvq7COc+CFVChHRjkhvtsVrUtxvKjRf7oj9ntbXj8fmhoz66D9hMSt9J0rN0lE2YpC6n8hut8q+t1ymfkcgQHZuuAFJTFTeUYitagoICsgMOT+x1I1wAjsmRr+bG0LcONMSgbBUDaWBYs3RbEfuLC85OsQB/SKwXrcsfqePbtNjuIp9j2Hiaxw4/R64exEOll8aaaw2OdB4fFROIowXU/mkSrsDV0bvdSkOWRxf+IuPwsttS/XxFdYXDte1dS9vcvMN9wpk/h7uqmFSiynFfr1W3VQod0+1bVxji5cvhYT8IgbmUr+c9o86PwdD4/+Gg==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.req new file mode 100644 index 0000000..89582ca --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?k=a b&k=a+b&k=a%20b", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sig new file mode 100644 index 0000000..574165a --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sig @@ -0,0 +1 @@ +u3lxfCNnZr9rysjQY8lcV/Gvq7COc+CFVChHRjkhvtsVrUtxvKjRf7oj9ntbXj8fmhoz66D9hMSt9J0rN0lE2YpC6n8hut8q+t1ymfkcgQHZuuAFJTFTeUYitagoICsgMOT+x1I1wAjsmRr+bG0LcONMSgbBUDaWBYs3RbEfuLC85OsQB/SKwXrcsfqePbtNjuIp9j2Hiaxw4/R64exEOll8aaaw2OdB4fFROIowXU/mkSrsDV0bvdSkOWRxf+IuPwsttS/XxFdYXDte1dS9vcvMN9wpk/h7uqmFSiynFfr1W3VQod0+1bVxji5cvhYT8IgbmUr+c9o86PwdD4/+Gg== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sts new file mode 100644 index 0000000..4585393 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-space/get-vanilla-query-space.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +k=a%20b&k=a%20b&k=a%20b \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz new file mode 100644 index 0000000..10b118b --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:ep5HaLYSq5khDN09WIfAtsiRa55AsPPW0D64LEiRjW03UHVjzN1kciCC11kx2P3rxewcpMWodikGTI37slpiFYdJ4/j5vEO+BbXTje2NCFOBOwoN0MCAqPm0i5DloSO9uVXuVmOnwbjCVUBI0RUjG43zFUl5/mNylgZnKx2kK/iXN8JyqBPb5l6p7vZ6C9tLbAPage9b/5swEhvSOJlfxAuHAF7u3GhhY0uEaz2i1V3R8ZSxQtTwvU4lf7lOBNL1iY5yhwuuRaw6CUteEMQse+4/D184jY9oiXk43aL0tnzwASkd+wURMOqt68iWUXIwuA7ipiwDbxQ4o5JMR5tiwQ==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req new file mode 100644 index 0000000..548ff0a --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sig new file mode 100644 index 0000000..44fd333 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sig @@ -0,0 +1 @@ +ep5HaLYSq5khDN09WIfAtsiRa55AsPPW0D64LEiRjW03UHVjzN1kciCC11kx2P3rxewcpMWodikGTI37slpiFYdJ4/j5vEO+BbXTje2NCFOBOwoN0MCAqPm0i5DloSO9uVXuVmOnwbjCVUBI0RUjG43zFUl5/mNylgZnKx2kK/iXN8JyqBPb5l6p7vZ6C9tLbAPage9b/5swEhvSOJlfxAuHAF7u3GhhY0uEaz2i1V3R8ZSxQtTwvU4lf7lOBNL1iY5yhwuuRaw6CUteEMQse+4/D184jY9oiXk43aL0tnzwASkd+wURMOqt68iWUXIwuA7ipiwDbxQ4o5JMR5tiwQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts new file mode 100644 index 0000000..0b7f682 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.authz new file mode 100644 index 0000000..837169e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:Wumsdgza5Ib4jibTe/whcDgN+1qV/jqcdz59+Hz0ArZYxiVNBQ+U5b33mtagh/6tTY7TsXoi/5jwvFTZ6JE1kRk+wMumVpd1zYDI0JGFbbJvE1Y7szTLomb/Hv8dYfbjXqZBjUsHfoR++QA6GSoM+8plLsXc2IaUZtII/GjDWn7yfea60V08ja4ZcqlUxN1JSpsxTFSaUhUMJMG8gyMGFIM7bb+0TlEbzLSm0tlrvg6yAWt2KQeF7ZMbt6O8BqFU5L00CF7MRF+3AbkL5rmOaKF6Q/VWYYqSVbraqyBzDi2T1d6onrXcImjHsXHbzJi/2EBQcvFmWQBhDSo8QvICzQ==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.req new file mode 100644 index 0000000..bd88e65 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?%e1%88%b4=bar", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sig new file mode 100644 index 0000000..2fd7d01 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sig @@ -0,0 +1 @@ +Wumsdgza5Ib4jibTe/whcDgN+1qV/jqcdz59+Hz0ArZYxiVNBQ+U5b33mtagh/6tTY7TsXoi/5jwvFTZ6JE1kRk+wMumVpd1zYDI0JGFbbJvE1Y7szTLomb/Hv8dYfbjXqZBjUsHfoR++QA6GSoM+8plLsXc2IaUZtII/GjDWn7yfea60V08ja4ZcqlUxN1JSpsxTFSaUhUMJMG8gyMGFIM7bb+0TlEbzLSm0tlrvg6yAWt2KQeF7ZMbt6O8BqFU5L00CF7MRF+3AbkL5rmOaKF6Q/VWYYqSVbraqyBzDi2T1d6onrXcImjHsXHbzJi/2EBQcvFmWQBhDSo8QvICzQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sts new file mode 100644 index 0000000..195d2e8 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8-normalize-case/get-vanilla-query-utf8-normalize-case.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +%E1%88%B4=bar \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.authz new file mode 100644 index 0000000..837169e --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:Wumsdgza5Ib4jibTe/whcDgN+1qV/jqcdz59+Hz0ArZYxiVNBQ+U5b33mtagh/6tTY7TsXoi/5jwvFTZ6JE1kRk+wMumVpd1zYDI0JGFbbJvE1Y7szTLomb/Hv8dYfbjXqZBjUsHfoR++QA6GSoM+8plLsXc2IaUZtII/GjDWn7yfea60V08ja4ZcqlUxN1JSpsxTFSaUhUMJMG8gyMGFIM7bb+0TlEbzLSm0tlrvg6yAWt2KQeF7ZMbt6O8BqFU5L00CF7MRF+3AbkL5rmOaKF6Q/VWYYqSVbraqyBzDi2T1d6onrXcImjHsXHbzJi/2EBQcvFmWQBhDSo8QvICzQ==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.req new file mode 100644 index 0000000..aa52ec5 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/?%E1%88%B4=bar", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sig new file mode 100644 index 0000000..2fd7d01 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sig @@ -0,0 +1 @@ +Wumsdgza5Ib4jibTe/whcDgN+1qV/jqcdz59+Hz0ArZYxiVNBQ+U5b33mtagh/6tTY7TsXoi/5jwvFTZ6JE1kRk+wMumVpd1zYDI0JGFbbJvE1Y7szTLomb/Hv8dYfbjXqZBjUsHfoR++QA6GSoM+8plLsXc2IaUZtII/GjDWn7yfea60V08ja4ZcqlUxN1JSpsxTFSaUhUMJMG8gyMGFIM7bb+0TlEbzLSm0tlrvg6yAWt2KQeF7ZMbt6O8BqFU5L00CF7MRF+3AbkL5rmOaKF6Q/VWYYqSVbraqyBzDi2T1d6onrXcImjHsXHbzJi/2EBQcvFmWQBhDSo8QvICzQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sts new file mode 100644 index 0000000..195d2e8 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla-query-utf8/get-vanilla-query-utf8.sts @@ -0,0 +1,6 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +%E1%88%B4=bar \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.authz b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.authz new file mode 100644 index 0000000..746a784 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:1QtqZex8dD5AgXUgu6P8544djp5axGN3acfs/1WnAnr6mHFE3OqhzZj8Iit+1/7/zUgc0Yo4r/KI9gm6pimjRiuT2zEXg+NhFYPNvb0aS2ug36pl7W4KR4KZUNigehbzUOBlyAzBeTUu0xjWe6YF/srS6Vpwpgk4XA0U6OwfmbgxoRe/ljUJTR3Aa6hEk03hgbjDIVT0m9jnkcdcNCPx8KNAX6fzjWxWds3xQQ3qJK7sr5EP4fBQdwHV9BtqBdbfSq6IBEt0SWPj7xXNkTUFyS7q8L5E8deSgZlmj6X7yCbzcFqV00vgz5So50xy6hUD848BuvvjyEb9fkM7AJdAEA==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.req b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.req new file mode 100644 index 0000000..dd3d13f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.req @@ -0,0 +1,5 @@ +{ + "verb": "GET", + "url": "/", + "body": null +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sig b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sig new file mode 100644 index 0000000..8e0a0e0 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sig @@ -0,0 +1 @@ +1QtqZex8dD5AgXUgu6P8544djp5axGN3acfs/1WnAnr6mHFE3OqhzZj8Iit+1/7/zUgc0Yo4r/KI9gm6pimjRiuT2zEXg+NhFYPNvb0aS2ug36pl7W4KR4KZUNigehbzUOBlyAzBeTUu0xjWe6YF/srS6Vpwpgk4XA0U6OwfmbgxoRe/ljUJTR3Aa6hEk03hgbjDIVT0m9jnkcdcNCPx8KNAX6fzjWxWds3xQQ3qJK7sr5EP4fBQdwHV9BtqBdbfSq6IBEt0SWPj7xXNkTUFyS7q8L5E8deSgZlmj6X7yCbzcFqV00vgz5So50xy6hUD848BuvvjyEb9fkM7AJdAEA== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sts b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sts new file mode 100644 index 0000000..f82c22f --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/get-vanilla/get-vanilla.sts @@ -0,0 +1,5 @@ +GET +/ +cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.authz b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.authz new file mode 100644 index 0000000..e4f89da --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:y1RyYvlUC0ckoaOq9AOh2Azga3hCzVpAGcnhQg9goQ8ClKBc9CYC9gv8hhl/bA4mzvIn8MLqEU/39WJz9Dl88c1VRF19KwG8WIaNd2aly3VgZ64A0+jOLRpF5zypemHShbhVsOa5b1wLvWkTNIO04KrFH9PaPMMLSES6NwiWKif/ndMYkgKQ81XNmfzXOY3pIJuzEc3NbEmJhzBhTW2JRRAXeBhtNaz8vg7YAVLXsWE/BnoF0Lx9qgz9qkIBz/fTDYOBJDo8Mgoi/H7Xps7SXr/Bu65CZ4asMWn1Um/rbtzFUFjG/PBIaXVDqfcaCrtvjAQww3i+D2aDBXPXLjfXsg==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.req b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.req new file mode 100644 index 0000000..d731ce5 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body": "{}" +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sig b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sig new file mode 100644 index 0000000..10576f9 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sig @@ -0,0 +1 @@ +y1RyYvlUC0ckoaOq9AOh2Azga3hCzVpAGcnhQg9goQ8ClKBc9CYC9gv8hhl/bA4mzvIn8MLqEU/39WJz9Dl88c1VRF19KwG8WIaNd2aly3VgZ64A0+jOLRpF5zypemHShbhVsOa5b1wLvWkTNIO04KrFH9PaPMMLSES6NwiWKif/ndMYkgKQ81XNmfzXOY3pIJuzEc3NbEmJhzBhTW2JRRAXeBhtNaz8vg7YAVLXsWE/BnoF0Lx9qgz9qkIBz/fTDYOBJDo8Mgoi/H7Xps7SXr/Bu65CZ4asMWn1Um/rbtzFUFjG/PBIaXVDqfcaCrtvjAQww3i+D2aDBXPXLjfXsg== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sts b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sts new file mode 100644 index 0000000..8e9f5bf --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-empty/post-vanilla-body-empty.sts @@ -0,0 +1,5 @@ +POST +/ +27c74670adb75075fad058d5ceaf7b20c4e7786c83bae8a32f626f9782af34c9a33c2046ef60fd2a7878d378e29fec851806bbd9a67878f3a9f1cda4830763fd +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.authz b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.authz new file mode 100644 index 0000000..77b359c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:AeXC2JwUY+3pDX7eaFtLbuDKOsHkImJmJbBSUxq4seou1E0F/r/UlQ6teSpjJkMKgEyGRecmP86CyUZ1owQ7W91gN0zNa0aQWNlBTB0mjfXd7gUVYSFGMLas4PX48LjDBacnJI9bYLF60C24kkRLE3WIG+CccNGUWuF2E1etPt4EDlhSkvqkJUK5sWKANTg5afE1+ToxBBqBJCIzM/CnYdrOyHds9xxwNI8bMC8T2jL4zURlDOzrf+qWHVu7/M+9+AFUialXSWElytPeUPljq9U7yEdE4PB7v9l2xYaCUBP5B0rVmPD0vu0t3BiDY9VRUd2FbVwfoHwMHtF0fIVHzg==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.req b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.req new file mode 100644 index 0000000..f781474 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/?key=value&key2=value2", + "body": "request body string" +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sig b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sig new file mode 100644 index 0000000..163c02c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sig @@ -0,0 +1 @@ +AeXC2JwUY+3pDX7eaFtLbuDKOsHkImJmJbBSUxq4seou1E0F/r/UlQ6teSpjJkMKgEyGRecmP86CyUZ1owQ7W91gN0zNa0aQWNlBTB0mjfXd7gUVYSFGMLas4PX48LjDBacnJI9bYLF60C24kkRLE3WIG+CccNGUWuF2E1etPt4EDlhSkvqkJUK5sWKANTg5afE1+ToxBBqBJCIzM/CnYdrOyHds9xxwNI8bMC8T2jL4zURlDOzrf+qWHVu7/M+9+AFUialXSWElytPeUPljq9U7yEdE4PB7v9l2xYaCUBP5B0rVmPD0vu0t3BiDY9VRUd2FbVwfoHwMHtF0fIVHzg== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sts b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sts new file mode 100644 index 0000000..3ff8c6c --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body-query/post-vanilla-body-query.sts @@ -0,0 +1,6 @@ +POST +/ +7133af927e179ae0ce65174dea3ee8ae6c0c26267f8ba6f7c66e46d10775c3b6551d0e79462cdc378e67fb88ebf6987ad1a77df8885a122fa57ae30cc7d03a1c +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 +key=value&key2=value2 \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.authz b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.authz new file mode 100644 index 0000000..95cbd50 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.authz @@ -0,0 +1,4 @@ +{ + "MCC-Authentication": "MWSV2 836a454e-7f14-4192-8f5a-2a9d3d66f70c:QbPoQWK0g1j6rL6I+uoR/sCt/dqhlOf8cU3smUOskgQ5YOFOe2rsHmFZi+EEsj5dtUIByVV4EKSl9+sdnrlKRs4L3YnlZ6CNXZ2shXukk834Pwa/BJyk3xFbLhZE24+rHXs+e3sppRakRHxKaUVFKSL32j555uHTLpYZu1HAdzLeppSlvG8PJFoWnds8AaoFhr9lXglaHjPAjbV8hFil17lvFsxwtT/VFLDLz5VQ6hyRnr14vtCNF3f4M66ZpPZahnokYb5caAw2dAaE2xjorBBf+R9yoXHBgSyRSKmehtznrigfbfjHqLg59H4SO2lhhYjgdrhWJSui19dguuctwQ==;", + "MCC-Time": 1585082925 +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.req b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.req new file mode 100644 index 0000000..ddd3aed --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.req @@ -0,0 +1,5 @@ +{ + "verb": "POST", + "url": "/", + "body": "request body string" +} diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sig b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sig new file mode 100644 index 0000000..8ff5dec --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sig @@ -0,0 +1 @@ +QbPoQWK0g1j6rL6I+uoR/sCt/dqhlOf8cU3smUOskgQ5YOFOe2rsHmFZi+EEsj5dtUIByVV4EKSl9+sdnrlKRs4L3YnlZ6CNXZ2shXukk834Pwa/BJyk3xFbLhZE24+rHXs+e3sppRakRHxKaUVFKSL32j555uHTLpYZu1HAdzLeppSlvG8PJFoWnds8AaoFhr9lXglaHjPAjbV8hFil17lvFsxwtT/VFLDLz5VQ6hyRnr14vtCNF3f4M66ZpPZahnokYb5caAw2dAaE2xjorBBf+R9yoXHBgSyRSKmehtznrigfbfjHqLg59H4SO2lhhYjgdrhWJSui19dguuctwQ== \ No newline at end of file diff --git a/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sts b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sts new file mode 100644 index 0000000..be23249 --- /dev/null +++ b/mauth-protocol-test-suite/protocols/MWSV2/post-vanilla-body/post-vanilla-body.sts @@ -0,0 +1,5 @@ +POST +/ +7133af927e179ae0ce65174dea3ee8ae6c0c26267f8ba6f7c66e46d10775c3b6551d0e79462cdc378e67fb88ebf6987ad1a77df8885a122fa57ae30cc7d03a1c +836a454e-7f14-4192-8f5a-2a9d3d66f70c +1585082925 diff --git a/mauth-protocol-test-suite/signing-config.json b/mauth-protocol-test-suite/signing-config.json new file mode 100644 index 0000000..a1a074c --- /dev/null +++ b/mauth-protocol-test-suite/signing-config.json @@ -0,0 +1,5 @@ +{ + "app_uuid":"836a454e-7f14-4192-8f5a-2a9d3d66f70c", + "request_time":1585082925, + "private_key_file":"./signing-params/rsa-key" +} diff --git a/mauth-protocol-test-suite/signing-params/rsa-key b/mauth-protocol-test-suite/signing-params/rsa-key new file mode 100644 index 0000000..22172ba --- /dev/null +++ b/mauth-protocol-test-suite/signing-params/rsa-key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA5Jc1PjnaAwJD5saPPfHzB5mISY+WhDMh/i1AfT8R2vuiThbm +3mBspyP+EMV/zmDhSSRkmt3dXxZFHWWPLuTCEgnvOKWRfeOZNVpMU4bQMrom2m3u +N2Jh0IqBStPfnD8Dzwr6YUy5it9wXz+HGU2VVeY54Yn9ZJSppPtVbGUsfFM1XcqL +/FV9xFRhSCNDzfnRw1K3iaP/Ec7WuwtdizwH760+6OL0GBx4H/Qn1MQmM6cLkFX4 +gchvUUtH2Vybqa3N8VKK9o63B+SdvuosfJZyCfpRu8R7t6UuOJ33tlbvP+in4Ttn +BFSyxACZUKZyWm/oKVWheQX7CXCGnTNfyHHV8QIDAQABAoIBAF7r4zIZt8v0Dtov +rZ+dbrvDJ3LUaz4uNXlktRjNLc7vGvCuVeQVykiFi6TPPkkmtaY3tIcShjBMARs5 +5wEkAOqYsXumVQofjqk2++bbXm0SG7wsVfUtp0x/lzzJSluJVz2MY3gv8gQW0ITc +zm7VZqOq3HIpaM1xZhiaPVirkpN0+NwnCE1oMfAiBdKGo4V3WLkg3WNiN15J89Wt +LPA5Fnz6AsKJM9cBnzrpM0AeWpzOpqNEkq8mgIvTsrXKDMPEAXfJhDYUNTEhOmM7 +BEevlzPsscWqJF0Hf8xM3IGlD5c/a1soTFep8F0jTp8YIjc2N2Zid4YOv8yiimEn ++7eKUCECgYEA/bDaMEb3OSi99eXzkzSIrWqI0NO2FIP5PSMg3BIBXHn2NQQ/ep4K +k1wIDnDsfQItne/6X+SCiD1qoxfHflKOXJUOAvdumDGB+ScSeVL2CX7QzfXPOP2q +FSPUu1mIp/qqYiLFwvU7+cnmNmMo+sIsv7Bl90yM1fBUidSrKHyOrPUCgYEA5qve +FfFN8ZkV8KyqfMQo+GSqAcM8BjSk8jqb0gpDzn2X4qk+XYlLnL2sCVkkHQ6LQAqM +8gBkXXhXVcfNfpdAgYYBoRRJf7wnpbLnCal8mOZVxIvEg4Kmj0C6oO/DyZdRjQsE +LeO6XvFNITA3OQatPl22vCLRs/npq29jgIFuZ40CgYEA68K0MpNw43zadLA8GbyD +nG3aMf/eQdiYAtonin1tKGzrgz+sYp6HA4VOs2T8Ufx5OkKv8vfg2w4AkQrjSaEd +Tirzd4xNCkFQIaTPBVM09YQWNqHO747Fxpmi9G1zk3BfcY4RLWpMT4nzWO30Qn27 +qnUbfaR1acjMN78dRSXkThUCgYA+qyDaG0XOxoV0bqSe4vgyi764Xd9X3EOX355n +0Qwc9HgoR0y/Qsa9Hba4j3RFRKdGTdd/A+ZAkqo/jtngc5090zdsGMPjJS4sUU99 +i4NjUuioTkSkagFwV+icQqeRhD/OrtiC0yTWGH6Y7q2CG7NDh1hXAqqwV8xJHCkP +R5rEHQKBgBWPsjfVrPWYEiUIoUX0FzvCj8XYI2ZtUBFRFemlRB68dySyBV7Uguql +/255QJU0WBKhZxc7AXh0T7n/vp4nGah97hYiJDx8wKjXeRiwOJPLF7LwoOtlm2lH +ce0SzzHlhfb//9aAVvQNpWWHT6/fczKq91CPguKsl0h0NjJH/0OE +-----END RSA PRIVATE KEY----- diff --git a/mauth-protocol-test-suite/signing-params/rsa-key-pub b/mauth-protocol-test-suite/signing-params/rsa-key-pub new file mode 100644 index 0000000..4807399 --- /dev/null +++ b/mauth-protocol-test-suite/signing-params/rsa-key-pub @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Jc1PjnaAwJD5saPPfHz +B5mISY+WhDMh/i1AfT8R2vuiThbm3mBspyP+EMV/zmDhSSRkmt3dXxZFHWWPLuTC +EgnvOKWRfeOZNVpMU4bQMrom2m3uN2Jh0IqBStPfnD8Dzwr6YUy5it9wXz+HGU2V +VeY54Yn9ZJSppPtVbGUsfFM1XcqL/FV9xFRhSCNDzfnRw1K3iaP/Ec7WuwtdizwH +760+6OL0GBx4H/Qn1MQmM6cLkFX4gchvUUtH2Vybqa3N8VKK9o63B+SdvuosfJZy +CfpRu8R7t6UuOJ33tlbvP+in4TtnBFSyxACZUKZyWm/oKVWheQX7CXCGnTNfyHHV +8QIDAQAB +-----END PUBLIC KEY----- diff --git a/project.clj b/project.clj index c86838e..e7a48ae 100644 --- a/project.clj +++ b/project.clj @@ -1,9 +1,11 @@ -(defproject clojure-mauth-client "2.0.9-SNAPSHOT" +(defproject clojure-mauth-client "3.0.0-alpha1-SNAPSHOT" :description "Clojure Mauth Client" :url "https://github.com/mdsol/clojure-mauth-client" :license {:name "MIT" :url "https://opensource.org/licenses/MIT"} - :dependencies [[org.clojure/clojure "1.12.0"] + :dependencies [[camel-snake-kebab "0.4.3"] + [com.cnuernber/charred "1.033"] + [org.clojure/clojure "1.12.0"] [xsc/pem-reader "0.1.1"] [digest "1.4.10"] [org.clojure/data.codec "0.1.1"] @@ -11,7 +13,18 @@ [http-kit "2.4.0-alpha2"] [clj-http "3.13.0"] [org.clojure/data.json "2.5.0"] - [javax.xml.bind/jaxb-api "2.3.1"]] + [javax.xml.bind/jaxb-api "2.3.1"] + [com.mdsol/mauth-authenticator "17.0.0"] + [com.mdsol/mauth-signer "17.0.0"]] + + :profiles {:test {:dependencies [[com.mdsol/mauth-authenticator-apachehttp "17.0.0"] + [pjstadig/humane-test-output "0.8.3"]] + :injections [(require 'pjstadig.humane-test-output) + (pjstadig.humane-test-output/activate!)]}} + + :repositories [["maven-prod-virtual" {:url "https://mdsol.jfrog.io/mdsol/maven-prod-virtual" + :username :env/artifactory_username + :password :env/artifactory_password}]] :deploy-repositories [["releases" {:url "https://clojars.org/repo" @@ -26,23 +39,20 @@ ["vcs" "push"]] :aliases {"bump!" ^{:doc "Bump the project version number and push the commits to the original repository."} - ["do" - ["vcs" "assert-committed"] - ["change" "version" "leiningen.release/bump-version"] - ["vcs" "commit"] - ["vcs" "push"]]} + ["do" + ["vcs" "assert-committed"] + ["change" "version" "leiningen.release/bump-version"] + ["vcs" "commit"] + ["vcs" "push"]]} :target-path "target/%s" - :profiles {:uberjar {:aot :all - :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}} :jvm-opts ~(concat - [] ;other opts... - (if (let [v (-> (System/getProperty "java.version") - (clojure.string/split #"[.]") - first - Integer.)] - (and (>= v 9) (< v 11))) - ["--add-modules" "java.xml.bind"] - [])) - :aot :all) + [] ;other opts... + (if (let [v (-> (System/getProperty "java.version") + (clojure.string/split #"[.]") + first + Integer.)] + (and (>= v 9) (< v 11))) + ["--add-modules" "java.xml.bind"] + []))) diff --git a/src/com/mdsol/mauth/clojure/authenticator.clj b/src/com/mdsol/mauth/clojure/authenticator.clj new file mode 100644 index 0000000..b9bcc1a --- /dev/null +++ b/src/com/mdsol/mauth/clojure/authenticator.clj @@ -0,0 +1,145 @@ +(ns com.mdsol.mauth.clojure.authenticator + (:require + [clojure.string :as str] + [com.mdsol.mauth.clojure.convert :as convert] + [com.mdsol.mauth.clojure.signer :as signer]) + (:import + (clojure.lang ExceptionInfo) + (com.mdsol.mauth + Authenticator + MAuthRequest + MAuthRequest$Builder + RequestAuthenticator) + (com.mdsol.mauth.exception MAuthValidationException) + (com.mdsol.mauth.utils ClientPublicKeyProvider) + (java.net URI))) + +(set! *warn-on-reflection* true) + +;; TODO: Provide factory for using any HTTP client. For now, callers supply +;; their own ClientPublicKeyProvider impl. + +(defn- ->string ^String [x] + (if (ident? x) + (name x) + (str x))) + +(defn- mauth-request + "Constructs an `MAuthRequest` object from a Ring request map." + ^MAuthRequest [request] + (let [{:keys [request-method uri body headers query-string]} request + java-uri (URI. (str uri \? query-string)) + [t b] (convert/->bytes-or-input-stream body)] + (-> (MAuthRequest$Builder/get) + (.withHttpMethod (->string request-method)) + (.withResourcePath (.getRawPath java-uri)) + (.withQueryParameters (.getRawQuery java-uri)) + (.withMauthHeaders (-> headers + (update-keys ->string) + (update-vals ->string))) + (cond-> + ,(= :bytes t) (.withMessagePayload b) + (= :stream t) (.withBodyInputStream b)) + (.build)))) + +(defn default-authenticator + "Returns an authenticator capable of validating MAuth signatures. + + Required arguments: + - client-pk-provider: An instance of + `com.mdsol.mauth.utils.ClientPublicKeyProvider` + + Optional arguments: + - epoch-time-provider: A function which returns the current time as seconds + since the Unix epoch. Defaults to a function which returns the system clock + time. + - v2-only: If truthy, MAuth v1 requests will fail validation. Defaults to + `false`. + + The types for all of these arguments are flexible. Support for new types can + be added by extending the protocols defined in + `com.mdsol.mauth.clojure.convert`." + ^RequestAuthenticator + [& {:keys [client-pk-provider + validation-timeout-seconds + epoch-time-provider + v2-only] + :or {validation-timeout-seconds 10 + epoch-time-provider signer/current-epoch-time-provider + v2-only false}}] + (RequestAuthenticator. ^ClientPublicKeyProvider client-pk-provider + (long validation-timeout-seconds) + (convert/->epoch-time-provider epoch-time-provider) + (boolean v2-only))) + +(defn mauth-data + "Extracts key MAuth information from a Ring request and constructs a `MAuthRequest`." + [request] + (let [mauth-req (mauth-request request)] + {:app-uuid (.getAppUUID mauth-req) + :mauth-version (-> mauth-req + .getMauthVersion + .name + str/lower-case + keyword) + :mauth-request-object mauth-req})) + +(defn valid? + "Returns `true` if the request passes `authenticator`'s validation." + [^Authenticator authenticator request] + (let [mauth-req (or (:mauth-request-object request) + (:mauth-request-object (mauth-data request)))] + (.authenticate authenticator mauth-req))) + +(defn default-on-auth-failure + "Returns a static map with a 401 response." + ([_] + {:status 401 + :body {:message "Unauthorized."}}) + ;; TODO: Support async + #_([_request respond _raise] + (respond default-401))) + +(defn wrap-handler + "Middleware for handlers conforming to the Ring signature. + + Options: + - on-auth-failure: A function called when authentication fails, which should + return a response. Defaults to `default-on-auth-failure`. It receives a map + with the following keys: + - request: the request which failed authentication + - handler: the handler wrapped by this middleware + - exception: (optional) the exception thrown during validation, if any" + ([handler authenticator] + (wrap-handler handler authenticator {})) + ([handler authenticator {:keys [on-auth-failure] + :or {on-auth-failure default-on-auth-failure}}] + (fn + ([request] + (try + (let [data (try + (mauth-data request) + (catch IllegalArgumentException e + (throw (ex-info "Invalid authentication headers." + {:type ::auth-fail} + e))))] + (if (try + (valid? authenticator data) + (catch MAuthValidationException e + (throw (ex-info "Failed authentication." + {:type ::auth-fail} + e)))) + (handler (assoc request :com.mdsol.mauth/app-uuid (:app-uuid data))) + (on-auth-failure {:request request + :handler handler}))) + (catch ExceptionInfo e + (if (= ::auth-fail (:type (ex-data e))) + (on-auth-failure {:request request + :handler handler + :exception e}) + (throw e))))) + ;; TODO: Support async + #_([request respond raise] + (if (valid? authenticator request) + (handler request respond raise) + (on-auth-failure request respond raise)))))) diff --git a/src/com/mdsol/mauth/clojure/convert.clj b/src/com/mdsol/mauth/clojure/convert.clj new file mode 100644 index 0000000..addc0cc --- /dev/null +++ b/src/com/mdsol/mauth/clojure/convert.clj @@ -0,0 +1,122 @@ +(ns com.mdsol.mauth.clojure.convert + (:require + [clojure.string :as str]) + (:import + (clojure.lang IDeref IFn Keyword) + (com.mdsol.mauth MAuthVersion) + (com.mdsol.mauth.util EpochTimeProvider) + (java.io + ByteArrayInputStream + CharArrayReader + InputStream + StringReader) + (java.util UUID) + [java.util.function IntSupplier LongSupplier Supplier])) + +(set! *warn-on-reflection* true) + +(defprotocol UUIDLike + (as-uuid [this])) + +(extend-protocol UUIDLike + UUID + (as-uuid [this] this) + String + (as-uuid [this] (parse-uuid this)) + Object + (as-uuid [this] (as-uuid (str this)))) + +(defn ->uuid + "Converts argument to a `UUID`. + To support additional types, extend the `UUIDLike` protocol." + ^UUID [this] + (as-uuid this)) + +(defprotocol VersionLike + (as-version [this])) + +(extend-protocol VersionLike + MAuthVersion + (as-version [this] this) + String + (as-version [this] (MAuthVersion/valueOf (str/upper-case this))) + Keyword + (as-version [this] (as-version (name this))) + Object + (as-version [this] (as-version (str this)))) + +(defn ->version + "Converts argument to an `MAuthVersion`. + To support additional types, extend the `VersionLike` protocol." + ^MAuthVersion [this] + (as-version this)) + +(defprotocol EpochTimeProviderLike + (as-epoch-time-provider ^EpochTimeProvider [this])) + +(extend-protocol EpochTimeProviderLike + EpochTimeProvider + (as-epoch-time-provider [this] this) + IFn + (as-epoch-time-provider [this] + (reify EpochTimeProvider + (inSeconds [_] + (long (this))))) + IDeref + (as-epoch-time-provider [this] + (reify EpochTimeProvider + (inSeconds [_] + (long @this)))) + Supplier + (as-epoch-time-provider [this] + (reify EpochTimeProvider + (inSeconds [_] + (long (.get this))))) + LongSupplier + (as-epoch-time-provider [this] + (reify EpochTimeProvider + (inSeconds [_] + (.getAsLong this)))) + IntSupplier + (as-epoch-time-provider [this] + (reify EpochTimeProvider + (inSeconds [_] + (long (.getAsInt this)))))) + +(defn ->epoch-time-provider + "Converts argument to an `EpochTimeProvider`. + To support additional types, extend the `EpochTimeProviderLike` protocol." + ^EpochTimeProvider [this] + (as-epoch-time-provider this)) + +;; The JVM does not have union types, so this is the best we can do +(defprotocol SerialData + (as-bytes-or-input-stream [this])) + +(extend-protocol SerialData + byte/1 + (as-bytes-or-input-stream [this] [:bytes this]) + Byte/1 + (as-bytes-or-input-stream [this] [:bytes (byte-array this)]) + String + (as-bytes-or-input-stream [this] [:bytes (.getBytes this "utf-8")]) + CharSequence + (as-bytes-or-input-stream [this] (as-bytes-or-input-stream (str this))) + ByteArrayInputStream + (as-bytes-or-input-stream [this] [:bytes (.readAllBytes this)]) + StringReader + (as-bytes-or-input-stream [this] (as-bytes-or-input-stream (slurp this))) + CharArrayReader + (as-bytes-or-input-stream [this] (as-bytes-or-input-stream (slurp this))) + nil + (as-bytes-or-input-stream [this] [:bytes this]) + InputStream + (as-bytes-or-input-stream [this] [:stream this])) + +(defn ->bytes-or-input-stream + "Converts argument to either `byte[]` or `InputStream`. + The return value is a vector whose first element is either `:bytes` or + `:stream`, and whose second element is a value of the corresponding type. + To support additional types, extend the `SerialData` protocol." + [this] + (as-bytes-or-input-stream this)) diff --git a/src/com/mdsol/mauth/clojure/signer.clj b/src/com/mdsol/mauth/clojure/signer.clj new file mode 100644 index 0000000..d306453 --- /dev/null +++ b/src/com/mdsol/mauth/clojure/signer.clj @@ -0,0 +1,121 @@ +(ns com.mdsol.mauth.clojure.signer + (:require + [com.mdsol.mauth.clojure.convert :as convert]) + (:import + (com.mdsol.mauth DefaultSigner Signer) + (com.mdsol.mauth.util CurrentEpochTimeProvider EpochTimeProvider) + (java.io + InputStream) + (java.util List))) + +(set! *warn-on-reflection* true) + +(def current-epoch-time-provider + "Provides the actual current time according to the system clock." + (CurrentEpochTimeProvider.)) + +(defn default-signer + "Returns a signer capable of producing MAuth signatures. + + Required arguments: + - app-uuid: The UUID registered in the MAuth server for the signing + application. + - private-key: The application's private key as a String. + + Optional arguments: + - epoch-time-provider: A function which returns the current time as seconds + since the Unix epoch. Defaults to a function which returns the system clock + time. + - sign-versions: A collection of MAuth versions for which signatures should + be produced. Defaults to `[:mwsv2]`. + + The types for all of these arguments are flexible. Support for new types can + be added by extending the protocols defined in + `com.mdsol.mauth.clojure.convert`." + ^DefaultSigner + [& {:keys [app-uuid private-key + epoch-time-provider sign-versions] + :or {epoch-time-provider current-epoch-time-provider + sign-versions [:mwsv2]}}] + (DefaultSigner. (convert/->uuid app-uuid) + ^String private-key + ^EpochTimeProvider (convert/->epoch-time-provider epoch-time-provider) + ^List (list* (map convert/->version sign-versions)))) + +(comment + (def my-signer + (default-signer {:sign-versions [:mws :mwsv2] + :app-uuid (random-uuid) + ;; This key was generated specifically for testing + :private-key "-----BEGIN RSA PRIVATE KEY----- +MIIEpgIBAAKCAQEA62E+E3/I+rH9PZ9Z7GwUakZeDbBqBj52sfFyt2M4LBawPojp +DBtAHOGxhCff8yncoDa8QRKTqVwn7kiTcjsuKub40/JMbnY1ltjaRm473vhMiUZm +q1c5jFyU24dEZ7DYFpC1bTpjyCeI6dgzfcqDaO366/fpuMGURGgVOQ7Fi71FKpYc +B5cZp8ywgQjSOfpM9u0e0yLukfSvDxeDGGpV1JnD9xcrojJI2iyFe2i+LPESpp6L +YHKKHilBbK3cI7uTfiIvdsYc1SLYZQtyNXDCBbvJ/zgcSTteh8D9sioL/2uLHKH3 +2VRlDn0zafulP/G1pYyT89hVE1kj6P5A0m6JMwIDAQABAoIBAQDPcALCMoLQFV6m +GTKpvlJ7moo3LDs0R4ZZqf08i2+sw04NvqEL71QgX/MPEgk3BrSOac6c1p9VyYbT +ZBi1ulwkqSuvtkEPtJPj3jb3jRysk0z4Shgfdp6cCdeSZPKvI1Y9BMkvex8G/XiX +BdfTS09mgRz7KqBLGCbv5n6Vq2QDklidfrSJY8fvjzyGVZbMLUvMlFOWsA1vZQfZ +k0sKxqwgpbyoBFKsRp9CTMW6dsCEJGNFFfjvB2Eu1J5g7NN/1E4b/i4tyaDYahW4 +8SeXTnm3Jr8JmfH99FGZ5CWV1Y8Kamo+AXUFdeVvwYEJJuepVxwOwisCJYvYy9IN +oV5qtnrxAoGBAPbkfqf0cCDh5wpiIfL/KwmhBdmes3fbpHF7kfNFtmBJL5RlyqsW +sNwjwLw3LEQKSmTkufZ0ozujobgtIAdRsZvzEyymVNC+YszkVgwPgKI9we+w9dHj +HKUR+2zyxoH6/FpxxzyIwXie5i+7k3Mshml9j5nX7GPJHU+i76fkkKv5AoGBAPQQ +B1ZTCfXj9ygH3ut0iUs5yK+wF0/1QV+Qu67Cub5q+ZSNGx0aKzHxuLNsPZk7uJDg +4gYvjFdq81f0Gv3JMDkULClxQif+9kUVXt9bpQbJ6S+tCCTtm2wOh6JjdN/phgAk ++wxFsDsW+DDARi2UkgILEglDDXJhi4PPm+6TSrGLAoGBAL7TMMnj9l6T/B1cZ90H +OF6C5KClNxWm4F0OI2qiMSoOpwXN/21pZl1gDPHsuvwD8Cg3WTySPjA0cySFTEIb +9GkS4XkbPmbxIDA5NACyYrwDe8glQHpvTY6QbYJxythgA3hshI/XK6JtPoEaPAdD +HMigUcOYzo75vPv2dcGQufkRAoGBAOHK3m7fngxtnd/cAEFG7Cm7SM45FCg2Fwfp +p6kTn7Hp2AK11MrExgeLwLvFvOtB1Au88X6ViLnrSTwqqrn14nY8Ems4y+Kiv4XE +MqRjbbZtIB2qcClx5WM/wf3bE2p/6ifCDrwY0OSp6G15xLMwiy/2u/XzocIbOm50 +qKc8f1LnAoGBAMEBKHFEKvpQ/00RKT1VJkpUHk3SoOVey8PpaTbNFlggz/2FcO5i +JXNpe60qgURHJigvYmseF9p7f36w2cnGMpJowHhbY7QFYosuIOQ7Am8h24dgpHtd +B8+UoQ/ICy2ahrEljIQOLSqekDRq8QaRSpIZ2MNFVRPtH85R/zmxrVvT +-----END RSA PRIVATE KEY-----"}))) + +(defn gen-req-headers + "Given a signer and a Ring request map, returns a map of MAuth headers." + [^Signer signer + {:keys [request-method body ^String uri ^String query-string]}] + (let [method (if (ident? request-method) + (name request-method) + ^String request-method) + [t b] (convert/->bytes-or-input-stream body)] + (into {} + ;; The InputStream overload can only provide signatures for one + ;; version at a time, while the array overload requires holding the + ;; whole request body in memory. Neither fits all use cases, so we + ;; dispatch to one or the other depending on whether the request body + ;; is already fully held in memory. + (case t + :stream (.generateRequestHeaders signer method uri + ^InputStream b + query-string) + :bytes (.generateRequestHeaders signer method uri + ^bytes b + query-string))))) + +(comment + (gen-req-headers my-signer {:request-method :post + :uri "/foo" + :body "Hey hey"})) + +(defn wrap-client + "Middleware for clients conforming to the Ring/clj-http signature. + Adds MAuth headers to requests." + [client signer] + (fn + ([req] + (client (update req :headers merge (gen-req-headers signer req)))) + ;; TODO: Support async + #_([req respond raise] + (client (update req :headers merge (gen-req-headers signer req)) + respond raise)))) + +(comment + ((wrap-client prn my-signer) {:request-method :post + :headers {"content-type" "whatever"} + :uri "/foo" + :body "Hey hey"})) diff --git a/test/com/mdsol/mauth/clojure/signer_authenticator_test.clj b/test/com/mdsol/mauth/clojure/signer_authenticator_test.clj new file mode 100644 index 0000000..d2789e7 --- /dev/null +++ b/test/com/mdsol/mauth/clojure/signer_authenticator_test.clj @@ -0,0 +1,216 @@ +(ns com.mdsol.mauth.clojure.signer-authenticator-test + (:require + [camel-snake-kebab.core :as csk] + [charred.api :as charred] + [clojure.java.io :as io] + [clojure.string :as str] + [clojure.test :refer [deftest is]] + [com.mdsol.mauth.clojure.authenticator :as auth] + [com.mdsol.mauth.clojure.signer :as signer]) + (:import + (com.mdsol.mauth.exception MAuthValidationException) + (com.mdsol.mauth.util MAuthKeysHelper) + (com.mdsol.mauth.utils ClientPublicKeyProvider) + (java.io File FilenameFilter) + (java.net URI))) + +(set! *warn-on-reflection* true) + +(def suite-base (io/file "mauth-protocol-test-suite")) + +(defn child-by-ext [^File parent ext] + (first (.listFiles parent (reify FilenameFilter + (accept [_this _dir file-name] + (str/ends-with? file-name ext)))))) + +(defn ringify-request [{:keys [verb url body body-filepath]} path] + ;; Don't reinvent the wheel, just let Java parse the URI. + ;; It's a more complex task than you think. + (let [java-uri (URI. url)] + {:request-method verb + :uri (.getRawPath java-uri) + :query-string (.getRawQuery java-uri) + :body (or body + (when body-filepath + (io/input-stream (io/file path body-filepath))))})) + +(defn read-case [^File path] + {:name (.getName path) + ;; Recreate request each time because some contain stateful streams + :request-fn #(some-> (child-by-ext path ".req") + (charred/read-json :key-fn csk/->kebab-case-keyword) + (ringify-request path)) + ;; This implementation does not expose these intermediate steps in a testable + ;; way. That's fine, because they aren't part of the public contract anyway + ;; and don't really need to be tested directly. + #_#_:str-to-sign (some-> (child-by-ext path ".sts") + slurp) + #_#_:signature (some-> (child-by-ext path ".sig") + slurp) + :headers (some-> (child-by-ext path ".authz") + charred/read-json)}) + +(def signing-config + (-> (io/file suite-base "signing-config.json") + (charred/read-json :key-fn csk/->kebab-case-keyword) + (update :app-uuid parse-uuid))) + +(def signer-v2 + (let [{:keys [app-uuid request-time private-key-file]} signing-config] + (signer/default-signer :app-uuid app-uuid + :private-key (slurp (io/file suite-base private-key-file)) + :epoch-time-provider (constantly request-time)))) + +(def signer-v1 + (let [{:keys [app-uuid request-time private-key-file]} signing-config] + (signer/default-signer :app-uuid app-uuid + :private-key (slurp (io/file suite-base private-key-file)) + :epoch-time-provider (constantly request-time) + :sign-versions [:mws]))) + +(def ignored-test-cases + #{;; In HTTP, foo//bar is not the same as foo/bar. This case is incorrect. + "get-normalize-multiple-slashes" + ;; This is invalid URL syntax. Query strings may not contain spaces. + "get-vanilla-query-space"}) + +(def test-cases-v2 + (->> (.listFiles (io/file suite-base "protocols" "MWSV2")) + (remove #(ignored-test-cases (.getName ^File %))) + (map read-case))) + +(def test-cases-v1 + (->> (.listFiles (io/file suite-base "protocols" "MWS")) + (remove #(ignored-test-cases (.getName ^File %))) + (map read-case))) + +(defn norm-headers [m] + (-> m + (update-keys str/lower-case) + (update-vals str) + vec + (->> (sort-by first)))) + +(def pub-key + (MAuthKeysHelper/getPublicKeyFromString + (slurp (io/file suite-base "signing-params" "rsa-key-pub") + :encoding "utf-8"))) + +(def pk-provider + (reify ClientPublicKeyProvider + (getPublicKey [_ app-uuid] + (if (= app-uuid (:app-uuid signing-config)) + pub-key + (throw (ex-info "Unexpected key requested" + {:received app-uuid + :expected (:app-uuid signing-config)})))))) + +(def authenticator + (auth/default-authenticator :client-pk-provider pk-provider + :epoch-time-provider (constantly 1444672125))) + +(defn validate-test-case [test-case signer] + (let [{:keys [request-fn headers]} test-case] + (is (= (norm-headers headers) + (norm-headers (signer/gen-req-headers signer (request-fn)))) + "Signer produces expected headers") + ;; = only compares true on streams if it's the same instance + (let [req (request-fn)] + (is (= (-> req + (update :headers merge headers) + (update :headers norm-headers)) + (update ((signer/wrap-client identity signer) + req) + :headers norm-headers)) + "Client middleware adds expected headers")) + (is (true? (auth/valid? authenticator + (update (request-fn) :headers + merge headers))) + "Authenticator validates headers") + (let [req (update (request-fn) :headers + merge headers)] + (is (= (assoc req :com.mdsol.mauth/app-uuid (:app-uuid signing-config)) + ((auth/wrap-handler identity authenticator) + (update req :headers + merge headers))) + "Server middleware passes through on success")) + (is (= {:status 401 + :body "oops!" + ::got-request true} + ((auth/wrap-handler identity authenticator + {:on-auth-failure + (fn [{:keys [request exception handler]}] + (is (nil? exception)) + (is (= identity handler)) + {:status 401 + :body "oops!" + ::got-request (::is-request request)})}) + (-> (request-fn) + (update :headers merge headers) + (assoc :body "This is not the right body!") + (assoc ::is-request true)))) + "Server middleware calls on-auth-failure on mismatched signature") + (is (= {:status 401 + :body "oops!" + ::got-request true} + ((auth/wrap-handler identity authenticator + {:on-auth-failure + (fn [{:keys [request exception handler]}] + (is (instance? Exception exception)) + (is (= identity handler)) + {:status 401 + :body "oops!" + ::got-request (::is-request request)})}) + (-> (request-fn) + (assoc :headers {}) + (assoc ::is-request true)))) + "Server middleware calls on-auth-failure on missing auth headers.") + (is (= {:status 401 + :body "oops!" + ::got-request true} + ((auth/wrap-handler identity authenticator + {:on-auth-failure + (fn [{:keys [request exception handler]}] + (is (instance? Exception exception)) + (is (= identity handler)) + {:status 401 + :body "oops!" + ::got-request (::is-request request)})}) + (-> (request-fn) + (update :headers merge headers) + (assoc-in [:headers "X-MWS-Time"] 1) + (assoc-in [:headers "MCC-Time"] 1) + (assoc ::is-request true)))) + "Server middleware calls on-auth-failure on expired signature") + (is (= {:status 401 + :body {:message "Unauthorized."}} + ((auth/wrap-handler identity authenticator) + (-> (request-fn) + (update :headers merge headers) + (assoc-in [:headers "X-MWS-Time"] 1) + (assoc-in [:headers "MCC-Time"] 1)))) + "default-on-auth-failure returns exception message on exception") + (is (= {:status 401 + :body {:message "Unauthorized."}} + ((auth/wrap-handler identity authenticator) + (-> (request-fn) + (update :headers merge headers) + (assoc :body "This is not the right body!")))) + "default-on-auth-failure returns default message on auth failure"))) + +(doseq [i (range (count test-cases-v2))] + (eval + `(deftest ~(-> test-cases-v2 + (nth i) + :name + (->> (str "mwsv2-")) + symbol) + (validate-test-case (nth test-cases-v2 ~i) signer-v2)))) +(doseq [i (range (count test-cases-v1))] + (eval + `(deftest ~(-> test-cases-v1 + (nth i) + :name + (->> (str "mws-")) + symbol) + (validate-test-case (nth test-cases-v1 ~i) signer-v1))))