Subject: [PATCH] Set environment variables for auth filter.
Date: Tue, 13 Nov 2018 13:41:13 +0100 [thread overview]
Message-ID: <20181113124100.GB7375@STATENS_laptop> (raw)
Hello again!
A while back I wrote to this list with a problem regarding
environment variables in the authentication filter.
Slightly after I proposed a patch. I'm still interested in
getting this merged.
This patch exposes the CGIT_REPO_* environment variables to
the authentication filters. Which I need for using the
CGIT_REPO_OWNER to give login access.
I also attached a patch for the documentation, which I
believe should better reflect reality.
--
hugo
-------------- next part --------------
From 2cdefdc06acd658e99c559a9ddaf3f2d3e30b213 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo at hornquist.se>
Date: Sun, 21 Oct 2018 17:09:33 +0200
Subject: [PATCH 1/2] Set environment flags before auth filters.
---
cgit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cgit.c b/cgit.c
index 6301b87..7a4978e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -1081,6 +1081,9 @@ int cmd_main(int argc, const char **argv)
cgit_parse_url(ctx.qry.url);
}
+ if (ctx.repo)
+ cgit_prepare_repo_env(ctx.repo);
+
/* Before we go any further, we set ctx.env.authenticated by checking to see
* if the supplied cookie is valid. All cookies are valid if there is no
* auth_filter. If there is an auth_filter, the filter decides. */
--
2.19.1
-------------- next part --------------
From 6ed1cbc23ae25d1921cd3b20f476729ec620bee2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo at lysator.liu.se>
Date: Tue, 13 Nov 2018 13:35:50 +0100
Subject: [PATCH 2/2] Update documentation about environment variables.
---
cgitrc.5.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 34b351b..8b23a22 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -717,7 +717,8 @@ source filter::
filtered contents is expected on standard output.
-All filters are handed the following environment variables:
+All filters (except for auth-filter, when action is "authenticate-post")
+are handed the following environment variables:
- CGIT_REPO_URL (from repo.url)
- CGIT_REPO_NAME (from repo.name)
--
2.19.1
reply other threads:[~2018-11-13 12:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181113124100.GB7375@STATENS_laptop \
--to=cgit@lists.zx2c4.com \
/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).