summaryrefslogtreecommitdiffstats
path: root/archives/extend/2014-June/000400.html
diff options
context:
space:
mode:
Diffstat (limited to 'archives/extend/2014-June/000400.html')
-rw-r--r--archives/extend/2014-June/000400.html189
1 files changed, 189 insertions, 0 deletions
diff --git a/archives/extend/2014-June/000400.html b/archives/extend/2014-June/000400.html
new file mode 100644
index 00000000..22d8dde0
--- /dev/null
+++ b/archives/extend/2014-June/000400.html
@@ -0,0 +1,189 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [99s-extend] cowboy client cert auth, basic auth
+ </TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20cowboy%20client%20cert%20auth%2C%20basic%20auth&In-Reply-To=%3C5391CBB4.7060606%40ninenines.eu%3E">
+ <META NAME="robots" CONTENT="index,nofollow">
+ <style type="text/css">
+ pre {
+ white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
+ }
+ </style>
+ <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
+ <LINK REL="Previous" HREF="000399.html">
+ <LINK REL="Next" HREF="000391.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[99s-extend] cowboy client cert auth, basic auth</H1>
+ <B>Lo&#239;c Hoguin</B>
+ <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20cowboy%20client%20cert%20auth%2C%20basic%20auth&In-Reply-To=%3C5391CBB4.7060606%40ninenines.eu%3E"
+ TITLE="[99s-extend] cowboy client cert auth, basic auth">essen at ninenines.eu
+ </A><BR>
+ <I>Fri Jun 6 16:09:56 CEST 2014</I>
+ <P><UL>
+ <LI>Previous message: <A HREF="000399.html">[99s-extend] cowboy client cert auth, basic auth
+</A></li>
+ <LI>Next message: <A HREF="000391.html">[99s-extend] Mandatory init/3 and optional handle/2 and terminate/3
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#400">[ date ]</a>
+ <a href="thread.html#400">[ thread ]</a>
+ <a href="subject.html#400">[ subject ]</a>
+ <a href="author.html#400">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>On 06/06/2014 03:59 PM, Daniel Goertzen wrote:
+&gt;<i> Okay, I see how I can wrap cowboy_protocol:init() to perhaps add cert
+</I>&gt;<i> information to env or stuff it in an ets table / gproc / process
+</I>&gt;<i> dictionary. Is this what you mean? I think that will work for me.
+</I>
+Something like that, yes. Process dictionary is probably the quick and
+dirty way, env would be cleaner but take more code as you then have to
+move it from env to handler opts.
+
+&gt;<i> My immediate application is to provide a secure RESTful API for a
+</I>&gt;<i> network appliance. Think securing the Web of Things. I really do want
+</I>&gt;<i> to get in the client's face if they don't have the right certificate.
+</I>&gt;<i>
+</I>&gt;<i> I'm late in saying this, but thank you for making Cowboy so easy to read
+</I>&gt;<i> and understand.
+</I>&gt;<i>
+</I>&gt;<i> Cheers,
+</I>&gt;<i> Dan.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> On Thu, Jun 5, 2014 at 4:24 PM, Lo&#239;c Hoguin &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;&gt; wrote:
+</I>&gt;<i>
+</I>&gt;<i> Misunderstood what you needed then.
+</I>&gt;<i>
+</I>&gt;<i> Note that the services that are completely blocked from anyone who
+</I>&gt;<i> doesn't have the right cert are virtually non-existent, it doesn't
+</I>&gt;<i> make sense to add a feature for it.
+</I>&gt;<i>
+</I>&gt;<i> You can do that kind of thing by having custom code creating the
+</I>&gt;<i> protocol process by the way. There's no need to patch Cowboy for that.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> On 06/05/2014 11:01 PM, Daniel Goertzen wrote:
+</I>&gt;<i>
+</I>&gt;<i> But then I would have to check the client cert for each and every
+</I>&gt;<i> request. I should have to check the cert only once at connect
+</I>&gt;<i> time and
+</I>&gt;<i> then be able to pass the result of that check in the request to each
+</I>&gt;<i> handler.
+</I>&gt;<i>
+</I>&gt;<i> Anyway I've gone ahead and implemented what I need in a generic
+</I>&gt;<i> manner
+</I>&gt;<i> and it seems to work well. I think it would be a useful addition to
+</I>&gt;<i> Cowboy. If you agree I could write some more documentation for it.
+</I>&gt;<i>
+</I>&gt;<i> <A HREF="https://github.com/__goertzenator/cowboy/tree/__onconnect">https://github.com/__goertzenator/cowboy/tree/__onconnect</A>
+</I>&gt;<i> &lt;<A HREF="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</A>&gt;
+</I>&gt;<i>
+</I>&gt;<i> I added a &quot;onconnect&quot; hook and &quot;connection metadata&quot; to
+</I>&gt;<i> cowboy_req. The
+</I>&gt;<i> connection metadata works like existing metadata, but is
+</I>&gt;<i> preserved from
+</I>&gt;<i> request to request on the same connection. The onconnect hook
+</I>&gt;<i> provides
+</I>&gt;<i> initial values for the connection metadata.
+</I>&gt;<i>
+</I>&gt;<i> Dan.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> On Thu, Jun 5, 2014 at 3:04 AM, Lo&#239;c Hoguin &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;&gt;&gt; wrote:
+</I>&gt;<i>
+</I>&gt;<i> On 06/05/2014 01:44 AM, Daniel Goertzen wrote:
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> On Wed, Jun 4, 2014 at 4:48 PM, Lo&#239;c Hoguin
+</I>&gt;<i> &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;&gt;
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;
+</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;&gt;&gt;&gt; wrote:
+</I>&gt;<i>
+</I>&gt;<i> On 06/04/2014 10:08 PM, Daniel Goertzen wrote:
+</I>&gt;<i>
+</I>&gt;<i> I am having very good luck with Cowboy so far,
+</I>&gt;<i> but I
+</I>&gt;<i> have some
+</I>&gt;<i> questions:
+</I>&gt;<i>
+</I>&gt;<i> 1. There doesn't appear to be any way to do client
+</I>&gt;<i> certificate
+</I>&gt;<i> authorization in Cowboy, although I see there
+</I>&gt;<i> is an
+</I>&gt;<i> example for
+</I>&gt;<i> doing
+</I>&gt;<i> exactly that with Ranch. I think I could
+</I>&gt;<i> modify Cowboy
+</I>&gt;<i> to do what I
+</I>&gt;<i> want, but I thought I would ask if there were
+</I>&gt;<i> other options
+</I>&gt;<i> before doing
+</I>&gt;<i> that.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> Same as Ranch really, you just gotta take the
+</I>&gt;<i> socket and
+</I>&gt;<i> then call
+</I>&gt;<i> the ssl functions.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> Yes, but in cowboy there's no API to get at the socket.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> There is the undocumented function cowboy_req:get/1 which
+</I>&gt;<i> is meant
+</I>&gt;<i> for that kind of &quot;special&quot; use.
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> --
+</I>&gt;<i> Lo&#239;c Hoguin
+</I>&gt;<i> <A HREF="http://ninenines.eu">http://ninenines.eu</A>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>&gt;<i> --
+</I>&gt;<i> Lo&#239;c Hoguin
+</I>&gt;<i> <A HREF="http://ninenines.eu">http://ninenines.eu</A>
+</I>&gt;<i>
+</I>&gt;<i>
+</I>
+--
+Lo&#239;c Hoguin
+<A HREF="http://ninenines.eu">http://ninenines.eu</A>
+</PRE>
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI>Previous message: <A HREF="000399.html">[99s-extend] cowboy client cert auth, basic auth
+</A></li>
+ <LI>Next message: <A HREF="000391.html">[99s-extend] Mandatory init/3 and optional handle/2 and terminate/3
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#400">[ date ]</a>
+ <a href="thread.html#400">[ thread ]</a>
+ <a href="subject.html#400">[ subject ]</a>
+ <a href="author.html#400">[ author ]</a>
+ </LI>
+ </UL>
+
+<hr>
+<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
+mailing list</a><br>
+</body></html>