caching framework cleanup and test extension
Change-Id: I472b0a465e3d2217835ffb1f49e07a1b65a08976
diff --git a/src/main/resources/codes.kustvakt b/src/main/resources/codes.kustvakt
index 01fa0d8..b2fa1fb 100644
--- a/src/main/resources/codes.kustvakt
+++ b/src/main/resources/codes.kustvakt
@@ -1,2 +1,36 @@
-[{code=100, message=}
-]
\ No newline at end of file
+# generic non localized messages for API error codes
+
+# standard system errors #
+100 : "No Entry found!"
+101 : "The request could not be processed!"
+102 : "Entry exists already!"
+103 : "Status ok!"
+104 : "Unsupported Overation!"
+105 : "Illegal argument found. Request could not be processed!"
+106 : "Connection Error"
+107 : "No changes"
+108 : "Parameter Validation failed!"
+109 : ""
+110 : "Not supported!"
+
+
+# 200 codes for user account/ authenticaation services
+200 : "Account deactivated. Please verify account before using this API"
+201 : "Account confirmation failed. Please contact an adminstrator"
+202 : "Already logged in!"
+203 : ""
+204 : "Authentication credentials expired!"
+205 : "Bad credentials!"
+206 : ""
+207 : "Username already exists"
+208 : "Password reset failed"
+209 : ""
+210 : "Login successful!"
+211 : "Login failed!"
+212 : "Logout successful!"
+213 : "Logout failed!"
+214 : "Client registration failed!"
+215 : "Deleting client information failed!"
+216 : "Client could not be authorized!"
+
+
diff --git a/src/main/resources/ehcache.xml b/src/main/resources/ehcache.xml
index 1bbb213..3d999e1 100644
--- a/src/main/resources/ehcache.xml
+++ b/src/main/resources/ehcache.xml
@@ -42,6 +42,7 @@
memoryStoreEvictionPolicy="LRU"
maxEntriesLocalHeap="100"
overflowToDisk='false'/>
+
<cache name='resources'
eternal='false'
overflowToDisk='false'
diff --git a/src/main/resources/kustvakt.info b/src/main/resources/kustvakt.info
index 32b65d1..c1c6cea 100644
--- a/src/main/resources/kustvakt.info
+++ b/src/main/resources/kustvakt.info
@@ -1,2 +1,8 @@
kustvakt.version=${project.version}
kustvakt.name=${project.name}
+
+# use this file to define the properties and logging file names
+kustvakt.properties=./kustvakt.conf
+kustvakt.logging=./log4j.properties
+kustvakt.caching=true
+kustvakt.cache_store=./store
\ No newline at end of file
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 9754e92..cba69e9 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,7 +1,7 @@
# Root logger option
#log4j.threshold=ALL
-log4j.rootLogger=WARN, stdout, debugLog
+log4j.rootLogger=INFO, stdout, debugLog
log4j.logger.log=ERROR, errorLog
# Direct log messages to stdout
diff --git a/src/main/resources/validation.properties b/src/main/resources/validation.properties
index 1e9d896..22f27c5 100644
--- a/src/main/resources/validation.properties
+++ b/src/main/resources/validation.properties
@@ -20,14 +20,17 @@
# try {
# someObject.setEmail(ESAPI.validator().getValidInput("User Email", input, "Email", maxLength, allowNull));
#
-#Validator.SafeString=^[.;:\\-\\p{Alnum}\\p{Space}]{0,1024}$
-Validator.username=^[;=\\*\/\/_()\\-0-9\\p{L}\\p{Space}]{0,15}$
-Validator.password_cap=((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,20})
-Validator.password=((?=.*\\d)(?=.*[a-zA-Z]).{8,20})
+# Validator.SafeString=^[.;:\\-\\p{Alnum}\\p{Space}]{0,1024}$
+# Validator.password_cap=((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,20})
Validator.SafeString=^[.;:,=\\*\/\/_()\\-0-9\\p{L}\\p{Space}]{0,1024}$
Validator.email=^[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$
Validator.ipddress=^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
Validator.url=^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\:\\'\\/\\\\\\+=&%\\$#_]*)?$
-Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$
-Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$
+# Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$
+# Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$
+# as used by apache commons validator for strings
+# Validator.string=^[\\.;:,\\=&\\*\\/\\/_()\\[\\]@\\|\\-0-9\\p{L}\\p{Space}]{0,1024}$
+
+Validator.username=^[A-Za-z_.\\d]{6,15}$
+Validator.password=^((?=.*\\d)(?=.*[A-Za-z])(?!.*[\\(\\)-]).{8,20})$
\ No newline at end of file