Skip to content

Commit

Permalink
Merge pull request #1 from altexy/locals
Browse files Browse the repository at this point in the history
fix missed local usage
  • Loading branch information
zandbelt authored Apr 3, 2018
2 parents f807ec8 + 62099ff commit c9eb42b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/resty/xacml_pep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Copyright (C) 2017 ZmartZone IAM
All rights reserved.
For further information please contact:
ZmartZone IAM
info@zmartzone.eu
http://www.zmartzone.eu
Expand Down Expand Up @@ -144,19 +144,19 @@ function xacml_pep.pdp_decision(opts, subject, action, resource)
key = xaml_pep_get_cache_key(subject, action, resource)

-- see if we've previously cached the introspection result for this request
local json
local json, err
local v = xacml_pep_cache_get("decision", key)
if not v then

table = { Request = {
local table = { Request = {

AccessSubject = {
Attribute = { {
AttributeId = "urn:oasis:names:tc:xacml:1.0:subject:subject-id",
Value = subject
} }
},

Action = {
Attribute = { {
AttributeId = "urn:oasis:names:tc:xacml:1.0:action:action-id",
Expand All @@ -170,13 +170,13 @@ function xacml_pep.pdp_decision(opts, subject, action, resource)
Value = resource
} }
}

} }

-- call the PDP endpoint
body = cjson.encode(table)
local body = cjson.encode(table)
json, err = xacml_pep_call_pdp_endpoint(opts, opts.pdp_endpoint, body, nil)

-- cache the results
if json then
ttl = opts.ttl or 300
Expand Down

0 comments on commit c9eb42b

Please sign in to comment.