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
6eeda76a
Commit
6eeda76a
authored
Apr 12, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.3.x'
parents
caaf8e96
a2f482b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
UserInfoTokenServices.java
...igure/security/oauth2/resource/UserInfoTokenServices.java
+7
-1
RelaxedDataBinder.java
...java/org/springframework/boot/bind/RelaxedDataBinder.java
+2
-2
RelaxedDataBinderTests.java
...org/springframework/boot/bind/RelaxedDataBinderTests.java
+22
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServices.java
View file @
6eeda76a
...
...
@@ -99,7 +99,13 @@ public class UserInfoTokenServices implements ResourceServerTokenServices {
return
new
OAuth2Authentication
(
request
,
token
);
}
private
Object
getPrincipal
(
Map
<
String
,
Object
>
map
)
{
/**
* Return the principal that should be used for the token. The default implementation
* looks for well know {@code user*} keys in the map.
* @param map the source map
* @return the principal or {@literal "unknown"}
*/
protected
Object
getPrincipal
(
Map
<
String
,
Object
>
map
)
{
for
(
String
key
:
PRINCIPAL_KEYS
)
{
if
(
map
.
containsKey
(
key
))
{
return
map
.
get
(
key
);
...
...
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java
View file @
6eeda76a
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -343,7 +343,7 @@ public class RelaxedDataBinder extends DataBinder {
return
;
}
Object
extend
=
new
LinkedHashMap
<
String
,
Object
>();
if
(!
elementDescriptor
.
isMap
()
&&
path
.
isArrayIndex
(
index
+
1
))
{
if
(!
elementDescriptor
.
isMap
()
&&
path
.
isArrayIndex
(
index
))
{
extend
=
new
ArrayList
<
Object
>();
}
wrapper
.
setPropertyValue
(
path
.
prefix
(
index
+
1
),
extend
);
...
...
spring-boot/src/test/java/org/springframework/boot/bind/RelaxedDataBinderTests.java
View file @
6eeda76a
...
...
@@ -643,6 +643,16 @@ public class RelaxedDataBinderTests {
assertThat
(
target
.
getFooBaz
()).
isEqualTo
(
"boo"
);
}
@Test
public
void
testIndexBounds
()
throws
Exception
{
VanillaTarget
target
=
new
VanillaTarget
();
RelaxedDataBinder
binder
=
getBinder
(
target
,
"test"
);
MutablePropertyValues
values
=
new
MutablePropertyValues
();
values
.
add
(
"test.objects[0]"
,
"teststring"
);
binder
.
bind
(
values
);
assertThat
(
target
.
getObjects
()).
containsExactly
(
"teststring"
);
}
private
void
doTestBindCaseInsensitiveEnums
(
VanillaTarget
target
)
throws
Exception
{
BindingResult
result
=
bind
(
target
,
"bingo: THIS"
);
assertThat
(
result
.
getErrorCount
()).
isEqualTo
(
0
);
...
...
@@ -1001,6 +1011,8 @@ public class RelaxedDataBinderTests {
private
List
<
Bingo
>
bingos
;
private
List
<
Object
>
objects
;
public
char
[]
getBar
()
{
return
this
.
bar
;
}
...
...
@@ -1056,6 +1068,15 @@ public class RelaxedDataBinderTests {
public
void
setBingos
(
List
<
Bingo
>
bingos
)
{
this
.
bingos
=
bingos
;
}
public
List
<
Object
>
getObjects
()
{
return
this
.
objects
;
}
public
void
setObjects
(
List
<
Object
>
objects
)
{
this
.
objects
=
objects
;
}
}
enum
Bingo
{
...
...
@@ -1076,4 +1097,5 @@ public class RelaxedDataBinderTests {
}
}
}
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