You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to test my implementation of AuthFunc in isolation, however the parameters to the function include a lightweight wrapper around http.Request where the request field is not exported nor a constructor function provided. This makes it much more complicated to test an AuthFunc as instead of being able to call it directly in test, I must wrap it in the middleware and implement another http.Handler to thread the Info back to my test function.
Can the request field be exported, or a constructor function for authn.Request be created?
I also believe this example test has a channel bug, but I'm going to stop working on the example now. The real one became significantly more complex as a result of not being able to directly test outputs to inputs.
The text was updated successfully, but these errors were encountered:
Alternatively: change AuthFunc to accepting http.Request instead of the wrapper. The only two functions on the wrapper that aren't passing directly through to http.Request are Protocol() and Procedure(), both could be top-level helper functions (either here or in another Connect library).
I would like to test my implementation of
AuthFunc
in isolation, however the parameters to the function include a lightweight wrapper aroundhttp.Request
where the request field is not exported nor a constructor function provided. This makes it much more complicated to test anAuthFunc
as instead of being able to call it directly in test, I must wrap it in the middleware and implement anotherhttp.Handler
to thread the Info back to my test function.Can the request field be exported, or a constructor function for
authn.Request
be created?I would like to be able to do something like:
Right now I have to do something similar to this, which is significantly less clear what is under test.
I also believe this example test has a channel bug, but I'm going to stop working on the example now. The real one became significantly more complex as a result of not being able to directly test outputs to inputs.
The text was updated successfully, but these errors were encountered: