[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-deployment] branch master updated: protect test back
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-deployment] branch master updated: protect test backend with apikey |
Date: |
Mon, 29 Jan 2018 23:55:56 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository deployment.
The following commit(s) were added to refs/heads/master by this push:
new f0c746b protect test backend with apikey
f0c746b is described below
commit f0c746b30f4e3e99b799aca830bce4a13db330b1
Author: Florian Dold <address@hidden>
AuthorDate: Mon Jan 29 23:55:49 2018 +0100
protect test backend with apikey
---
etc/nginx/sites-enabled/test.site | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/etc/nginx/sites-enabled/test.site
b/etc/nginx/sites-enabled/test.site
index c5e1949..78c95b9 100644
--- a/etc/nginx/sites-enabled/test.site
+++ b/etc/nginx/sites-enabled/test.site
@@ -206,6 +206,23 @@ server {
error_page 418 = @blue;
error_page 419 = @green;
recursive_error_pages on;
+
+ # This is very ugly, but necessary since NGINX
+ # can't do multiple conditions or nexted ifs
+
+ if ($request_filename !~ "^/public/?.*$") {
+ # restricted!
+ set $authresult "r";
+ }
+
+ if ($http_authorization = "ApiKey sandbox") {
+ # auth successful
+ set $authresult "${authresult}y";
+ }
+ if ($authresult = "r") {
+ # restricted but not authorized
+ return 401 "Unauthorized";
+ }
if ($http_x_taler_deployment_color ~ "blue") { return 418; }
if ($http_x_taler_deployment_color ~ "green") { return 419; }
proxy_set_header X-Forwarded-Host "backend.test.taler.net";
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-deployment] branch master updated: protect test backend with apikey,
gnunet <=