summaryrefslogtreecommitdiff
path: root/files/filters/auth-deny-all.lua
blob: 1bf34ce22ef52a0bc665cd67029a04907d53ad05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- Filter which denies access to all repos
--
-- File managed by Puppet

function authenticate_post()
	return 0
end

function authenticate_cookie()
	return 0
end

function body()
	html("<h2>Access denied for everyone and everything</h2>")
	return 0
end

actions["authenticate-post"] = authenticate_post
actions["authenticate-cookie"] = authenticate_cookie
actions["body"] = body

function filter_open(...)
	action = actions[select(1, ...)]
	http = {}
	http["cookie"]  = select(2, ...)
	http["method"]  = select(3, ...)
	http["query"]   = select(4, ...)
	http["referer"] = select(5, ...)
	http["path"]    = select(6, ...)
	http["host"]    = select(7, ...)
	http["https"]   = select(8, ...)

	cgit = {}
	cgit["repo"]  = select(9, ...)
	cgit["page"]  = select(10, ...)
	cgit["url"]   = select(11, ...)
	cgit["login"] = select(12, ...)
end

-- function filter_close()
-- 	return action()
-- end
-- 
-- function filter_write(str)
-- 	post = parse_qs(str)
-- end