From f7cfac3eb955307701556c4603e50a922c0c873a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 1 Nov 2026 22:24:48 -1000 Subject: Say the auth filters match a repository's url A list keyed on the name the index shows matched nothing, so the repository it meant to protect stayed public. --- custom/extensions/auth-inline.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'custom/extensions/auth-inline.lua') diff --git a/custom/extensions/auth-inline.lua b/custom/extensions/auth-inline.lua index 014caa9..971d662 100644 --- a/custom/extensions/auth-inline.lua +++ b/custom/extensions/auth-inline.lua @@ -62,9 +62,13 @@ -- Protected repositories and the users allowed into each. A repository named --- here is protected and one that is not named is public. The repository key --- has to match exactly, while user names match regardless of case. The --- examples are commented out, so an unedited copy protects nothing. +-- here is protected and one that is not named is public. The key is the +-- repository's url, not the name the index shows, which repo.name or +-- section-from-path can make differ. With section-from-path=1, a repository +-- that scan-path finds at team/tools.git shows as tools.git but keeps +-- team/tools.git as its url. The url has to match exactly, while user names +-- match regardless of case. The examples are commented out, so an unedited +-- copy protects nothing. local protected_repos = { -- ["secret-repo"] = { alice = true, bob = true }, -- ["another"] = { alice = true }, @@ -134,7 +138,7 @@ local action, http, cgit, post -- The configured tables are folded to lowercased user names once, so that a -- lookup matches whatever case the login form was filled in with, the way --- auth-file.lua does. Repository names keep their case. +-- auth-file.lua does. Repository urls keep their case. do local folded_users = {} for name, hash in pairs(users) do -- cgit 2.12.1