Currently if there are repeated same attributes (not their values) in the response, the last one just overrides the previous ones. This library supports only if there are multiple values inside one attribute. I think it would be better to make sure no data is lost with strange SAML implementations to flatten and marge them all into one output slice, pretending like they were just values inside one attribute.
Currently it is in retrieve_assertion.go:
for _, attribute := range attributeStatement.Attributes {
assertionInfo.Values[attribute.Name] = attribute
}
I think something like this would be better:
for _, attribute := range attributeStatement.Attributes {
if v, ok := assertionInfo.Values[attribute.Name]; ok {
v.Values = append(v.Values, attribute.Values...)
assertionInfo.Values[attribute.Name] = v
} else {
assertionInfo.Values[attribute.Name] = attribute
}
}
Currently if there are repeated same attributes (not their values) in the response, the last one just overrides the previous ones. This library supports only if there are multiple values inside one attribute. I think it would be better to make sure no data is lost with strange SAML implementations to flatten and marge them all into one output slice, pretending like they were just values inside one attribute.
Currently it is in
retrieve_assertion.go:I think something like this would be better: