Kong / Kong/kong-python-pdk

Vault module missing get() method?

Open
#143 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/Kong/kong-python-pdk/blob/master/kong_pdk/pdk/kong/vault.py#L28-L47), 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).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with kong_pdk/pdk/kong/vault.py, especially the get() definition linked in the issue, and compare it with the v0.36 package actually installed by the Python plugin. Reproduce the import and call shown in the report; done means explaining why get() is unavailable at runtime and identifying the package or release state that resolves the mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.