Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
App Blocks
Commits
9afc28c6
Commit
9afc28c6
authored
Sep 20, 2017
by
Matija Obreza
Browse files
Cleanup
parent
32319b64
Changes
8
Hide whitespace changes
Inline
Side-by-side
auditlog/src/test/java/org/genesys/blocks/auditlog/test/DatabaseConfig.java
View file @
9afc28c6
...
...
@@ -92,6 +92,7 @@ public class DatabaseConfig {
dataSource
.
setTestWhileIdle
(
true
);
dataSource
.
setTestOnBorrow
(
true
);
dataSource
.
setMaxActive
(
dbPoolMaxActive
);
dataSource
.
setMaxIdle
(
dbPoolInitialSize
);
dataSource
.
setInitialSize
(
dbPoolInitialSize
);
dataSource
.
setMinIdle
(
dbPoolInitialSize
);
return
dataSource
;
...
...
core/pom.xml
View file @
9afc28c6
...
...
@@ -76,32 +76,5 @@
<dependencies>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
<version>
${hibernate.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-jpa
</artifactId>
<version>
${spring.data.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
${jackson.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.querydsl
</groupId>
<artifactId>
querydsl-jpa
</artifactId>
<version>
${querydsl.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
parent/pom.xml
View file @
9afc28c6
...
...
@@ -48,7 +48,8 @@
<querydsl.version>
4.1.4
</querydsl.version>
<spring.security.version>
4.1.3.RELEASE
</spring.security.version>
<hibernate.version>
4.3.11.Final
</hibernate.version>
<hsqldb.version>
2.3.4
</hsqldb.version>
<hsqldb.version>
2.4.0
</hsqldb.version>
<tomcat-jdbc.version>
8.5.8
</tomcat-jdbc.version>
<ehcache.version>
2.7.4
</ehcache.version>
</properties>
...
...
@@ -165,6 +166,41 @@
<version>
3.3.2
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
<version>
${hibernate.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-jpa
</artifactId>
<version>
${spring.data.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
${jackson.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.querydsl
</groupId>
<artifactId>
querydsl-jpa
</artifactId>
<version>
${querydsl.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<version>
${spring.version}
</version>
<scope>
test
</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
...
...
@@ -180,6 +216,20 @@
<version>
1.3
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat
</groupId>
<artifactId>
tomcat-jdbc
</artifactId>
<version>
${tomcat-jdbc.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.hsqldb
</groupId>
<artifactId>
hsqldb
</artifactId>
<version>
${hsqldb.version}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
security/pom.xml
View file @
9afc28c6
...
...
@@ -135,6 +135,7 @@
<groupId>
org.springframework
</groupId>
<artifactId>
spring-core
</artifactId>
<version>
${spring.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
...
...
@@ -151,34 +152,18 @@
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.hsqldb
</groupId>
<artifactId>
hsqldb
</artifactId>
<version>
${hsqldb.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.tomcat
</groupId>
<artifactId>
tomcat-jdbc
</artifactId>
<version>
8.5.8
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.datatype
</groupId>
<artifactId>
jackson-datatype-hibernate4
</artifactId>
<version>
${jackson.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-ehcache
</artifactId>
<version>
${hibernate.version}
</version>
<exclusions>
<exclusion>
<artifactId>
slf4j-api
</artifactId>
<groupId>
org.slf4j
</groupId>
</exclusion>
</exclusions>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
security/src/main/java/org/genesys/blocks/security/SecurityContextUtil.java
View file @
9afc28c6
...
...
@@ -36,6 +36,7 @@ public class SecurityContextUtil {
/**
* @return current user
*/
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
extends
BasicUser
<?>>
T
getMe
()
{
final
Authentication
auth
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
...
...
@@ -46,6 +47,7 @@ public class SecurityContextUtil {
}
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
extends
BasicUser
<?>>
T
getCurrentUser
()
{
final
Authentication
authentication
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
...
...
security/src/main/java/org/genesys/blocks/security/component/Slf4jLogAuditLogger.java
View file @
9afc28c6
...
...
@@ -21,7 +21,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.security.acls.domain.AuditLogger
;
import
org.springframework.security.acls.model.AccessControlEntry
;
import
org.springframework.security.acls.model.AuditableAccessControlEntry
;
import
org.springframework.util.Assert
;
public
class
Slf4jLogAuditLogger
implements
AuditLogger
{
...
...
@@ -29,9 +28,7 @@ public class Slf4jLogAuditLogger implements AuditLogger {
@Override
public
void
logIfNeeded
(
boolean
granted
,
AccessControlEntry
ace
)
{
Assert
.
notNull
(
ace
,
"AccessControlEntry required"
);
if
(
ace
instanceof
AuditableAccessControlEntry
)
{
if
(
ace
!=
null
&&
ace
instanceof
AuditableAccessControlEntry
)
{
final
AuditableAccessControlEntry
auditableAce
=
(
AuditableAccessControlEntry
)
ace
;
if
(
granted
&&
auditableAce
.
isAuditSuccess
())
{
...
...
@@ -40,6 +37,5 @@ public class Slf4jLogAuditLogger implements AuditLogger {
LOG
.
debug
(
"DENIED due to ACE: "
+
ace
);
}
}
}
}
security/src/test/java/org/genesys/blocks/security/config/DatabaseConfig.java
View file @
9afc28c6
...
...
@@ -92,6 +92,7 @@ public class DatabaseConfig {
dataSource
.
setTestWhileIdle
(
true
);
dataSource
.
setTestOnBorrow
(
true
);
dataSource
.
setMaxActive
(
dbPoolMaxActive
);
dataSource
.
setMaxIdle
(
dbPoolInitialSize
);
dataSource
.
setInitialSize
(
dbPoolInitialSize
);
dataSource
.
setMinIdle
(
dbPoolInitialSize
);
return
dataSource
;
...
...
security/src/test/resources/application.properties
View file @
9afc28c6
...
...
@@ -3,7 +3,7 @@ moc
db.url
=
jdbc:hsqldb:mem:test;sql.syntax_mys=true;sql.ignore_case=true
db.driverClassName
=
org.hsqldb.jdbc.JDBCDriver
db.hibernate.dialect
=
org.genesys.blocks.util.BetterHSQLDialect
db.showSql
=
tru
e
db.showSql
=
fals
e
db.updateSchema
=
true
# Connection pool
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment