trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: TS-4976: Regularize plugins - secure_link
Date Wed, 10 May 2017 12:07:09 GMT
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  a6bbc3f   TS-4976: Regularize plugins - secure_link
a6bbc3f is described below

commit a6bbc3fde23969386a1a3bd40bb24282dfe530b4
Author: Alan M. Carroll <amc@apache.org>
AuthorDate: Sat May 6 14:25:24 2017 -0500

    TS-4976: Regularize plugins - secure_link
---
 example/Makefile.am                                          |  4 ++--
 example/{secure-link => secure_link}/readme.txt              |  4 ++--
 .../{secure-link/secure-link.c => secure_link/secure_link.c} | 12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index 4083a1b..2aef396 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -46,7 +46,7 @@ example_Plugins = \
 	remap_header_add.la \
 	replace_header.la \
 	response_header_1.la \
-	secure-link.la \
+	secure_link.la \
 	server-push.la \
 	server-transform.la \
 	ssl-preaccept.la \
@@ -111,7 +111,7 @@ remap_header_add_la_SOURCES = remap_header_add/remap_header_add.cc
 remap_la_SOURCES = remap/remap.cc
 replace_header_la_SOURCES = replace_header/replace_header.c
 response_header_1_la_SOURCES = response_header_1/response_header_1.c
-secure_link_la_SOURCES = secure-link/secure-link.c
+secure_link_la_SOURCES = secure_link/secure_link.c
 server_push_la_SOURCES = server-push/server-push.c
 server_transform_la_SOURCES = server-transform/server-transform.c
 ssl_preaccept_la_SOURCES = ssl-preaccept/ssl-preaccept.cc
diff --git a/example/secure-link/readme.txt b/example/secure_link/readme.txt
similarity index 88%
rename from example/secure-link/readme.txt
rename to example/secure_link/readme.txt
index e79dab0..a0c1ecb 100644
--- a/example/secure-link/readme.txt
+++ b/example/secure_link/readme.txt
@@ -1,4 +1,4 @@
-The secure-link plugin allows Traffic Server to protect resources by verifying
+The secure_link plugin allows Traffic Server to protect resources by verifying
 checksum value passed in the request and computed for the request.
 Checksum is the md5 digest of concatenation of several params:
   [secret] + [Client IP Address] + [HTTP Query Path] + [expire]
@@ -13,7 +13,7 @@ For example request
   http://foo.example.com/d41d8cd98f00b204e9800998ecf8427e/52b9ed11/path/to/secret/document.pdf
 may be remapped to
   http://bar.example.com/path/to/secret/document.pdf?st=d41d8cd98f00b204e9800998ecf8427e&ex=52b9ed11
-and then passed to secure-link plugin, which compare 'st' and 'ex' GET params
+and then passed to secure_link plugin, which compare 'st' and 'ex' GET params
 with computed md5 checksum and current time respectively.
 If check passed the plugin removes 'st' and 'ex' GET params and passes down
 the processing chain;
diff --git a/example/secure-link/secure-link.c b/example/secure_link/secure_link.c
similarity index 92%
rename from example/secure-link/secure-link.c
rename to example/secure_link/secure_link.c
index b38d9d6..3fe417d 100644
--- a/example/secure-link/secure-link.c
+++ b/example/secure_link/secure_link.c
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  This plugin enables validation of link by performing checksum computations.
 
   @section license License
 
@@ -72,21 +72,21 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
             expireptr = val;
           }
         } else {
-          TSError("[secure_link] Invalid parameter [%s]", ptr);
+          TSError("[%s] Invalid parameter [%s]", PLUGIN_NAME, ptr);
           break;
         }
       } while ((ptr = strtok_r(NULL, "&", &saveptr)) != NULL);
       token  = (NULL == tokenptr ? NULL : TSstrdup(tokenptr));
       expire = (NULL == expireptr ? NULL : TSstrdup(expireptr));
     } else {
-      TSError("[secure_link] strtok didn't find a & in the query string");
+      TSError("[%s] strtok didn't find a & in the query string", PLUGIN_NAME);
       /* this is just example, so set fake params to prevent plugin crash */
       token  = TSstrdup("d41d8cd98f00b204e9800998ecf8427e");
       expire = TSstrdup("00000000");
     }
     TSfree(s);
   } else {
-    TSError("[secure_link] TSUrlHttpQueryGet returns empty value");
+    TSError("[%s] TSUrlHttpQueryGet returns empty value", PLUGIN_NAME);
   }
 
   ph = TSUrlPathGet(rri->requestBufp, rri->requestUrl, &len);
@@ -98,7 +98,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
     path = TSstrdup(s);
     TSfree(s);
   } else {
-    TSError("[secure_link] TSUrlPathGet returns empty value");
+    TSError("[%s] TSUrlPathGet returns empty value", PLUGIN_NAME);
     /* this is just example, so set fake params to prevent plugin crash */
     path = TSstrdup("example/");
   }
@@ -176,7 +176,7 @@ TSRemapNewInstance(int argc, char **argv, void **ih, char *errbuf, int
errbuf_si
         TSDebug(PLUGIN_NAME, "Unknown parameter [%s]", argv[i]);
       }
     } else {
-      TSError("[secure_link] Invalid parameter [%s]", argv[i]);
+      TSError("[%s] Invalid parameter [%s]", PLUGIN_NAME, argv[i]);
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message