Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
1a4f6df0
Commit
1a4f6df0
authored
May 07, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to Spring Ldap 2.3.3.RELEASE
Closes gh-21342
parent
66afe280
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
LdapProperties.java
...ringframework/boot/autoconfigure/ldap/LdapProperties.java
+6
-5
LdapAutoConfigurationTests.java
...k/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java
+13
-4
pom.xml
spring-boot-project/spring-boot-dependencies/pom.xml
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java
View file @
1a4f6df0
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -56,9 +56,10 @@ public class LdapProperties {
...
@@ -56,9 +56,10 @@ public class LdapProperties {
private
String
password
;
private
String
password
;
/**
/**
* Whether read-only operations should use an anonymous environment.
* Whether read-only operations should use an anonymous environment. Disabled by
* default unless a username is set.
*/
*/
private
b
oolean
anonymousReadOnly
;
private
B
oolean
anonymousReadOnly
;
/**
/**
* LDAP specification settings.
* LDAP specification settings.
...
@@ -97,11 +98,11 @@ public class LdapProperties {
...
@@ -97,11 +98,11 @@ public class LdapProperties {
this
.
password
=
password
;
this
.
password
=
password
;
}
}
public
b
oolean
getAnonymousReadOnly
()
{
public
B
oolean
getAnonymousReadOnly
()
{
return
this
.
anonymousReadOnly
;
return
this
.
anonymousReadOnly
;
}
}
public
void
setAnonymousReadOnly
(
b
oolean
anonymousReadOnly
)
{
public
void
setAnonymousReadOnly
(
B
oolean
anonymousReadOnly
)
{
this
.
anonymousReadOnly
=
anonymousReadOnly
;
this
.
anonymousReadOnly
=
anonymousReadOnly
;
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java
View file @
1a4f6df0
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -48,7 +48,7 @@ public class LdapAutoConfigurationTests {
...
@@ -48,7 +48,7 @@ public class LdapAutoConfigurationTests {
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
String
[]
urls
=
getUrls
(
contextSource
);
String
[]
urls
=
getUrls
(
contextSource
);
assertThat
(
urls
).
containsExactly
(
"ldap://localhost:389"
);
assertThat
(
urls
).
containsExactly
(
"ldap://localhost:389"
);
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Fals
e
();
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Tru
e
();
});
});
}
}
...
@@ -73,6 +73,15 @@ public class LdapAutoConfigurationTests {
...
@@ -73,6 +73,15 @@ public class LdapAutoConfigurationTests {
});
});
}
}
@Test
public
void
contextSourceWithUserDoesNotEnableAnonymousReadOnly
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.ldap.username:root"
).
run
((
context
)
->
{
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
assertThat
(
contextSource
.
getUserDn
()).
isEqualTo
(
"root"
);
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
isFalse
();
});
}
@Test
@Test
public
void
contextSourceWithExtraCustomization
()
{
public
void
contextSourceWithExtraCustomization
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.ldap.urls:ldap://localhost:123"
,
"spring.ldap.username:root"
,
this
.
contextRunner
.
withPropertyValues
(
"spring.ldap.urls:ldap://localhost:123"
,
"spring.ldap.username:root"
,
...
@@ -96,7 +105,7 @@ public class LdapAutoConfigurationTests {
...
@@ -96,7 +105,7 @@ public class LdapAutoConfigurationTests {
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
assertThat
(
contextSource
.
getUserDn
()).
isEqualTo
(
""
);
assertThat
(
contextSource
.
getUserDn
()).
isEqualTo
(
""
);
assertThat
(
contextSource
.
getPassword
()).
isEqualTo
(
""
);
assertThat
(
contextSource
.
getPassword
()).
isEqualTo
(
""
);
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Fals
e
();
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Tru
e
();
assertThat
(
contextSource
.
getBaseLdapPathAsString
()).
isEqualTo
(
""
);
assertThat
(
contextSource
.
getBaseLdapPathAsString
()).
isEqualTo
(
""
);
});
});
}
}
...
@@ -113,7 +122,7 @@ public class LdapAutoConfigurationTests {
...
@@ -113,7 +122,7 @@ public class LdapAutoConfigurationTests {
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
LdapContextSource
contextSource
=
context
.
getBean
(
LdapContextSource
.
class
);
String
[]
urls
=
getUrls
(
contextSource
);
String
[]
urls
=
getUrls
(
contextSource
);
assertThat
(
urls
).
containsExactly
(
"ldap://localhost:389"
);
assertThat
(
urls
).
containsExactly
(
"ldap://localhost:389"
);
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Fals
e
();
assertThat
(
contextSource
.
isAnonymousReadOnly
()).
is
Tru
e
();
});
});
}
}
...
...
spring-boot-project/spring-boot-dependencies/pom.xml
View file @
1a4f6df0
...
@@ -174,7 +174,7 @@
...
@@ -174,7 +174,7 @@
<spring-hateoas.version>
0.25.2.RELEASE
</spring-hateoas.version>
<spring-hateoas.version>
0.25.2.RELEASE
</spring-hateoas.version>
<spring-integration.version>
5.1.10.RELEASE
</spring-integration.version>
<spring-integration.version>
5.1.10.RELEASE
</spring-integration.version>
<spring-kafka.version>
2.2.13.RELEASE
</spring-kafka.version>
<spring-kafka.version>
2.2.13.RELEASE
</spring-kafka.version>
<spring-ldap.version>
2.3.
2
.RELEASE
</spring-ldap.version>
<spring-ldap.version>
2.3.
3
.RELEASE
</spring-ldap.version>
<spring-plugin.version>
1.2.0.RELEASE
</spring-plugin.version>
<spring-plugin.version>
1.2.0.RELEASE
</spring-plugin.version>
<spring-restdocs.version>
2.0.4.RELEASE
</spring-restdocs.version>
<spring-restdocs.version>
2.0.4.RELEASE
</spring-restdocs.version>
<spring-retry.version>
1.2.5.RELEASE
</spring-retry.version>
<spring-retry.version>
1.2.5.RELEASE
</spring-retry.version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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