-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Warden::WebAuthn::RackHelpers
; prepend to StrategyHelpers
#5
Add Warden::WebAuthn::RackHelpers
; prepend to StrategyHelpers
#5
Conversation
* In order to provide a clean, isolated module for other libraries to use the centralized default `relying_party_key`, we need to: * Break out the relying_party_key into a new `Warden::WebAuthn::RackHelpers` module * Auto-include that module as part of `Warden::WebAuthn::StrategyHelpers` to achieve the same goal of a centrally located default key
* In order to streamline standard setups, we can provide the `set_relying_party_in_request_env` helper method; which can be included via `Warden::WebAuthn::RackHelpers` and used as needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for prepending?
edit: ohh, because we want relying_party
, makes sense
edit2: why do we need the old relying_party
in the strategy?
Prepending is so that the rack helper ends up in the final destination when the strategy is included, see: https://stackoverflow.com/a/15384720 We still need the old |
edit: I got confused and thought the |
on the other hand, I might be sleepy or smth, but I don't get it:
module A; end
module B; include A; end
class C; include B; end
C.ancestors # => [C, B, A, ...]
module A1; end
module B1; prepend A1; end
class C1; include B1; end
C1.ancestors # => [C1, A1, B1, ...] so the method will always end up in there. So what am I missing? |
I apologize, you're correct here: I got in the habit of using Since the code works, and I can't think of a reason why module A
def check
"A"
end
end
module B
include A
def print_check
puts check
end
end
class C
include B
def check
"C"
end
end
class D < C
def check
"D"
end
end
C.new.print_check
#=> "C"
D.new.print_check
module A1
def check
"A1"
end
end
module B1
prepend A1
def print_check
puts check
end
end
class C1
include B1
def check
"C1"
end
end
class D1 < C
def check
"D1"
end
end
C1.new.print_check
#=> "C1"
D1.new.print_check |
Ok, makes sense 😄 . What about:
|
I actually don't think that a module A
def check
"A"
end
end
module B
include A
def check
"bad value"
end
def print_check
puts check
end
end
class C
include B
def check
"C"
end
end
class D < C
def check
"D"
end
end
C.new.print_check
#=> "C"
D.new.print_check
module A1
def check
"A1"
end
end
module B1
prepend A1
def check
"bad value1"
end
def print_check
puts check
end
end
class C1
include B1
def check
"C1"
end
end
class D1 < C
def check
"D1"
end
end
C1.new.print_check
#=> "C1"
D1.new.print_check
#=> "D1" |
my point exactly. So why do we need it there at all, if it's not gonna be called at any point? edit: here is my proposal. I'm pretty sure this is not going to change anything at any point |
relying_party_key
, we need to:Warden::WebAuthn::RackHelpers
moduleWarden::WebAuthn::StrategyHelpers
to achieve the same goal of a centrally located default key(@Vagab I can't officially tag you as a reviewer on this, but would definitely appreciate your feedback since we've been working on this)
This closes #4