Commit dc48b4b
authored
Add attribute count to SamlAttribute toString (elastic#131173)
Sometimes SAML IdPs send what _should_ be a list of values as a single
comma-separated string.
That is, we expect something using SAML's multi-valued attribute
feature:
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
Name="http://idp.example.org/attributes/groups" FriendlyName="groups">
<saml:AttributeValue>engineering</saml:AttributeValue>
<saml:AttributeValue>elasticsearch-admins</saml:AttributeValue>
<saml:AttributeValue>employees</saml:AttributeValue>
</saml:Attribute>
but we get
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
Name="http://idp.example.org/attributes/groups" FriendlyName="groups">
<saml:AttributeValue>engineering,elasticsearch-admins,employees</saml:AttributeValue>
</saml:Attribute>
In order to help detect these cases, this commit changes the
`toString()` on `SamlAttribute` to include the length (e.g. `(len=1)`)
at the end
Relates: elastic#84379, elastic#1027691 parent 13aceaa commit dc48b4b
File tree
3 files changed
+62
-2
lines changed- docs/changelog
- x-pack/plugin/security/src
- main/java/org/elasticsearch/xpack/security/authc/saml
- test/java/org/elasticsearch/xpack/security/authc/saml
3 files changed
+62
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | | - | |
| 99 | + | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments