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

refactor: don't fail if extra signatures we don't care about #67

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

grzuy
Copy link
Contributor

@grzuy grzuy commented Oct 10, 2023

Not seen cases of this but per their spec is possible multiple signatures coming in this field.
https://docs.npmjs.com/about-registry-signatures#supporting-signatures-on-third-party-registries
Just playing safe so that it doesn't break if something changes in the package metadata response.

Comment on lines +30 to +31
signatures
|> Enum.find(fn %{"keyid" => keyid} -> keyid == @public_key_id end) ||
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
signatures
|> Enum.find(fn %{"keyid" => keyid} -> keyid == @public_key_id end) ||
Enum.find(signatures, fn %{"keyid" => keyid} -> keyid == @public_key_id end) ||

@josevalim josevalim merged commit f88f731 into phoenixframework:main Oct 11, 2023
2 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@grzuy grzuy deleted the less-brittle branch October 11, 2023 12:23
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

Successfully merging this pull request may close these issues.

2 participants