Skip to content

Vault module missing get() method? #143

@shawnchapla-8451

Description

@shawnchapla-8451

Trying to use the PDK to read a secret from Kong vault:

eg_public_key = kong.vault.get("vault://azure/eg-pbk-certs")

However, when this executes:

2024/05/13 15:41:01 [info] 2387#0: *1525 [python-plugin:2400]   File "/usr/local/kong/python/jwt-validator.py", line 111, in __init__, context: ngx.timer
2024/05/13 15:41:01 [info] 2387#0: *1525 [python-plugin:2400]     eg_public_key = kong.vault.get("vault://azure/eg-pbk-certs"), context: ngx.timer
2024/05/13 15:41:01 [info] 2387#0: *1525 [python-plugin:2400] AttributeError: module 'kong_pdk.pdk.kong.vault' has no attribute 'get', context: ngx.timer
2024/05/13 15:41:01 [error] 2395#0: *2568 [kong] init.lua:247 [e451-jwt-validator] starting instance: module 'kong_pdk.pdk.kong.vault' has no attribute 'get', client: 192.168.65.1, server: kong, request: "GET /jwttest HTTP/1.1", host: "localhost:8000", request_id: "f110d743b81f6750e86b1a4fc69ecc4e"

I can see it defined here, so not sure how to resolve this. I'm pulling v0.36 of the kong-pdk package, which I believe is the most current (though apparently nearly a year old at this point).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions