From b71d3944d9094311959cde5b46d21ba6466c2b4f Mon Sep 17 00:00:00 2001 From: Hans Zandbelt Date: Tue, 3 Apr 2018 14:17:10 +0200 Subject: [PATCH] release 0.1.1 - some more local declarations - add @altexy to AUTHORS - extend copyright year to 2018 Signed-off-by: Hans Zandbelt --- AUTHORS | 5 +++++ ChangeLog | 6 +++++- DISCLAIMER | 2 +- lib/resty/xacml_pep.lua | 14 ++++++-------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index 78537a8..b8fcada 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,8 @@ The primary author of lua-resty-xacml-pep is: Hans Zandbelt + +Thanks to the following people for contributing to lua-resty-xacml-pep by +reporting bugs, providing fixes, suggesting useful features or other: + + Alexander Altshuler diff --git a/ChangeLog b/ChangeLog index d889371..e07488b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ -8/02/2017 +04/03/2018 +- fix local usage; thanks @altexy +- release 0.1.1 + +08/02/2017 - initial import - release 0.1.0 diff --git a/DISCLAIMER b/DISCLAIMER index 9de377c..4fbae80 100644 --- a/DISCLAIMER +++ b/DISCLAIMER @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2017 ZmartZone IAM + * Copyright (C) 2017-2018 ZmartZone IAM * All rights reserved. * * ZmartZone IAM diff --git a/lib/resty/xacml_pep.lua b/lib/resty/xacml_pep.lua index f7b5583..99651f5 100644 --- a/lib/resty/xacml_pep.lua +++ b/lib/resty/xacml_pep.lua @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. *************************************************************************** -Copyright (C) 2017 ZmartZone IAM +Copyright (C) 2017-2018 ZmartZone IAM All rights reserved. For further information please contact: @@ -54,7 +54,7 @@ local type = type local ngx = ngx local xacml_pep = { - _VERSION = "0.1.0" + _VERSION = "0.1.1" } xacml_pep.__index = xacml_pep @@ -70,8 +70,7 @@ end -- retrieve value from server-wide cache if available local function xacml_pep_cache_get(type, key) local dict = ngx.shared[type] - local value - local flags + local value, flags if dict then value, flags = dict:get(key) if value then ngx.log(ngx.DEBUG, "cache hit: type=", type) end @@ -82,8 +81,7 @@ end -- parse the JSON result from a call to the OP local function xacml_pep_parse_json_response(response) - local err - local res + local res, err -- check the response from the OP if response.status ~= 200 then @@ -133,7 +131,7 @@ end -- assemble subject/action/resource cache key local function xaml_pep_get_cache_key(subject, action, resource) - input = (subject or "") .. (action or "") .. (resource or "") + local input = (subject or "") .. (action or "") .. (resource or "") return ngx.sha1_bin(input) end @@ -141,7 +139,7 @@ end function xacml_pep.pdp_decision(opts, subject, action, resource) -- get a key that uniquely identifies this request in the decision cache - key = xaml_pep_get_cache_key(subject, action, resource) + local key = xaml_pep_get_cache_key(subject, action, resource) -- see if we've previously cached the introspection result for this request local json, err