johnbrett / hapi-auth-bearer-token

Simple Bearer authentication scheme plugin for hapi, accepts token by Header, Cookie or Query parameter.
MIT License
218 stars 46 forks source link

Use joi schema to validate the authentication options. #99

Closed johnbrett closed 8 years ago

johnbrett commented 8 years ago

github.com/hapijs/joi makes schemas much more readable, easier to test and reduce the likelihood of unintended bugs.

When this module was first written, it had one or two options, meaning it didn't really need a joi schema. This has since grown and it would now be worth adding a joi schema and validate this when registering an auth method.

Note: This doesn't add any performance hit per request, only on auth scheme registration, as the auth schema will only be validated when schema is registered.

This issue for new contributors, myself and @AdriVanHoudt are available to help work through this PR

AdriVanHoudt commented 8 years ago

I can also help new contributors!

jonathansamines commented 8 years ago

Hey @johnbrett I´d like to help working with this one! I´ll PR later with this change

johnbrett commented 8 years ago

Closed via https://github.com/johnbrett/hapi-auth-bearer-token/issues/101