Skip to content

Conversation

soartec-lab
Copy link
Contributor

Thanks for creating a great gem.
I created this PR because I found one problem while developing a project using this gem. Please check if you like.

Summary

If both SAMLRequest and SAMLResponse are nil in the request parameter, the argument nil is specified in Saml::Encoding#decode_64 and the exception NoMethodError is raised.

$ Saml::Encoding.decode_64(nil)
NoMethodError: undefined method `unpack1' for nil:NilClass
from /usr/local/lib/ruby/2.7.0/base64.rb:59:in `decode64'

See: https://github.com/digidentity/libsaml/blob/master/lib/saml/bindings/http_post.rb#L23

This isn't friendly to developers, so I've added an exception class Saml::Errors::InvalidParams to detect this.

@coveralls
Copy link

coveralls commented Dec 29, 2020

Coverage Status

Coverage remained the same at 99.848% when pulling 428e397 on soartec-lab:feature/add-invalid-params-error into a09fe2f on digidentity:master.

@jdongelmans jdongelmans merged commit b21ac20 into digidentity:master Jan 11, 2021
@jdongelmans
Copy link
Contributor

Thanks, version v3.9.1 has just been pushed!

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.

3 participants