Changeset 4985
- Timestamp:
- 04/15/14 17:36:50 (10 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
r4969 r4985 16 16 <dependencies> 17 17 <dependency> 18 <groupId>javax.servlet</groupId> 19 <artifactId>javax.servlet-api</artifactId> 20 <version>3.0.1</version> 21 <scope>provided</scope> 22 </dependency> 23 <dependency> 24 <groupId>javax.servlet</groupId> 25 <artifactId>servlet-api</artifactId> 26 <version>2.5</version> 27 <scope>provided</scope> 28 </dependency> 29 <dependency> 18 30 <groupId>com.sun.jersey</groupId> 19 31 <artifactId>jersey-servlet</artifactId> … … 36 48 <artifactId>jersey-test-framework-grizzly2</artifactId> 37 49 <version>${jersey.version}</version> 50 <exclusions> 51 <exclusion> 52 <artifactId>javax.servlet</artifactId> 53 <groupId>org.glassfish</groupId> 54 </exclusion> 55 </exclusions> 38 56 </dependency> 39 57 <dependency> … … 70 88 </dependency> 71 89 <dependency> 90 <groupId>org.springframework.security</groupId> 91 <artifactId>spring-security-config</artifactId> 92 <version>${spring.version}</version> 93 </dependency> 94 <dependency> 95 <groupId>org.springframework.security</groupId> 96 <artifactId>spring-security-web</artifactId> 97 <version>${spring.version}</version> 98 </dependency> 99 <dependency> 100 <groupId>org.springframework.security</groupId> 101 <artifactId>spring-security-core</artifactId> 102 <version>${spring.version}</version> 103 </dependency> 104 <dependency> 72 105 <groupId>org.hsqldb</groupId> 73 106 <artifactId>hsqldb</artifactId> … … 108 141 <version>${slf4j.version}</version> 109 142 </dependency> 110 <!-- <dependency>111 <groupId>javax.servlet</groupId>112 <artifactId>servlet-api</artifactId>113 <version>2.5</version>114 <scope>provided</scope>115 </dependency>116 -->117 143 <dependency> 118 144 <groupId>de.mpg.mpgaai</groupId> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/DBIntegrityService.java
r4941 r4985 322 322 boolean createAnnotationInNotebook(Number notebookID, Annotation annotation, Number ownerID) throws NotInDataBaseException; 323 323 324 public Principal create ShibbolizedPrincipal(String remoteID);324 public Principal createPrincipalRecord(String remoteID); 325 325 326 326 /** -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/DBIntegrityServiceImlp.java
r4941 r4985 851 851 852 852 @Override 853 public Principal create ShibbolizedPrincipal(String remoteID) {853 public Principal createPrincipalRecord(String remoteID) { 854 854 return principalDao.createShibbolizedPrincipal(remoteID); 855 855 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java
r4969 r4985 22 22 import eu.dasish.annotation.schema.Principal; 23 23 import java.io.IOException; 24 import java .sql.SQLException;24 import javax.servlet.ServletException; 25 25 import javax.ws.rs.GET; 26 26 import javax.ws.rs.Path; … … 38 38 @Component 39 39 @Path("/authentication") 40 @Transactional(rollbackFor = {Exception.class, SQLException.class,IOException.class, ParserConfigurationException.class})40 @Transactional(rollbackFor = {Exception.class, IOException.class, ParserConfigurationException.class}) 41 41 public class AutheticationResource extends ResourceResource { 42 43 42 44 43 45 @GET … … 65 67 } 66 68 67 68 69 69 @GET 70 70 @Produces(MediaType.TEXT_XML) 71 71 @Path("logout") 72 72 @Transactional(readOnly = true) 73 public void logout() throws IOException { 73 public void logout() throws IOException, ServletException { 74 httpServletRequest.getSession().invalidate(); 74 75 httpServletResponse.sendRedirect(context.getInitParameter("eu.dasish.annotation.backend.logout")); 75 76 } 76 77 78 77 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/DebugResource.java
r4969 r4985 92 92 @Transactional(readOnly = true) 93 93 public String getLoggedInRemoteID() { 94 return httpServletRequest.getRemoteUser();94 return (httpServletRequest.getRemoteUser() != null) ? httpServletRequest.getRemoteUser() : "Null"; 95 95 } 96 96 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java
r4969 r4985 61 61 String remotePrincipal = httpServletRequest.getRemoteUser(); 62 62 verboseOutput = new VerboseOutput(loggerServer); 63 if (!remotePrincipal.equals("anonymous")) { 64 try { 65 return dbIntegrityService.getPrincipalInternalIDFromRemoteID(remotePrincipal); 66 } catch (NotInDataBaseException e) { 67 loggerServer.info(e.toString()); 68 loggerServer.info("The record for the user with the Shibboleth id " + remotePrincipal + " will be generated now automatically."); 63 if (remotePrincipal != null) { 64 if (!remotePrincipal.equals("anonymous")) { 69 65 try { 66 return dbIntegrityService.getPrincipalInternalIDFromRemoteID(remotePrincipal); 67 } catch (NotInDataBaseException e) { 68 loggerServer.info(e.toString()); 69 loggerServer.info("The record for the user with the Shibboleth id " + remotePrincipal + " will be generated now automatically."); 70 70 try { 71 return dbIntegrityService.addPrincipal(dbIntegrityService.createShibbolizedPrincipal(remotePrincipal), remotePrincipal); 72 } catch (PrincipalExists e2) { 73 loggerServer.info(e2.toString()); 74 httpServletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e2.toString()); 71 try { 72 return dbIntegrityService.addPrincipal(dbIntegrityService.createPrincipalRecord(remotePrincipal), remotePrincipal); 73 } catch (PrincipalExists e2) { 74 loggerServer.info(e2.toString()); 75 httpServletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e2.toString()); 76 return null; 77 } 78 } catch (NotInDataBaseException e1) { 79 loggerServer.info(e1.toString()); 80 httpServletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e1.toString()); 75 81 return null; 76 82 } 77 } catch (NotInDataBaseException e1) {78 loggerServer.info(e1.toString());79 httpServletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e1.toString());80 return null;81 83 } 84 } else { 85 loggerServer.info("Shibboleth fall-back. Logged in as 'anonymous' with no rights."); 86 httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, " Shibboleth fall-back. Logged in as 'anonymous' with no rights."); 87 return null; 82 88 } 83 89 } else { 84 loggerServer.info(" Shibboleth fall-back. Logged in as 'anonymous' with no rights.");85 httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, " Shibboleth fall-back. Logged in as 'anonymous' with no rights.");90 loggerServer.info("Null principal"); 91 httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, " Null principal"); 86 92 return null; 87 93 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
r4969 r4985 35 35 <param-name>eu.dasish.annotation.backend.schemaLocation</param-name> 36 36 <param-value>http://www.dasish.eu/ns/addit https://svn.clarin.eu/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd</param-value> 37 <!-- <param-value>http://www.dasish.eu/ns/addit file:/Users/olhsha/repositories/DASISH/t5.6/schema/trunk/annotator-schema/src/main/target/DASISH-schema.xsd</param-value> -->37 <!-- <param-value>http://www.dasish.eu/ns/addit file:/Users/olhsha/repositories/DASISH/t5.6/schema/trunk/annotator-schema/src/main/target/DASISH-schema.xsd</param-value> --> 38 38 </context-param> 39 39 <context-param> … … 47 47 <context-param> 48 48 <param-name>eu.dasish.annotation.backend.logout</param-name> 49 <param-value>/ds/webannotator?shhaaDo=lO</param-value> 49 <!-- <param-value>/ds/webannotator?shhaaDo=lO</param-value> --> 50 <!-- <param-value>/ds/webannotator/j_spring_security_logout</param-value> --> 51 <param-value>/annotator-backend/j_spring_security_logout</param-value> 50 52 </context-param> 51 53 … … 82 84 </servlet-mapping> 83 85 84 <!-- <security-constraint>86 <!-- <security-constraint> 85 87 <display-name>Protected backend localhost</display-name> 86 88 <web-resource-collection> … … 105 107 <role-name>tomcat</role-name> 106 108 </security-role> --> 107 109 110 <!-- Spring security --> 108 111 <filter> 112 <filter-name>springSecurityFilterChain</filter-name> 113 <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 114 </filter> 115 <filter-mapping> 116 <filter-name>springSecurityFilterChain</filter-name> 117 <url-pattern>/*</url-pattern> 118 </filter-mapping> 119 120 <!-- Shibboleth filter --> 121 <!-- <filter> 109 122 <filter-name>AAIFilter</filter-name> 110 123 <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class> … … 113 126 <filter-name>AAIFilter</filter-name> 114 127 <url-pattern>/*</url-pattern> 115 </filter-mapping> 128 </filter-mapping> --> 116 129 117 130
Note: See TracChangeset
for help on using the changeset viewer.