summaryrefslogtreecommitdiffstats
path: root/src/test/resources/model-validation
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2019-02-15 11:30:00 +0000
committermark.j.leonard <mark.j.leonard@gmail.com>2019-02-15 17:11:43 +0000
commit66372969d78dde14097209808358479635c0e8d0 (patch)
treef96c54a92604472157393bca4ff2f700b9074d62 /src/test/resources/model-validation
parent209cd56d7f2f885a94fc5f937c4376fc0ffbd922 (diff)
Create Application tests for KEY_STORE_PASSWORD
Add a dummy keystore file for testing exceptions relating to opening the key store (for the server cert) with an incorrect password. This is intended to increase code coverage. Make AAIMicroServiceAuthCore non-static to avoid some issues with Spring initialization. Change-Id: Ic512bd0934210fb016da9731e65ec0d858fa4ff7 Issue-ID: AAI-2057 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test/resources/model-validation')
-rw-r--r--src/test/resources/model-validation/instance-validator/auth/auth_policy.json55
-rw-r--r--src/test/resources/model-validation/instance-validator/auth/tomcat_keystorebin0 -> 32 bytes
-rw-r--r--src/test/resources/model-validation/instance-validator/validation-service-auth.properties2
3 files changed, 56 insertions, 1 deletions
diff --git a/src/test/resources/model-validation/instance-validator/auth/auth_policy.json b/src/test/resources/model-validation/instance-validator/auth/auth_policy.json
new file mode 100644
index 0000000..2bf63d1
--- /dev/null
+++ b/src/test/resources/model-validation/instance-validator/auth/auth_policy.json
@@ -0,0 +1,55 @@
+{"roles": [
+ {
+ "name": "admin",
+ "functions": [
+ {
+ "name": "actions",
+ "methods": [
+ {"name": "GET"},
+ {"name": "DELETE"},
+ {"name": "PUT"}
+ ]
+ },
+ {
+ "name": "validate",
+ "methods": [{"name": "POST"}]
+ }
+ ],
+ "users": [
+ {"username": "CN=common-name, OU=org-unit, O=org, L=location, ST=state, C=US"},
+ {"username": "CN=test, OU=qa, O=Test Ltd, L=London, ST=London, C=GB"}
+ ]
+ },
+ {
+ "name": "ops",
+ "functions": [{
+ "name": "actions",
+ "methods": [{"name": "POST"}]
+ }],
+ "users": [
+ {"username": "CN=common-name, OU=org-unit, O=org, L=location, ST=state, C=US"},
+ {"username": "CN=test, OU=qa, O=Test Ltd, L=London, ST=London, C=GB"}
+ ]
+ },
+ {
+ "name": "basicauth",
+ "functions": [{
+ "name": "util",
+ "methods": [{"name": "GET"}]
+ }],
+ "users": [{
+ "user": "aai",
+ "pass": "OBF:1u2a1t2v1vgb1s3g1s3m1vgj1t3b1u30"
+ }]
+ },
+ {
+ "name": "nofuncauth",
+ "functions": [{
+ "name": "nofuncutil"
+ }],
+ "users": [{
+ "user": "aai",
+ "pass": "OBF:1u2a1t2v1vgb1s3g1s3m1vgj1t3b1u30"
+ }]
+ }
+]}
diff --git a/src/test/resources/model-validation/instance-validator/auth/tomcat_keystore b/src/test/resources/model-validation/instance-validator/auth/tomcat_keystore
new file mode 100644
index 0000000..f7dc0ea
--- /dev/null
+++ b/src/test/resources/model-validation/instance-validator/auth/tomcat_keystore
Binary files differ
diff --git a/src/test/resources/model-validation/instance-validator/validation-service-auth.properties b/src/test/resources/model-validation/instance-validator/validation-service-auth.properties
index 1c1ed97..8e07a2a 100644
--- a/src/test/resources/model-validation/instance-validator/validation-service-auth.properties
+++ b/src/test/resources/model-validation/instance-validator/validation-service-auth.properties
@@ -14,5 +14,5 @@
# limitations under the License.
# ============LICENSE_END=====================================================
-auth.policy.file=appconfig-local/auth/auth_policy.json
+auth.policy.file=${CONFIG_HOME}/auth/auth_policy.json
auth.authentication.disable=false \ No newline at end of file