Skip to content

Instantly share code, notes, and snippets.

@Bean
public FilterChainProxy samlFilter() throws Exception {
List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
chains.add(new DefaultSecurityFilterChain(
new AntPathRequestMatcher("/saml/metadata/**"), metadataDisplayFilter()));
return new FilterChainProxy(chains);
}
@Bean
public MetadataGeneratorFilter metadataGeneratorFilter() {
MetadataGenerator metadataGenerator = new MetadataGenerator();
metadataGenerator.setEntityId("cz:swsamuraj:wicket:spring:sp");
metadataGenerator.setKeyManager(keyManager());
return new MetadataGeneratorFilter(metadataGenerator);
}
@Bean
public MetadataProvider metadataProvider()
throws ResourceException, MetadataProviderException {
ClasspathResource resource =
new ClasspathResource("/metadata/FederationMetadata.xml");
ResourceBackedMetadataProvider provider = new
ResourceBackedMetadataProvider(timer, resource);
provider.setParserPool(parserPool());
@sw-samuraj
sw-samuraj / off-log4j2.xml
Created December 4, 2017 13:29
An example of disabled logging.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Loggers>
<Root level="off"/>
</Loggers>
</Configuration>
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = false
keepBackup = false
@sw-samuraj
sw-samuraj / vimdiff-hgrc.properties
Created November 6, 2017 08:38
A .hgrc configuration for vimdiff as a merge tool and an external diff tool.
[ui]
merge = vimdiff
[merge-tools]
vimdiff.executable = vimdiff
vimdiff.args = -f -d $output -M $local $base $other -c "wincmd J" -c "set modifiable" -c "set write"
vimdiff.premerge = keep
[extensions]
hgext.extdiff =
@sw-samuraj
sw-samuraj / junit5-sonar-build.gradle
Last active November 1, 2017 21:19
A minimalistic Gradle configuration for Sonar with JaCoCo and JUnit 5.
apply plugin: 'org.sonarqube'
ext {
sonarProjectName = 'blog-junit5-gradle'
sonarProjectKey = 'cz.swsamuraj.junit5.gradle'
jacocoDestinationFile = "${buildDir}/jacoco/test.exec"
jacocoExclusions = ['**/Main*']
}
sonarqube {
@sw-samuraj
sw-samuraj / junit5-jacoco-build.gradle
Last active July 2, 2018 04:38
A minimalistic Gradle configuration for JaCoCo with JUnit 5.
apply plugin: 'jacoco'
jacoco {
toolVersion = '0.7.9'
applyTo junitPlatformTest
}
jacocoTestReport {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
@sw-samuraj
sw-samuraj / junit5-simple-pom.xml
Last active June 2, 2018 17:41
A minimalistic Maven configuration for JUnit 5.
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@sw-samuraj
sw-samuraj / junit5-simple-build.gradle
Last active October 31, 2017 09:18
A minimalistic Gradle configuration for JUnit 5.
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
ext.junitVersion = '5.0.1'
repositories {
mavenCentral()
}
dependencies {