SEC-2448: Update to HSQL 2.3.1
This commit is contained in:
parent
04fac30d75
commit
2df5541905
|
@ -119,6 +119,9 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
||||||
* @param acl containing the ACEs to insert
|
* @param acl containing the ACEs to insert
|
||||||
*/
|
*/
|
||||||
protected void createEntries(final MutableAcl acl) {
|
protected void createEntries(final MutableAcl acl) {
|
||||||
|
if(acl.getEntries().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
jdbcTemplate.batchUpdate(insertEntry,
|
jdbcTemplate.batchUpdate(insertEntry,
|
||||||
new BatchPreparedStatementSetter() {
|
new BatchPreparedStatementSetter() {
|
||||||
public int getBatchSize() {
|
public int getBatchSize() {
|
||||||
|
|
|
@ -52,7 +52,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
testRuntime "hsqldb:hsqldb:$hsqlVersion",
|
testRuntime "org.hsqldb:hsqldb:$hsqlVersion",
|
||||||
"cglib:cglib-nodep:2.2"
|
"cglib:cglib-nodep:2.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class DataSourcePopulator implements InitializingBean {
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() throws Exception {
|
||||||
Assert.notNull(template, "dataSource required");
|
Assert.notNull(template, "dataSource required");
|
||||||
|
|
||||||
template.execute("CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
template.execute("CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(500) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
||||||
template.execute("CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
template.execute("CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
||||||
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ dependencies {
|
||||||
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||||
powerMockDependencies
|
powerMockDependencies
|
||||||
|
|
||||||
testRuntime "hsqldb:hsqldb:$hsqlVersion",
|
testRuntime "org.hsqldb:hsqldb:$hsqlVersion",
|
||||||
"cglib:cglib-nodep:$cglibVersion"
|
"cglib:cglib-nodep:$cglibVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class PopulatedDatabase {
|
||||||
JdbcTemplate template = new JdbcTemplate(dataSource);
|
JdbcTemplate template = new JdbcTemplate(dataSource);
|
||||||
|
|
||||||
template.execute(
|
template.execute(
|
||||||
"CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL)");
|
"CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(500) NOT NULL,ENABLED BOOLEAN NOT NULL)");
|
||||||
template.execute(
|
template.execute(
|
||||||
"CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME))");
|
"CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME))");
|
||||||
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY)");
|
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY)");
|
||||||
|
|
|
@ -17,7 +17,7 @@ ext.aspectjVersion = '1.6.10'
|
||||||
ext.apacheDsVersion = '1.5.5'
|
ext.apacheDsVersion = '1.5.5'
|
||||||
ext.jstlVersion = '1.2'
|
ext.jstlVersion = '1.2'
|
||||||
ext.jettyVersion = '6.1.26'
|
ext.jettyVersion = '6.1.26'
|
||||||
ext.hsqlVersion = '1.8.0.10'
|
ext.hsqlVersion = '2.3.1'
|
||||||
ext.slf4jVersion = '1.7.5'
|
ext.slf4jVersion = '1.7.5'
|
||||||
ext.logbackVersion = '0.9.29'
|
ext.logbackVersion = '0.9.29'
|
||||||
ext.cglibVersion = '2.2'
|
ext.cglibVersion = '2.2'
|
||||||
|
|
|
@ -20,7 +20,7 @@ dependencies {
|
||||||
project(':spring-security-taglibs'),
|
project(':spring-security-taglibs'),
|
||||||
"org.springframework:spring-context-support:$springVersion",
|
"org.springframework:spring-context-support:$springVersion",
|
||||||
"javax.servlet:jstl:$jstlVersion",
|
"javax.servlet:jstl:$jstlVersion",
|
||||||
"hsqldb:hsqldb:$hsqlVersion",
|
"org.hsqldb:hsqldb:$hsqlVersion",
|
||||||
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||||
"ch.qos.logback:logback-classic:$logbackVersion",
|
"ch.qos.logback:logback-classic:$logbackVersion",
|
||||||
"net.sf.ehcache:ehcache:$ehcacheVersion"
|
"net.sf.ehcache:ehcache:$ehcacheVersion"
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class DataSourcePopulator implements InitializingBean {
|
||||||
"CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));");
|
"CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));");
|
||||||
|
|
||||||
template.execute(
|
template.execute(
|
||||||
"CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
"CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(500) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
||||||
template.execute(
|
template.execute(
|
||||||
"CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
"CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
||||||
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
||||||
|
|
|
@ -9,7 +9,7 @@ dependencies {
|
||||||
testCompile "org.springframework:spring-context:$springVersion"
|
testCompile "org.springframework:spring-context:$springVersion"
|
||||||
|
|
||||||
runtime project(':spring-security-config'),
|
runtime project(':spring-security-config'),
|
||||||
"hsqldb:hsqldb:$hsqlVersion",
|
"org.hsqldb:hsqldb:$hsqlVersion",
|
||||||
"org.springframework:spring-context-support:$springVersion"
|
"org.springframework:spring-context-support:$springVersion"
|
||||||
|
|
||||||
optional "net.sf.ehcache:ehcache:$ehcacheVersion"
|
optional "net.sf.ehcache:ehcache:$ehcacheVersion"
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class DataSourcePopulator implements InitializingBean {
|
||||||
template.execute("CREATE TABLE ACL_ENTRY(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,ACL_OBJECT_IDENTITY BIGINT NOT NULL,ACE_ORDER INT NOT NULL,SID BIGINT NOT NULL,MASK INTEGER NOT NULL,GRANTING BOOLEAN NOT NULL,AUDIT_SUCCESS BOOLEAN NOT NULL,AUDIT_FAILURE BOOLEAN NOT NULL,CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER),CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));");
|
template.execute("CREATE TABLE ACL_ENTRY(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,ACL_OBJECT_IDENTITY BIGINT NOT NULL,ACE_ORDER INT NOT NULL,SID BIGINT NOT NULL,MASK INTEGER NOT NULL,GRANTING BOOLEAN NOT NULL,AUDIT_SUCCESS BOOLEAN NOT NULL,AUDIT_FAILURE BOOLEAN NOT NULL,CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER),CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));");
|
||||||
|
|
||||||
// Normal authentication tables
|
// Normal authentication tables
|
||||||
template.execute("CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
template.execute("CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(500) NOT NULL,ENABLED BOOLEAN NOT NULL);");
|
||||||
template.execute("CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
template.execute("CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
|
||||||
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
insert into message(id,created,summary,text) values (100,'2013-10-04 10:00:00','Hello Rob','This message is for Rob');
|
insert into message(created,summary,text) values ('2013-10-04 10:00:00','Hello Rob','This message is for Rob');
|
||||||
insert into message(id,created,summary,text) values (110,'2013-10-04 10:00:00','Hello Luke','This message is for Luke');
|
insert into message(created,summary,text) values ('2013-10-04 10:00:00','Hello Luke','This message is for Luke');
|
|
@ -37,7 +37,7 @@ dependencies {
|
||||||
'org.apache.directory.server:apacheds-core:1.5.5',
|
'org.apache.directory.server:apacheds-core:1.5.5',
|
||||||
'org.apache.directory.server:apacheds-server-jndi:1.5.5',
|
'org.apache.directory.server:apacheds-server-jndi:1.5.5',
|
||||||
'org.freemarker:freemarker:2.3.16',
|
'org.freemarker:freemarker:2.3.16',
|
||||||
"hsqldb:hsqldb:1.8.0.10",
|
"org.hsqldb:hsqldb:1.8.0.10",
|
||||||
'org.slf4j:slf4j-log4j12:1.5.11',
|
'org.slf4j:slf4j-log4j12:1.5.11',
|
||||||
'log4j:log4j:1.2.14'
|
'log4j:log4j:1.2.14'
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class JdbcTokenRepositoryImplTests {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void createDataSource() {
|
public static void createDataSource() {
|
||||||
dataSource = new SingleConnectionDataSource("jdbc:hsqldb:mem:tokenrepotest", "sa", "", true);
|
dataSource = new SingleConnectionDataSource("jdbc:hsqldb:mem:tokenrepotest", "sa", "", true);
|
||||||
dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
|
dataSource.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
@ -72,8 +72,8 @@ public class JdbcTokenRepositoryImplTests {
|
||||||
repo.setDataSource(dataSource);
|
repo.setDataSource(dataSource);
|
||||||
repo.initDao();
|
repo.initDao();
|
||||||
template = repo.getJdbcTemplate();
|
template = repo.getJdbcTemplate();
|
||||||
template.execute("create table persistent_logins (username varchar not null, " +
|
template.execute("create table persistent_logins (username varchar(100) not null, " +
|
||||||
"series varchar not null, token varchar not null, last_used timestamp not null)");
|
"series varchar(100) not null, token varchar(500) not null, last_used timestamp not null)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|
|
@ -22,5 +22,5 @@ dependencies {
|
||||||
"org.codehaus.groovy:groovy:$groovyVersion",
|
"org.codehaus.groovy:groovy:$groovyVersion",
|
||||||
powerMockDependencies
|
powerMockDependencies
|
||||||
|
|
||||||
testRuntime "hsqldb:hsqldb:$hsqlVersion"
|
testRuntime "org.hsqldb:hsqldb:$hsqlVersion"
|
||||||
}
|
}
|
Loading…
Reference in New Issue