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

Reference URI #12

Open
gfyrag opened this issue Mar 16, 2017 · 1 comment
Open

Reference URI #12

gfyrag opened this issue Mar 16, 2017 · 1 comment

Comments

@gfyrag
Copy link

gfyrag commented Mar 16, 2017

hello,

i'm working on building an iDP and i use this library to generate signature.
My SP for testing is a Giltab instance using the omniauth plugin.
This plugin expect a valid "Reference" tag with an "URI" attribute, even if it is not mandatory by specification. So i plan to add this attribute on this library.

What i have done :

type Signature struct {
	XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Signature"`

	CanonicalizationMethod Method `xml:"SignedInfo>CanonicalizationMethod"`
	SignatureMethod        Method `xml:"SignedInfo>SignatureMethod"`
	Reference              Reference `xml:"SignedInfo>Reference"`
	SignatureValue         string             `xml:"SignatureValue"`
	KeyName                string             `xml:"KeyInfo>KeyName,omitempty"`
	X509Certificate        *SignatureX509Data `xml:"KeyInfo>X509Data,omitempty"`
}

type Reference struct {
	XMLName             xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Reference"`
	ReferenceTransforms []Method `xml:"Transforms>Transform"`
	DigestMethod        Method   `xml:"DigestMethod"`
	DigestValue         string   `xml:"DigestValue"`
	URI                 string   `xml:",attr"`
}

Obvisouly, it works as expected with the Gitlab instance but it breaks compatibility of the client using this structure.

Any idea how to manage this?

@crewjam
Copy link
Owner

crewjam commented Mar 16, 2017

Reference probably should have been it's own struct from the beginning. It is probably better to rip the bandaid off... Can you submit a PR and we can see what breaks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants