Skip to content

injection opa result as header, local integrasion test pass - #1

Open
leeofri wants to merge 4 commits into
masterfrom
baggage-injectios
Open

injection opa result as header, local integrasion test pass#1
leeofri wants to merge 4 commits into
masterfrom
baggage-injectios

Conversation

@leeofri

@leeofri leeofri commented Jun 17, 2021

Copy link
Copy Markdown

No description provided.

@leeofri
leeofri requested review from Eyal-Shalev and motiisr June 17, 2021 16:13
Comment on lines +57 to +65
-- 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)

Copy link
Copy Markdown

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}", {

Copy link
Copy Markdown

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug

Suggested change
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also

@Eyal-Shalev Eyal-Shalev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaa

@leeofri
leeofri requested a review from Eyal-Shalev June 20, 2021 09:08
Eyal-Shalev
Eyal-Shalev previously approved these changes Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants