Changeset 4209


Ignore:
Timestamp:
12/20/13 15:59:51 (10 years ago)
Author:
olhsha
Message:

following Eric's instruction in security management in Dasish: removing a separate security DB, making authentication tables the part of the main DB, keeping hashed passwords. Used spring-security configuration for hashes with BCryptPasswordEncoder as recommended.

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
Files:
2 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml

    r4173 r4209  
    2020        <config-files>
    2121            <config-file>src/main/resources/spring-config/applicationContext-security.xml</config-file>
    22             <config-file>src/main/resources/spring-config/securityDataSource.xml</config-file>
    23             <config-file>src/test/resources/spring-test-config/jaxbMarshallerFactory.xml</config-file>
    24             <config-file>src/test/resources/spring-integrity-test-config/dataSource.xml</config-file>
    25             <config-file>src/test/resources/spring-integrity-test-config/annotationDao.xml</config-file>
    26             <config-file>src/test/resources/spring-integrity-test-config/userDao.xml</config-file>
    27             <config-file>src/test/resources/spring-integrity-test-config/targetDao.xml</config-file>
    28             <config-file>src/test/resources/spring-integrity-test-config/cachedRepresentationDao.xml</config-file>
    29             <config-file>src/test/resources/spring-integrity-test-config/componentscan.xml</config-file>
    30             <config-file>src/test/resources/spring-integrity-test-config/dbIntegrityService.xml</config-file>
    31             <config-file>src/test/resources/spring-integrity-test-config/JaxbMarshallerFactory.xml</config-file>
     22            <config-file>src/main/resources/spring-config/bCryptPasswordEncoder.xml</config-file>
    3223        </config-files>
    3324        <config-file-groups/>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml

    r4181 r4209  
    246246    <properties>
    247247        <jersey.version>1.17.1</jersey.version>
    248         <spring.version>3.0.0.RELEASE</spring.version>
     248        <spring.version>3.2.0.RELEASE</spring.version>
    249249        <slf4j.version>1.7.5</slf4j.version>
    250250        <glassfish.version>3.1.1</glassfish.version>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java

    r4207 r4209  
    124124            return rootElement;
    125125        } else {
    126             httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
     126            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
    127127            return null;
    128128        }
     
    145145            return new ObjectFactory().createTargetList(TargetList);
    146146        } else {
    147             httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
     147            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
    148148            return null;
    149149        }
     
    188188            return new ObjectFactory().createPermissionList(permissionList);
    189189        } else {
    190             httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
     190            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
    191191            return null;
    192192        }
     
    209209            return result + " annotation(s) deleted.";
    210210        } else {
    211             httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
     211            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot delete the annotation. Only the owner can delete the annotation.");
    212212            return null;
    213213        }
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml

    r4013 r4209  
    2525           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    2626           http://www.springframework.org/schema/security
    27            http://www.springframework.org/schema/security/spring-security-3.0.xsd">   
     27           http://www.springframework.org/schema/security/spring-security-3.2.xsd">   
    2828
    2929
     
    3636</http>
    3737
    38 
    3938<authentication-manager>
    4039    <authentication-provider>
    41         <jdbc-user-service data-source-ref="securityDataSource"/>
     40        <password-encoder ref="bCryptPasswordEncoder"/>
     41        <jdbc-user-service data-source-ref="dataSource"/>
    4242    </authentication-provider>
    4343</authentication-manager>
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/cachedRepresentationDao.xml

    r3236 r4209  
    2121<beans xmlns="http://www.springframework.org/schema/beans"
    2222       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    23 
    2423       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    2524">
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java

    r4183 r4209  
    250250        return resource.header(HttpHeaders.AUTHORIZATION, "Basic "  + new String(Base64.encode(DummyPrincipal.DUMMY_PRINCIPAL.getName()+":olhapassword")));
    251251    }
     252   
     253   
    252254}
Note: See TracChangeset for help on using the changeset viewer.