authlete / oid4vci-demo

Demo of Authlete's implementation of the OpenID for Verifiable Credential Issuance specification.
https://www.authlete.com/
Apache License 2.0
4 stars 0 forks source link

private method `read_jwk' called for #<Options:0x00000001313a3e28> (NoMethodError) #2

Open hugoib opened 2 months ago

hugoib commented 2 months ago

I ran into errors while running the ./generate-dpop-proof script on Mac:

image

I modified the script here: https://github.com/authlete/oid4vci-demo/blob/a7ebb83c6ae3121be158590665fe3fc7b742d07c/generate-dpop-proof#L131 to: @key = send(:read_jwk, file) # Use send to call the private method

Reasoning:

Using send: The send method allows calling both public and private methods dynamically. By using send(:read_jwk, file), we explicitly call the private method read_jwk within the on method block. Private Methods: The read_jwk method remains private, maintaining encapsulation, but it is called in a controlled manner. Additional Notes

This solved the issue.

TakahikoKawasaki commented 2 months ago

@hugoib Thank you for finding the issue. It seems that the right approach to fix the issue is removing self. from self.read_jwk like this commit: https://github.com/authlete/oid4vci-demo/commit/54552d89625a79235ca2717087e752ff5cac7a41

Could you try the updated script?