-
Notifications
You must be signed in to change notification settings - Fork 4
Implementation
All of the calls in api.openconext are logged in the table: api_call_log
Calls to get all group providers out of the engine-block database tables are cached. The configuration resides in tomcat/conf/class_properties/api-ehcache.xml:
<ehcache updateCheck="false">
<diskStore path="/tmp" />
<defaultCache name="default" />
<cache name="group-providers" maxElementsInMemory="100" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
maxElementsOnDisk="10000000" diskPersistent="false"
diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" />
<cache name="janus-meta-data" maxElementsInMemory="100" eternal="false"
timeToIdleSeconds="30" timeToLiveSeconds="30" overflowToDisk="true"
maxElementsOnDisk="10000000" diskPersistent="false"
diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" />
</ehcache>The cache named "group-providers" contains the settings for the Group Providers and in the above example the time to live is 30 seconds. The call to get the metadata for a Service Provider (SP) to the JANUS REST interface is also cached. See the ehCache documentation for an elaborate overview of all options.
The cache can be cleaned by touching the war file. Because of the low cache times we don't provide a sophisticated caching cleanup mechanism, but when requirements change this is easy to set up.
Every time an API call is made and the SP has no ACL configured (people and groups, see REST api) an error mail is send to the coin-errormail-to property in TOMCAT_HOME/conf/classpath_properties/coin-api.properties
API-specific errors (internal server errors) are caught server side and return a 500-response with details in JSON format, that does not show internal information (like stack traces). For every request handled this way, the complete stack trace is logged on the server in ERROR-level.
HTTP protocol errors (resulting in 4xx and 5xx responses) are left to be handled by the container (Tomcat) without any specific configuration.