Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

JWS detached (de)serialization #234

Merged
merged 3 commits into from May 22, 2019
Merged

JWS detached (de)serialization #234

merged 3 commits into from May 22, 2019

Conversation

philtay
Copy link
Contributor

@philtay philtay commented May 22, 2019

/cc @csstaub

jws.go Outdated
}

// ParseDetached parses a signed message in compact serialization format with detached payload.
func ParseDetached(input string, payload []byte) (*JSONWebSignature, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of input, call it signature?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also would prefer if we error out if payload == nil. Otherwise it's possible to use this function with a non-detached input and nil payload I think, which seems counter-intuitive.

@csstaub
Copy link
Collaborator

csstaub commented May 22, 2019

Looks good to me. Just left a comment on ParseDetached

@philtay
Copy link
Contributor Author

philtay commented May 22, 2019

@csstaub changed as requested and also renamed the ParseSigned argument accordingly

@csstaub csstaub merged commit eaf26de into square:v2 May 22, 2019
@philtay
Copy link
Contributor Author

philtay commented May 22, 2019

@csstaub thanks. If you merge 'v2' into 'master', I'll open a new PR against 'master' to support Go modules and to release v3.0.0.

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

Successfully merging this pull request may close these issues.

None yet

2 participants