Skip to content

Commit

Permalink
release 0.1.1
Browse files Browse the repository at this point in the history
- some more local declarations
- add @altexy to AUTHORS
- extend copyright year to 2018

Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
  • Loading branch information
zandbelt committed Apr 3, 2018
1 parent c9eb42b commit b71d394
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
The primary author of lua-resty-xacml-pep is:

Hans Zandbelt <https://github.com/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 <https://github.com/altexy>
6 changes: 5 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion DISCLAIMER
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2017 ZmartZone IAM
* Copyright (C) 2017-2018 ZmartZone IAM
* All rights reserved.
*
* ZmartZone IAM
Expand Down
14 changes: 6 additions & 8 deletions lib/resty/xacml_pep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -133,15 +131,15 @@ 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

-- main routine for obtaining a PDP decision
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
Expand Down

0 comments on commit b71d394

Please sign in to comment.