Changeset 4245
- Timestamp:
- 01/09/14 17:02:09 (10 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
- Files:
-
- 3 deleted
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
r4210 r4245 247 247 <version>8.4-702.jdbc4</version> 248 248 </dependency> 249 <dependency>249 <!-- <dependency> 250 250 <groupId>org.springframework.security</groupId> 251 251 <artifactId>spring-security-core</artifactId> … … 260 260 <groupId>org.springframework.security</groupId> 261 261 <artifactId>spring-security-web</artifactId> 262 <version>${spring.version}</version> 263 </dependency> 262 <version>${spring.version}</version> 263 </dependency> --> 264 264 <dependency> 265 265 <groupId>cglib</groupId> … … 271 271 <artifactId>slf4j-log4j12</artifactId> 272 272 <version>${slf4j.version}</version> 273 </dependency> 274 <dependency> 275 <groupId>de.mpg.mpgaai</groupId> 276 <artifactId>mpgaai-shhaa</artifactId> 277 <version>1.0.3</version> 278 <exclusions> 279 <exclusion> 280 <groupId>commons-logging</groupId> 281 <artifactId>commons-logging</artifactId> 282 </exclusion> 283 </exclusions> 273 284 </dependency> 274 285 </dependencies> … … 281 292 <netbeans.hint.license>gpl20</netbeans.hint.license> 282 293 <plugin.license.copyrightYear>2013</plugin.license.copyrightYear> 283 <project.version>1. 0</project.version>294 <project.version>1.1</project.version> 284 295 </properties> 285 296 </project> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
r4217 r4245 55 55 import javax.xml.bind.JAXBElement; 56 56 import org.springframework.beans.factory.annotation.Autowired; 57 import org.springframework.security.access.annotation.Secured;58 57 import org.springframework.stereotype.Component; 59 58 import org.slf4j.Logger; … … 105 104 @Produces(MediaType.TEXT_XML) 106 105 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}") 107 @Secured("ROLE_USER")108 106 @Transactional(readOnly = true) 109 107 public JAXBElement<Annotation> getAnnotation(@PathParam("annotationid") String ExternalIdentifier) throws IOException { … … 135 133 @Produces(MediaType.TEXT_XML) 136 134 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/targets") 137 @Secured("ROLE_USER")138 135 @Transactional(readOnly = true) 139 136 public JAXBElement<ReferenceList> getAnnotationTargets(@PathParam("annotationid") String ExternalIdentifier) throws IOException { … … 160 157 @Produces(MediaType.TEXT_XML) 161 158 @Path("") 162 @Secured("ROLE_USER")163 159 @Transactional(readOnly = true) 164 160 public JAXBElement<AnnotationInfoList> getFilteredAnnotations(@QueryParam("link") String link, … … 183 179 @Produces(MediaType.TEXT_XML) 184 180 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions") 185 @Secured("ROLE_USER")186 181 @Transactional(readOnly = true) 187 182 public JAXBElement<UserWithPermissionList> getAnnotationPermissions(@PathParam("annotationid") String ExternalIdentifier) throws IOException { … … 208 203 @DELETE 209 204 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}") 210 @Secured("ROLE_USER")211 205 public String deleteAnnotation(@PathParam("annotationid") String externalIdentifier) throws IOException { 212 206 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 234 228 @Produces(MediaType.APPLICATION_XML) 235 229 @Path("") 236 @Secured("ROLE_USER")237 230 public JAXBElement<ResponseBody> createAnnotation(Annotation annotation) throws IOException { 238 231 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 249 242 @Produces(MediaType.APPLICATION_XML) 250 243 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}") 251 @Secured("ROLE_USER")252 244 public JAXBElement<ResponseBody> updateAnnotation(@PathParam("annotationid") String externalIdentifier, Annotation annotation) throws IOException { 253 245 String path = uriInfo.getBaseUri().toString(); … … 281 273 @Produces(MediaType.APPLICATION_XML) 282 274 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/body") 283 @Secured("ROLE_USER")284 275 public JAXBElement<ResponseBody> updateAnnotationBody(@PathParam("annotationid") String externalIdentifier, AnnotationBody annotationBody) throws IOException { 285 276 String path = uriInfo.getBaseUri().toString(); … … 307 298 @Produces(MediaType.APPLICATION_XML) 308 299 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions/{userid: " + BackendConstants.regExpIdentifier + "}") 309 @Secured("ROLE_USER")310 300 public String updatePermission(@PathParam("annotationid") String annotationExternalId, @PathParam("userid") String userExternalId, Permission permission) throws IOException { 311 301 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 335 325 @Produces(MediaType.APPLICATION_XML) 336 326 @Path("{annotationid: " + BackendConstants.regExpIdentifier + "}/permissions/") 337 @Secured("ROLE_USER")338 327 public JAXBElement<ResponseBody> updatePermissions(@PathParam("annotationid") String annotationExternalId, UserWithPermissionList permissions) throws IOException { 339 328 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java
r4217 r4245 40 40 import javax.xml.parsers.ParserConfigurationException; 41 41 import org.springframework.beans.factory.annotation.Autowired; 42 import org.springframework.security.access.annotation.Secured;43 42 import org.springframework.stereotype.Component; 44 43 import org.springframework.transaction.annotation.Transactional; … … 71 70 @Produces(MediaType.TEXT_XML) 72 71 @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/metadata") 73 @Secured("ROLE_USER")74 72 @Transactional(readOnly = true) 75 73 public JAXBElement<CachedRepresentationInfo> getCachedRepresentationInfo(@PathParam("cachedid") String externalId) throws SQLException, IOException { … … 88 86 @Produces({"image/jpeg", "image/png"}) 89 87 @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/content") 90 @Secured("ROLE_USER")91 88 @Transactional(readOnly = true) 92 89 public BufferedImage getCachedRepresentationContent(@PathParam("cachedid") String externalId) throws SQLException, IOException { -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java
r4217 r4245 45 45 import javax.xml.parsers.ParserConfigurationException; 46 46 import org.springframework.beans.factory.annotation.Autowired; 47 import org.springframework.security.access.annotation.Secured;48 47 import org.springframework.stereotype.Component; 49 48 import org.springframework.transaction.annotation.Transactional; … … 82 81 @Produces(MediaType.TEXT_XML) 83 82 @Path("{targetid: " + BackendConstants.regExpIdentifier + "}") 84 @Secured("ROLE_USER")85 83 @Transactional(readOnly = true) 86 84 public JAXBElement<Target> getTarget(@PathParam("targetid") String ExternalIdentifier) throws SQLException, IOException { … … 100 98 @Produces(MediaType.TEXT_XML) 101 99 @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/versions") 102 @Secured("ROLE_USER")103 100 @Transactional(readOnly = true) 104 101 public JAXBElement<ReferenceList> getSiblingTargets(@PathParam("targetid") String ExternalIdentifier) throws SQLException, IOException { … … 133 130 @Produces(MediaType.APPLICATION_XML) 134 131 @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/fragment/{fragmentDescriptor}/cached") 135 @Secured("ROLE_USER")136 132 public JAXBElement<CachedRepresentationInfo> postCached(@PathParam("targetid") String targetIdentifier, 137 133 @PathParam("fragmentDescriptor") String fragmentDescriptor, … … 151 147 @DELETE 152 148 @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/cached/{cachedid: " + BackendConstants.regExpIdentifier + "}") 153 @Secured("ROLE_ADMIN")154 149 public String deleteCachedForTarget(@PathParam("targetid") String targetExternalIdentifier, 155 150 @PathParam("cachedid") String cachedExternalIdentifier) throws SQLException, IOException { -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java
r4217 r4245 42 42 import javax.xml.parsers.ParserConfigurationException; 43 43 import org.springframework.beans.factory.annotation.Autowired; 44 import org.springframework.security.access.annotation.Secured;45 44 import org.springframework.stereotype.Component; 46 45 import org.springframework.transaction.annotation.Transactional; … … 74 73 @Produces(MediaType.TEXT_XML) 75 74 @Path("{userid: " + BackendConstants.regExpIdentifier + "}") 76 @Secured("ROLE_USER")77 75 @Transactional(readOnly = true) 78 76 public JAXBElement<User> getUser(@PathParam("userid") String ExternalIdentifier) throws SQLException, IOException { … … 91 89 @Produces(MediaType.TEXT_XML) 92 90 @Path("/info") 93 @Secured("ROLE_USER")94 91 @Transactional(readOnly = true) 95 92 public JAXBElement<User> getUserByInfo(@QueryParam("email") String email) throws SQLException, IOException { … … 107 104 @Produces(MediaType.TEXT_XML) 108 105 @Path("{userid: " + BackendConstants.regExpIdentifier + "}/current") 109 @Secured("ROLE_USER")110 106 @Transactional(readOnly = true) 111 107 public JAXBElement<CurrentUserInfo> getCurrentUserInfo(@PathParam("userid") String ExternalIdentifier) throws IOException { … … 127 123 @Produces(MediaType.TEXT_XML) 128 124 @Path("{remoteId: " + BackendConstants.regExpIdentifier + "}") 129 @Secured("ROLE_ADMIN")130 125 public JAXBElement<User> addUser(@PathParam("userid") String remoteId, User user) throws SQLException { 131 126 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 139 134 @Produces(MediaType.TEXT_XML) 140 135 @Path("") 141 @Secured("ROLE_ADMIN")142 136 public JAXBElement<User> updateUser(User user) throws IOException{ 143 137 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml
r4190 r4245 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 2 3 4 Copyright (C) 2013 DASISH 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License 8 as published by the Free Software Foundation; either version 2 9 of the License, or (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20 --> 3 21 <ROOT> 4 22 <shhaa> … … 21 39 <username>anonymous</username> 22 40 </fallback> 23 <sso action="lI">${shibLI}</sso> 24 <slo action="lO">${shibLO}</slo> 41 <sso action="lI">https://lux16.mpi.nl/Shibboleth.sso/Login</sso> 42 <slo action="lO">https://lux16.mpi.nl/Shibboleth.sso/Logout</slo> 43 <!-- <sso action="lI">http://localhost:8080/annotator-backend/api/index.jsp</sso> 44 <slo action="lO">http://localhost:8080/annotator-backend/api/index.jsp</slo> --> 25 45 </authentication> 26 46 27 47 28 < composition action="rF">48 <!-- <composition action="rF"> 29 49 <shibheader> 30 50 <attribute>displayName</attribute> 31 51 <attribute>commonName</attribute> 32 52 </shibheader> 33 </composition> 53 </composition> --> 34 54 35 55 36 56 <authorization> 37 <location target="/ admin/*" />57 <location target="/hvwkejfhvwkehf/*" /> 38 58 </authorization> 39 59 40 60 41 <handler>42 <ignore>43 <location target="/css/*" />44 <location target="/img/*" />45 </ignore>46 47 <!-- configures the view-control targets -->48 <pages>49 <!-- <info action="dI">/protected/info.jsp</info> -->50 <denied action="dD">pages/noaccess.jsp</denied>51 </pages>52 53 </handler>54 61 55 62 </shhaa> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
r4211 r4245 66 66 <url-pattern>/webresources/*</url-pattern> 67 67 </servlet-mapping> 68 <filter> 69 <filter-name>springSecurityFilterChain</filter-name> 70 <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 68 69 <filter> 70 <filter-name>AAIFilter</filter-name> 71 <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class> 71 72 </filter> 72 73 <filter-mapping> 73 <filter-name> springSecurityFilterChain</filter-name>74 <filter-name>AAIFilter</filter-name> 74 75 <url-pattern>/*</url-pattern> 75 76 </filter-mapping> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp
r3949 r4245 40 40 DELETE <form action="api/notebooks/_nid_" method="DELETE"><input type="submit" /></form>api/notebooks/_nid_ Delete _nid_. Annotations stay, they just lose connection to _nid_.<br> 41 41 --> 42 <br>42 <!-- <br> 43 43 <a href="spring_security_login"> Login</a> <br> 44 44 <br> 45 <a href="j_spring_security_logout"> Logout</a> <br> 45 <a href="j_spring_security_logout"> Logout</a> <br> --> 46 46 <br> 47 47 <b>Test URI-s</b><br>
Note: See TracChangeset
for help on using the changeset viewer.