Comments (9)
I like the url.Form
pattern and I'm open to breaking compatibility.
@andrewstuart since I get the sense you're using this, any thoughts?
from gosaml2.
Yeah, that's a pattern used all over the place in Go (also in url.Values, http.Header, e.g.), so it makes sense to me, and wouldn't cause me any issues. I might try to throw together a quick PR for that as well tonight, to have a custom type like the net/* packages are fond of doing.
from gosaml2.
If so, can I request a way of getting (or looking up by) the FriendlyName field as well? I'm seeing behavior somewhat like the following (this is for an Internet2 Shib IdP):
<saml2:Attribute
FriendlyName="eduPersonEntitlement"
Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.7"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:string">
urn:mace:dir:entitlement:common-lib-terms
</saml2:AttributeValue>
<saml2:AttributeValue
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:string">
https://university.edu/path/to/thingy
</saml2:AttributeValue>
<saml2:AttributeValue
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:string">
urn:mace:incommon:entitlement:common:1
</saml2:AttributeValue>
</saml2:Attribute>
from gosaml2.
@fatlotus I'm all for that too, as the URNs are pretty hard to work with. I will note, however that the spec (line 1201) explicitly mentions that "This attribute's value MUST NOT be used as a basis for formally identifying SAML attributes."
So we may want to consider what such an API might look like, such UnsafeGetFriendlyName(fname)
or some such method name. Or maybe a strong note in the docs would be enough. Thoughts?
from gosaml2.
Oof. Perhaps a bit obtuse, but maybe override .String()
to return the raw XML? That way a human can .Printf(...)
the result for hints, but would be strongly discouraged from hard-coding a FriendlyName into their code.
Or, alternately: an unexported property that shows up in "%#v"
but is otherwise inaccessible.
from gosaml2.
So I've got something pulled together here, but this method (since it uses type aliasing rather than a struct) would be unable to store any additional metadata like FriendlyName.
Another alternative, perhaps more flexible, is to just create an Attribute struct, and use map[string][]Attribute for AssertionInfo.Values:
type Attribute struct {
Values []string
Name string
FriendlyName string
}
This has the benefit of being multi-valued, including FriendlyName, yet still being indexed by Name, hopefully somewhat discouraging reliance upon FriendlyName as the key.
from gosaml2.
I like that. I'd combine it with the type alias like you've already got for easy access by Name.
from gosaml2.
Okay, I put something together, and I really think we arrived at a nice, clean API. Let me know what you think. :-)
from gosaml2.
Closed by #10.
from gosaml2.
Related Issues (20)
- assertionInfo.WarningInfo.InvalidTime using time finer than milliseconds
- Security policy link not working HOT 1
- Support Uncompressed SAML
- How to ignore the received public encryption certificate
- Possible Vulnerability: Auth Request sends the service providers validation certificate HOT 2
- panic on crypto/cipher: input not full blocks
- IdentityProviderSSOBinding and buildAuthnRequest HOT 1
- SPKeyStore HOT 2
- Does not work with samltest.id HOT 1
- Reparse the signed XML
- How do i generate SP MetaData File Using gosaml2 HOT 1
- Push a new tag and release HOT 2
- Add proper documentation on different functions available HOT 2
- samlp:NameIDPolicy Format attribute is written even if unspecified, causing Azure AD problems HOT 2
- HTTP-Redirect: Missing Signature and SigAlg parameters in SAMLRequest Url (AuthNRequest) HOT 1
- Sso saml for okta using this package
- Decrypt assertion returns wrong error value HOT 1
- validate does not check SessionNotOnOrAfter for expiration
- Missing exported function BuildAuthURLWithRedirect HOT 1
- [CVE-2020-7731] CWE-476: NULL Pointer Dereference? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gosaml2.