Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return object for XML-valued AttributeValues #447

Merged
merged 2 commits into from
Sep 3, 2020

Conversation

mans0954
Copy link
Contributor

Closes: #245

saml-core-2.0-os Section 2.7.3.1.1 says

The <AttributeValue> element supplies the value of a specified SAML attribute. It is of the
xs:anyType type, which allows any well-formed XML to appear as the content of the element.

This PR modifies the attrValueMapper function to return an object representing the parsed XML unless the attribute is a simple string, in which case the string is returned.

A test is included which also serves as an example of how this functionality can be used in the specific case of the deprecated eduPersonTargetedID attribute.

@mans0954 mans0954 changed the title Csh return xml attr value Return object for XML-valued AttributeValues Aug 26, 2020
@cjbarth
Copy link
Collaborator

cjbarth commented Sep 2, 2020

I haven't traced all the code paths on this one, but it looks reasonable to me. Thank you for the test.

@markstos
Copy link
Contributor

markstos commented Sep 3, 2020

Thanks for referencing the spec, too. I hope to catch up on passport-saml mail soon.

@cjbarth feel free to merge PRs that look good.

@markstos markstos merged commit aed4a3d into node-saml:master Sep 3, 2020
@mans0954 mans0954 deleted the csh-return-XML-attr-value branch September 3, 2020 14:28
walokra pushed a commit to walokra/suomifi-passport-saml that referenced this pull request Oct 1, 2020
* upstream:
  docs: remove badges broken by project rename.
  bump version to 1.3.5
  deps: really bump xml-encryption for node-forge sub-dep upgrade to address vuln.
  docs: Update package.json / README to reflect site move.
  deps: bump xml-encryption to address node-forge sub-dep vuln.
  Update issue templates
  Update issue templates
  Bump lodash from 4.17.15 to 4.17.20 (node-saml#449)
  Bump acorn from 7.1.0 to 7.4.0 (node-saml#448)
  Return object for XML-valued AttributeValues (node-saml#447)
  Revert "doc: announce site move." (node-saml#446)
  doc: announce site move.
  add yarn-error.log to .gitignore
  bump version.
  Fix multi saml strategy race conditions (node-saml#426)
  v1.3.3
  v1.3.2

# Conflicts:
#	.gitignore
#	README.md
#	package.json
walokra added a commit to walokra/suomifi-passport-saml that referenced this pull request Oct 2, 2020
* upstream:
  docs: remove badges broken by project rename.
  bump version to 1.3.5
  deps: really bump xml-encryption for node-forge sub-dep upgrade to address vuln.
  docs: Update package.json / README to reflect site move.
  deps: bump xml-encryption to address node-forge sub-dep vuln.
  Update issue templates
  Update issue templates
  Bump lodash from 4.17.15 to 4.17.20 (node-saml#449)
  Bump acorn from 7.1.0 to 7.4.0 (node-saml#448)
  Return object for XML-valued AttributeValues (node-saml#447)
  Revert "doc: announce site move." (node-saml#446)
  doc: announce site move.
  add yarn-error.log to .gitignore
  bump version.
  Fix multi saml strategy race conditions (node-saml#426)
  v1.3.3
  v1.3.2

# Conflicts:
#	.gitignore
#	README.md
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

attrValueMapper fails to parse complex AttributeValue tags
3 participants