9front - general discussion about 9front
 help / color / mirror / Atom feed
From: igor@9lab.org
To: 9front@9front.org
Cc: igor@9lab.org
Subject: [9front] rc-httpd(8): document how to use HTTP basic authentication
Date: Sun, 31 Oct 2021 02:06:04 +0200	[thread overview]
Message-ID: <B297A86EB9EBF13C8ED348CE3814B4D2@9lab.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

The attached patch to rc-httpd(8) documents how to use HTTP basic
authentication. Please let me know if you have any feedback.

<snip>
From: Igor Böhm <igor@9lab.org>
Date: Sat, 30 Oct 2021 23:59:12 +0000
Subject: [PATCH] rc-httpd(8): document how to use HTTP basic authentication

---
diff 76990597f21f5ec3972403e8afbc18dba80ddabe f525323da61d6f06592dc5cd3f09a4ab9f833d45
--- a/sys/man/8/rc-httpd	Sat Oct 30 00:59:06 2021
+++ b/sys/man/8/rc-httpd	Sun Oct 31 01:59:12 2021
@@ -80,6 +80,11 @@
 be configured via a similar method acting upon the
 .I location
 and/or other variables.
+.PP
+The
+.I REMOTE_USER
+variable provides a user identification string supplied by the
+client as part of user authentication.
 .SH EXAMPLES
 The following examples demonstrate possible ways to configure
 .BR select-handler.
@@ -95,6 +100,20 @@
 .EE
 .RE
 .PP
+HTTP basic authentication:
+.RS
+.EX
+if(~ $SERVER_NAME *restricted.org){
+	PATH_INFO=$location
+	FS_ROOT=/usr/kgb/www/$SERVER_NAME
+	authorize
+	if(~ $REMOTE_USER (glenda kgb))
+		exec static-or-index
+	error 401
+}
+.EE
+.RE
+.PP
 CGI:
 .RS
 .EX
@@ -151,6 +170,8 @@
 .B /rc/bin/rc-httpd/rc-httpd
 .TP
 .B /rc/bin/rc-httpd/select-handler
+.TP
+.B /rc/bin/rc-httpd/handlers/authorize
 .TP
 .B /rc/bin/rc-httpd/handlers/cgi
 .TP
</snap>

Cheers,
Igor

[-- Attachment #2: rc-httpd.basic.auth.patch --]
[-- Type: text/plain, Size: 1139 bytes --]

From: Igor Böhm <igor@9lab.org>
Date: Sat, 30 Oct 2021 23:59:12 +0000
Subject: [PATCH] rc-httpd(8): document how to use HTTP basic authentication

---
diff 76990597f21f5ec3972403e8afbc18dba80ddabe f525323da61d6f06592dc5cd3f09a4ab9f833d45
--- a/sys/man/8/rc-httpd	Sat Oct 30 00:59:06 2021
+++ b/sys/man/8/rc-httpd	Sun Oct 31 01:59:12 2021
@@ -80,6 +80,11 @@
 be configured via a similar method acting upon the
 .I location
 and/or other variables.
+.PP
+The
+.I REMOTE_USER
+variable provides a user identification string supplied by the
+client as part of user authentication.
 .SH EXAMPLES
 The following examples demonstrate possible ways to configure
 .BR select-handler.
@@ -95,6 +100,20 @@
 .EE
 .RE
 .PP
+HTTP basic authentication:
+.RS
+.EX
+if(~ $SERVER_NAME *restricted.org){
+	PATH_INFO=$location
+	FS_ROOT=/usr/kgb/www/$SERVER_NAME
+	authorize
+	if(~ $REMOTE_USER (glenda kgb))
+		exec static-or-index
+	error 401
+}
+.EE
+.RE
+.PP
 CGI:
 .RS
 .EX
@@ -151,6 +170,8 @@
 .B /rc/bin/rc-httpd/rc-httpd
 .TP
 .B /rc/bin/rc-httpd/select-handler
+.TP
+.B /rc/bin/rc-httpd/handlers/authorize
 .TP
 .B /rc/bin/rc-httpd/handlers/cgi
 .TP

             reply	other threads:[~2021-10-31  0:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31  0:06 igor [this message]
2021-11-01 21:10 ` qwx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B297A86EB9EBF13C8ED348CE3814B4D2@9lab.org \
    --to=igor@9lab.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).