-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
injection opa result as header, local integrasion test pass #1
base: master
Are you sure you want to change the base?
Conversation
-- it("allow access return baggae in header - default key ", function() | ||
-- _G.ngx.var.upstream_uri = "/api/endpoint/baggage" | ||
-- local res = access.execute(conf) | ||
-- print("lee -spec res") | ||
-- print(res) | ||
-- -- assert.request(res).has.header("baggage") | ||
-- -- assert.is_true(res.headers["baggage"] == "BASE64_JWT_INTERNAL") | ||
-- end) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comments
-- access allowed | ||
kong.log.debug(interp("Access allowed to ${method} ${path} for user ${subject}", { | ||
kong.log.debug(interp("Access 2 allowed to ${method} ${path} for user ${subject}", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo change
if type(res.result) == "table" then | ||
local baggage_key = conf.policy.baggage_key_in_result | ||
if res.result[baggage_key] ~= nil then | ||
inject_header(baggage_key,res.result.baggage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug
inject_header(baggage_key,res.result.baggage) | |
inject_header(baggage_key, res.result[baggage_key]) |
if res.result[baggage_key] ~= nil then | ||
inject_header(baggage_key,res.result.baggage) | ||
kong.log.debug(interp("Baggage header injected ${baggage}", { | ||
baggage = res.result.baggage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaa
No description provided.