Polish contribution
Closes gh-8195
This commit is contained in:
@@ -113,15 +113,17 @@ public class EmbeddedLdapAutoConfiguration {
|
||||
if (!this.embeddedProperties.getValidation().isEnabled()) {
|
||||
config.setSchema(null);
|
||||
}
|
||||
else if (this.embeddedProperties.getValidation().getSchema() != null) {
|
||||
Resource schemaLocation = this.embeddedProperties.getValidation().getSchema();
|
||||
try {
|
||||
config.setSchema(Schema.mergeSchemas(Schema.getDefaultStandardSchema(),
|
||||
Schema.getSchema(schemaLocation.getFile())));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException(
|
||||
"Unable to load schema " + schemaLocation.getDescription(), ex);
|
||||
else {
|
||||
Resource schema = this.embeddedProperties.getValidation().getSchema();
|
||||
if (schema != null) {
|
||||
try {
|
||||
config.setSchema(Schema.mergeSchemas(Schema.getDefaultStandardSchema(),
|
||||
Schema.getSchema(schema.getInputStream())));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException(
|
||||
"Unable to load schema " + schema.getDescription(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class EmbeddedLdapProperties {
|
||||
private String ldif = "classpath:schema.ldif";
|
||||
|
||||
/**
|
||||
* Schema validation
|
||||
* Schema validation.
|
||||
*/
|
||||
private Validation validation = new Validation();
|
||||
|
||||
@@ -90,7 +90,7 @@ public class EmbeddedLdapProperties {
|
||||
return this.validation;
|
||||
}
|
||||
|
||||
static class Credential {
|
||||
public static class Credential {
|
||||
|
||||
/**
|
||||
* Embedded LDAP username.
|
||||
@@ -120,15 +120,15 @@ public class EmbeddedLdapProperties {
|
||||
|
||||
}
|
||||
|
||||
static class Validation {
|
||||
public static class Validation {
|
||||
|
||||
/**
|
||||
* Enable LDAP schema validation
|
||||
* Enable LDAP schema validation.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* Path to the custom schema file
|
||||
* Path to the custom schema.
|
||||
*/
|
||||
private Resource schema;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user