http-signatures-ruby icon indicating copy to clipboard operation
http-signatures-ruby copied to clipboard

Implement External KeyStore Support

Open waynerobinson opened this issue 10 years ago • 2 comments

The keys option in Context may may be an instance of HttpSignature::KeyStore or other object that conforms to its API.

waynerobinson avatar Oct 02 '15 01:10 waynerobinson

I'm all for permitting alternate key stores, but I don't like that they need to subclass the built-in one; I'd prefer it to be an implicit interface. That makes it a bit trickier to guarantee backwards compatibility, though.

How wrapping it in the built-in Keystore only if it's a Hash, otherwise passing it through and assuming it conforms to the implicit interface?

pda avatar Oct 02 '15 04:10 pda

You don't have to subclass it. That was just for expediency in testing. Anything that supports fetch basically will work, as long as it returns Key or Key-like things.

Happy to change that around. Originally I was going to just pass in a hash-like object rather than an overloaded keystore but the built-in keystore iterates over the entire hash creating keys.

This is basically to use a DB model so we can have all our user access keys there and look them up per request.

waynerobinson avatar Oct 02 '15 04:10 waynerobinson