Merge pull request #3937 from sebastienblanc/document_sb_properties

KEYCLOAK-4565 : javadoc for adapter properties and add metada generator
This commit is contained in:
Stian Thorgersen 2017-03-14 10:19:34 +01:00 committed by GitHub
commit a555f99b1a
2 changed files with 34 additions and 2 deletions

View file

@ -31,7 +31,7 @@
<description/> <description/>
<properties> <properties>
<spring-boot.version>1.2.1.RELEASE</spring-boot.version> <spring-boot.version>1.3.0.RELEASE</spring-boot.version>
</properties> </properties>
<dependencies> <dependencies>
@ -111,6 +111,13 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
<version>${spring-boot.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>

View file

@ -38,9 +38,16 @@ public class KeycloakSpringBootProperties extends AdapterConfig {
return config; return config;
} }
/**
* To provide Java EE security constraints
*/
private List<SecurityConstraint> securityConstraints = new ArrayList<SecurityConstraint>(); private List<SecurityConstraint> securityConstraints = new ArrayList<SecurityConstraint>();
@ConfigurationProperties()
public static class SecurityConstraint { public static class SecurityConstraint {
/**
* A list of security collections
*/
private List<SecurityCollection> securityCollections = new ArrayList<SecurityCollection>(); private List<SecurityCollection> securityCollections = new ArrayList<SecurityCollection>();
public List<SecurityCollection> getSecurityCollections() { public List<SecurityCollection> getSecurityCollections() {
@ -51,13 +58,31 @@ public class KeycloakSpringBootProperties extends AdapterConfig {
this.securityCollections = securityCollections; this.securityCollections = securityCollections;
} }
} }
@ConfigurationProperties()
public static class SecurityCollection { public static class SecurityCollection {
/**
* The name of your security constraint
*/
private String name; private String name;
/**
* The description of your security collection
*/
private String description; private String description;
/**
* A list of roles that applies for this security collection
*/
private List<String> authRoles = new ArrayList<String>(); private List<String> authRoles = new ArrayList<String>();
/**
* A list of URL patterns that should match to apply the security collection
*/
private List<String> patterns = new ArrayList<String>(); private List<String> patterns = new ArrayList<String>();
/**
* A list of HTTP methods that applies for this security collection
*/
private List<String> methods = new ArrayList<String>(); private List<String> methods = new ArrayList<String>();
/**
* A list of HTTP methods that will be omitted for this security collection
*/
private List<String> omittedMethods = new ArrayList<String>(); private List<String> omittedMethods = new ArrayList<String>();
public List<String> getAuthRoles() { public List<String> getAuthRoles() {