auditTrailContext.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to Jasig under one or more contributor license
  4. agreements. See the NOTICE file distributed with this work
  5. for additional information regarding copyright ownership.
  6. Jasig licenses this file to you under the Apache License,
  7. Version 2.0 (the "License"); you may not use this file
  8. except in compliance with the License. You may obtain a
  9. copy of the License at the following location:
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. -->
  18. <beans xmlns="http://www.springframework.org/schema/beans"
  19. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  20. xmlns:aop="http://www.springframework.org/schema/aop"
  21. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  22. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
  23. <description>
  24. Configuration file for the Inspektr package which handles auditing for Java applications.
  25. If enabled this should be modified to log audit and statistics information the same way
  26. your local applications do. The default is currently to log to the console which is good
  27. for debugging/testing purposes.
  28. </description>
  29. <aop:aspectj-autoproxy/>
  30. <bean id="auditTrailManagementAspect" class="com.github.inspektr.audit.AuditTrailManagementAspect">
  31. <!-- String applicationCode -->
  32. <constructor-arg index="0" value="CAS" />
  33. <!-- PrincipalResolver auditablePrincipalResolver -->
  34. <constructor-arg index="1" ref="auditablePrincipalResolver" />
  35. <!-- List<AuditTrailManager> auditTrailManagers -->
  36. <constructor-arg index="2">
  37. <list>
  38. <ref bean="auditTrailManager" />
  39. </list>
  40. </constructor-arg>
  41. <!-- Map<String,AuditActionResolver> auditActionResolverMap -->
  42. <constructor-arg index="3">
  43. <map>
  44. <entry key="AUTHENTICATION_RESOLVER">
  45. <ref local="authenticationActionResolver" />
  46. </entry>
  47. <entry key="CREATE_TICKET_GRANTING_TICKET_RESOLVER">
  48. <ref local="ticketCreationActionResolver" />
  49. </entry>
  50. <entry key="DESTROY_TICKET_GRANTING_TICKET_RESOLVER">
  51. <bean class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver" />
  52. </entry>
  53. <entry key="GRANT_SERVICE_TICKET_RESOLVER">
  54. <ref local="ticketCreationActionResolver" />
  55. </entry>
  56. <entry key="GRANT_PROXY_GRANTING_TICKET_RESOLVER">
  57. <ref local="ticketCreationActionResolver" />
  58. </entry>
  59. <entry key="VALIDATE_SERVICE_TICKET_RESOLVER">
  60. <ref local="ticketValidationActionResolver" />
  61. </entry>
  62. <entry key="DELETE_SERVICE_ACTION_RESOLVER">
  63. <ref local="deleteServiceActionResolver" />
  64. </entry>
  65. <entry key="SAVE_SERVICE_ACTION_RESOLVER">
  66. <ref local="saveServiceActionResolver" />
  67. </entry>
  68. </map>
  69. </constructor-arg>
  70. <!-- Map<String,AuditResourceResolver> auditResourceResolverMap -->
  71. <constructor-arg index="4">
  72. <map>
  73. <entry key="AUTHENTICATION_RESOURCE_RESOLVER">
  74. <bean class="org.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver" />
  75. </entry>
  76. <entry key="CREATE_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER">
  77. <ref local="returnValueResourceResolver" />
  78. </entry>
  79. <entry key="DESTROY_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER">
  80. <ref local="ticketResourceResolver" />
  81. </entry>
  82. <entry key="GRANT_SERVICE_TICKET_RESOURCE_RESOLVER">
  83. <bean class="org.jasig.cas.audit.spi.ServiceResourceResolver" />
  84. </entry>
  85. <entry key="GRANT_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER">
  86. <ref local="returnValueResourceResolver" />
  87. </entry>
  88. <entry key="VALIDATE_SERVICE_TICKET_RESOURCE_RESOLVER">
  89. <ref local="ticketResourceResolver" />
  90. </entry>
  91. <entry key="DELETE_SERVICE_RESOURCE_RESOLVER">
  92. <ref local="deleteServiceResourceResolver" />
  93. </entry>
  94. <entry key="SAVE_SERVICE_RESOURCE_RESOLVER">
  95. <ref local="saveServiceResourceResolver" />
  96. </entry>
  97. </map>
  98. </constructor-arg>
  99. </bean>
  100. <bean id="saveServiceResourceResolver" class="com.github.inspektr.audit.spi.support.ParametersAsStringResourceResolver" />
  101. <bean id="deleteServiceResourceResolver" class="org.jasig.cas.audit.spi.ServiceManagementResourceResolver" />
  102. <bean id="saveServiceActionResolver" class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver">
  103. <constructor-arg index="0" value="_SUCCEEDED" />
  104. <constructor-arg index="1" value="_FAILED" />
  105. </bean>
  106. <bean id="deleteServiceActionResolver" class="com.github.inspektr.audit.spi.support.ObjectCreationAuditActionResolver">
  107. <constructor-arg index="0" value="_SUCCEEDED" />
  108. <constructor-arg index="1" value="_FAILED" />
  109. </bean>
  110. <bean id="auditablePrincipalResolver" class="org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver">
  111. <constructor-arg index="0" ref="ticketRegistry" />
  112. </bean>
  113. <bean id="authenticationActionResolver"
  114. class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver">
  115. <!-- String successSuffix -->
  116. <constructor-arg index="0" value="_SUCCESS" />
  117. <!-- String failureSuffix -->
  118. <constructor-arg index="1" value="_FAILED" />
  119. </bean>
  120. <bean id="ticketCreationActionResolver"
  121. class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver">
  122. <!-- String successSuffix -->
  123. <constructor-arg index="0" value="_CREATED" />
  124. <!-- String failureSuffix -->
  125. <constructor-arg index="1" value="_NOT_CREATED" />
  126. </bean>
  127. <bean id="ticketValidationActionResolver"
  128. class="com.github.inspektr.audit.spi.support.DefaultAuditActionResolver">
  129. <!-- String successSuffix -->
  130. <constructor-arg index="0" value="D" />
  131. <!-- String failureSuffix -->
  132. <constructor-arg index="1" value="_FAILED" />
  133. </bean>
  134. <bean id="returnValueResourceResolver"
  135. class="com.github.inspektr.audit.spi.support.ReturnValueAsStringResourceResolver" />
  136. <bean id="ticketResourceResolver"
  137. class="org.jasig.cas.audit.spi.TicketAsFirstParameterResourceResolver" />
  138. </beans>