<?xml version="1.0" encoding="UTF-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><id>https://blog.pgxn.org/tags/request/</id><title>Request</title><updated>2010-10-11T15:00:29Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/request/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/request/"/><author><name>The PGXN Maintainers</name></author><generator uri="https://gohugo.io/" version="0.167.0">Hugo</generator><entry><id>https://blog.pgxn.org/post/1291485816</id><title type="html">How Can I Detect a Proxied SSL Request?</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2010/how-can-i-detect-a-proxied-ssl-request/"/><updated>2026-10-07T16:13:48Z</updated><published>2010-10-11T15:00:29Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="mod_proxy" label="mod_proxy"/><category scheme="https://blog.pgxn.org/tags" term="mod_ssl" label="mod_ssl"/><category scheme="https://blog.pgxn.org/tags" term="ssl" label="SSL"/><category scheme="https://blog.pgxn.org/tags" term="proxy" label="Proxy"/><category scheme="https://blog.pgxn.org/tags" term="uri" label="URI"/><category scheme="https://blog.pgxn.org/tags" term="apache" label="Apache"/><category scheme="https://blog.pgxn.org/tags" term="plack" label="Plack"/><category scheme="https://blog.pgxn.org/tags" term="request" label="Request"/><summary type="html"><![CDATA[I&rsquo;ve been thinking about how best to create two sections of the PGXN Manager
site, one that requires authentication and is on SSL and one that&rsquo;s public. So
far, I&rsquo;ve just had all the authenticated stuff go to /auth (because I&rsquo;m using
basic auth), but what I want to do now is require authentication if the
connection is via SSL. However, using a reverse proxy with mod_proxy to map to
the PGXN Manger Plack app running on an internal port, I&rsquo;ve found no
environment variables passed through that would allow me, in code, to
determine whether a request is via a proxied SSL or non-SSL connection. Most
irritating.]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>I&rsquo;ve been thinking about how best to create two sections of the PGXN Manager
site, one that requires authentication and is on SSL and one that&rsquo;s public. So
far, I&rsquo;ve just had all the authenticated stuff go to /auth (because I&rsquo;m using
basic auth), but what I want to do now is require authentication if the
connection is via SSL. However, using a reverse proxy with mod_proxy to map to
the PGXN Manger Plack app running on an internal port, I&rsquo;ve found no
environment variables passed through that would allow me, in code, to
determine whether a request is via a proxied SSL or non-SSL connection. Most
irritating.</p>
<p>So tell me what you think about the alternative plan I&rsquo;ve come up with.</p>
<p>I&rsquo;ll have two plack apps, one mapped to /auth and one mapped to /no-auth. The
former will require authentication and the latter will not. They&rsquo;ll have
separate dispatch tables, of course. Then I&rsquo;ll have the SSL site proxied to
/auth and the non-SSL site proxied to /no-auth. Makes sense, right?</p>
<p>The only hangup I can see (though maybe you can see others?) is that my
current method of generating URIs knows nothing about proxies. So If I link to
/auth/account, when requests come through the proxy, it should actually create
a link to /account. Does it make sense to use relative links instead of
absolute links for all links to avoid this issue? I think it might be kind of
annoying, because not all the code is aware of the current URI, though there
are ways to deal with that.</p>
<p>Thoughts?</p>
<p>I guess I could stick with absolute URLs, and then have the <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Request.pm#L14"><code>uri_for</code></a> use
<code>$req−&gt;uri−&gt;path</code> for a proxied request and <code>$req−&gt;path_info</code> for a
non-proxied request.</p>
<p>Sure would be nice if there was some way to tell from the environment that a
request was forwarded from an SSL connection, though. Alas, there are only
three extra environment variable set by the proxy server:</p>
<ul>
<li>HTTP_X_FORWARDED_FOR</li>
<li>HTTP_X_FORWARDED_HOST</li>
<li>HTTP_X_FORWARDED_SERVER</li>
</ul>
<p>No HTTP_X_FORWARDED_PORT or HTTP_X_FORWARDED_SSL or SSL_ENABLED or anything
like that. Maybe I&rsquo;m missing something in my reading of the <a href="https://httpd.apache.org/docs/2.2/mod/mod_proxy.html">mod_proxy
documentation</a>?</p>
]]></content></entry><entry><id>https://blog.pgxn.org/post/1205386689</id><title type="html">Account Requests and Moderation</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2010/account-moderation/"/><updated>2026-10-07T16:13:48Z</updated><published>2010-09-28T18:47:37Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="account" label="Account"/><category scheme="https://blog.pgxn.org/tags" term="request" label="Request"/><category scheme="https://blog.pgxn.org/tags" term="moderation" label="Moderation"/><category scheme="https://blog.pgxn.org/tags" term="accept" label="Accept"/><category scheme="https://blog.pgxn.org/tags" term="reject" label="Reject"/><category scheme="https://blog.pgxn.org/tags" term="user" label="User"/><category scheme="https://blog.pgxn.org/tags" term="administrator" label="Administrator"/><category scheme="https://blog.pgxn.org/tags" term="jquery" label="jQuery"/><category scheme="https://blog.pgxn.org/tags" term="validation" label="Validation"/><category scheme="https://blog.pgxn.org/tags" term="ue" label="UE"/><category scheme="https://blog.pgxn.org/tags" term="ui" label="UI"/><category scheme="https://blog.pgxn.org/tags" term="degrade" label="Degrade"/><summary type="html"><![CDATA[<p>Last week I created the <a href="https://github.com/theory/pgxn-manager" title="PGXN Manager repository on GitHub">PGXN Manager</a> interface for requesting a PGXN user
account. It looks like this:</p>
<p><img src="/2010/account-moderation/request-account.png" alt="Request PGXN Account"></p>
<p>I really like the placeholder support in HTML 5, here nicely rendered by
Safari. I&rsquo;ve also used the jQuery <a href="https://docs.jquery.com/Plugins/Validation">Validation plugin</a> to validate the form
fields. So if you try to submit an incomplete form, it will complain before
submitting, like so:</p>
<p><img src="/2010/account-moderation/incomplete-form.png" alt="Incomplete PGXN Request Form"></p>
<p>The back end does similar validation if you have JavaScript disabled, so it
should degrade nicely. I think I might add a Twitter field so <a href="https://twitter.com/pgxn">@pgxn</a> can
credit users for their uploads, but otherwise this is done.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Last week I created the <a href="https://github.com/theory/pgxn-manager" title="PGXN Manager repository on GitHub">PGXN Manager</a> interface for requesting a PGXN user
account. It looks like this:</p>
<p><img src="/2010/account-moderation/request-account.png" alt="Request PGXN Account"></p>
<p>I really like the placeholder support in HTML 5, here nicely rendered by
Safari. I&rsquo;ve also used the jQuery <a href="https://docs.jquery.com/Plugins/Validation">Validation plugin</a> to validate the form
fields. So if you try to submit an incomplete form, it will complain before
submitting, like so:</p>
<p><img src="/2010/account-moderation/incomplete-form.png" alt="Incomplete PGXN Request Form"></p>
<p>The back end does similar validation if you have JavaScript disabled, so it
should degrade nicely. I think I might add a Twitter field so <a href="https://twitter.com/pgxn">@pgxn</a> can
credit users for their uploads, but otherwise this is done.</p>
<p>As with <a href="https://pause.perl.org/" title="The [Perl programming] Authors Upload Server">PAUSE</a>, an administrator must accept it or reject an account request.
Once your account is approved (likely unless you&rsquo;re a spammer), you&rsquo;ll be able
to upload distributions (I&rsquo;m going to do that part today). I finished the user
admin interface yesterday. Here&rsquo;s a screen snap:</p>
<p><img src="/2010/account-moderation/moderate-requests.png" alt="PGXN User Administration"></p>
<p>Some details. PGXN Manager will be hosted at <a href="https://manager.pgxn.org/"><code>https://manager.pgxn.org/</code></a>. It
uses basic auth for authentication; logged-in users will access
<a href="https://manager.pgxn.org/auth"><code>https://manager.pgxn.org/auth</code></a>. Administrators will have an extra menu item
to this screen, which will allow them to accept or reject account requests.
Its URI is <code>/auth/admin/moderate</code>. The admin can click the &ldquo;Play&rdquo; button to
see the requestor&rsquo;s note explaining why he should get an account. It&rsquo;s a
popover enabled by some jQuery code and looks like this:</p>
<p><img src="/2010/account-moderation/why-popover.png" alt="PGXN User Admin Why Popover"></p>
<p>Once an admin has read the request, she can accept it by clicking the blue
checkmark icon, or reject it by clicking the red minus icon. The former links
to <code>/auth/admin/accept/{nickname}</code> and the latter to
<code>/auth/admin/reject/{nickname}</code>. The submits are done by jQuery async requests
by default, but if you have JavaScript disabled they will submit as usual and
the back end will process the request and simply redirect to the moderation
screen.</p>
<p>This works very well, I think. It&rsquo;s an attractive interface and degrades
reasonably well. (Well, you can&rsquo;t read the request details if you have
JavaScript disabled, but the requests work nicely). The jQuery code fades out
a row after it has been accepted or rejected, so it&rsquo;s easy for an admin to do
a bunch of moderation all at once. And finally, the interface is driven by the
URLs, so I think it&rsquo;s pretty restful. The only ones I&rsquo;m not sure about are the
accept/reject URLs, because they have action names in them (&ldquo;accept&rdquo; and
&ldquo;reject&rdquo;). Is that RESTful? Or should they use GET query strings or something?</p>
<p>Okay, on to the upload interface. Wish me luck!</p>
]]></content></entry></feed>