diff options
Diffstat (limited to 'archives/extend/attachments/20140605')
4 files changed, 178 insertions, 0 deletions
diff --git a/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html b/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html new file mode 100644 index 00000000..632ca0cc --- /dev/null +++ b/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html @@ -0,0 +1,42 @@ +<tt> +<div dir="ltr"><div>But then I would have to check the client cert for each and every request. I should have to check the cert only once at connect time and then be able to pass the result of that check in the request to each handler.<br><br> +<br></div>Anyway I've gone ahead and implemented what I need in a generic manner and it seems to work well. I think it would be a useful addition to Cowboy. If you agree I could write some more documentation for it.<br><br> +<div><br><a href="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</a><br><br></div><div>I added a "onconnect" hook and "connection metadata" to cowboy_req. The connection metadata works like existing metadata, but is preserved from request to request on the same connection. The onconnect hook provides initial values for the connection metadata.<br><br> +<br></div><div>Dan.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +<br><br> +<br><br> +<br><br> +On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client certificate<br><br> + authorization in Cowboy, although I see there is an example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> +Yes, but in cowboy there's no API to get at the socket.<br><br> +</div></blockquote><br> +<br><br> +There is the undocumented function cowboy_req:get/1 which is meant for that kind of "special" use.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/3ba15fb3/attachment.html b/archives/extend/attachments/20140605/3ba15fb3/attachment.html new file mode 100644 index 00000000..632ca0cc --- /dev/null +++ b/archives/extend/attachments/20140605/3ba15fb3/attachment.html @@ -0,0 +1,42 @@ +<tt> +<div dir="ltr"><div>But then I would have to check the client cert for each and every request. I should have to check the cert only once at connect time and then be able to pass the result of that check in the request to each handler.<br><br> +<br></div>Anyway I've gone ahead and implemented what I need in a generic manner and it seems to work well. I think it would be a useful addition to Cowboy. If you agree I could write some more documentation for it.<br><br> +<div><br><a href="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</a><br><br></div><div>I added a "onconnect" hook and "connection metadata" to cowboy_req. The connection metadata works like existing metadata, but is preserved from request to request on the same connection. The onconnect hook provides initial values for the connection metadata.<br><br> +<br></div><div>Dan.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +<br><br> +<br><br> +<br><br> +On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client certificate<br><br> + authorization in Cowboy, although I see there is an example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> +Yes, but in cowboy there's no API to get at the socket.<br><br> +</div></blockquote><br> +<br><br> +There is the undocumented function cowboy_req:get/1 which is meant for that kind of "special" use.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html b/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html new file mode 100644 index 00000000..54c2e082 --- /dev/null +++ b/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html @@ -0,0 +1,47 @@ +<tt> +<div dir="ltr">Got it, thanks.<div><br></div><div>This <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> had the fine print that I hadn't read apparently: "This module cannot be described as a behaviour due to most of the callbacks it defines being optional. It has the same semantics as a behaviour otherwise.<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">"</span></div><br> +<div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 June 2014 22:46, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You shouldn't say -behavior(cowboy_http_handler) if you don't actually implement it.<br><br> +<br><br> +On 06/04/2014 11:37 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello.<br><br> +<br><br> +You wrote here<br><br> +<<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>rest/</a>> that "The<div><div class="h5"><br><br> +only mandatory callback is init/3, needed to perform the protocol upgrade."<br><br> +<br><br> +In my code I have only this function for the protocol upgrade:<br><br> +<br><br> +init({_TransportName, _ProtocolName}, _Req, []) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br> +<br><br> +On the other hand, when compiling, I get the following warnings:<br><br> +<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +handle/2 (behaviour 'cowboy_http_handler')<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +terminate/3 (behaviour 'cowboy_http_handler')<br><br> +<br><br> +Is this the expected behavior? I know I _can_ ignore the warnings, but<br><br> +not if I want to use Erlang compiler option warnings_as_errors, for example.<br><br> +<br><br> +Many thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/46eee3c0/attachment.html b/archives/extend/attachments/20140605/46eee3c0/attachment.html new file mode 100644 index 00000000..54c2e082 --- /dev/null +++ b/archives/extend/attachments/20140605/46eee3c0/attachment.html @@ -0,0 +1,47 @@ +<tt> +<div dir="ltr">Got it, thanks.<div><br></div><div>This <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> had the fine print that I hadn't read apparently: "This module cannot be described as a behaviour due to most of the callbacks it defines being optional. It has the same semantics as a behaviour otherwise.<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">"</span></div><br> +<div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 June 2014 22:46, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You shouldn't say -behavior(cowboy_http_handler) if you don't actually implement it.<br><br> +<br><br> +On 06/04/2014 11:37 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello.<br><br> +<br><br> +You wrote here<br><br> +<<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>rest/</a>> that "The<div><div class="h5"><br><br> +only mandatory callback is init/3, needed to perform the protocol upgrade."<br><br> +<br><br> +In my code I have only this function for the protocol upgrade:<br><br> +<br><br> +init({_TransportName, _ProtocolName}, _Req, []) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br> +<br><br> +On the other hand, when compiling, I get the following warnings:<br><br> +<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +handle/2 (behaviour 'cowboy_http_handler')<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +terminate/3 (behaviour 'cowboy_http_handler')<br><br> +<br><br> +Is this the expected behavior? I know I _can_ ignore the warnings, but<br><br> +not if I want to use Erlang compiler option warnings_as_errors, for example.<br><br> +<br><br> +Many thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> |