Skip to content

fix: OAuth2 token encoding and /auth/info route - #49

Open
Coding-Dev-Tools wants to merge 4 commits into
masterfrom
cowork/improve-envault
Open

fix: OAuth2 token encoding and /auth/info route#49
Coding-Dev-Tools wants to merge 4 commits into
masterfrom
cowork/improve-envault

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner
  • URL-encode 1Password Connect filter keys for special characters\n- Encode OAuth2 introspection tokens\n- Add /auth/info route and tests\n- Fix dead code in serve.py

cowork-bot and others added 4 commits July 26, 2026 05:50
…l characters

OnePasswordStore.get() and delete() injected the key directly into the
filter query parameter without URL encoding. Keys containing &, =, #,
spaces, or quotes produced malformed URLs and failed to match.

Fix: apply urllib.parse.quote(key, safe='') before embedding in the
filter string, matching the pattern used by serve.py OAuth2 tokens.

Added 2 regression tests covering get/delete with special-character keys.
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 Automated Code Review

✅ Ruff Lint — No issues

⚠️ Ruff Format — Formatting needed

unformatted: File would be reformatted
   --> tests/test_cli_edge_cases.py:34:26
    |
33  |         "project": "test",
    -         "environments": [
    -             {"name": name, "env_file": path} for name, path in env_map.items()
    -         ],
34  +         "environments": [{"name": name, "env_file": path} for name, path in env_map.items()],
35  |     }
--------------------------------------------------------------------------------
171 |         pkg_data = data.get("tool", {}).get("setuptools", {}).get("package-data", {})
    -         assert "envault" in pkg_data, (
    -             "Expected [tool.setuptools.package-data] section for 'envault'"
    -         )
172 +         assert "envault" in pkg_data, "Expected [tool.setuptools.package-data] section for 'envault'"
173 |         assert "py.typed" in pkg_data["envault"], (
--------------------------------------------------------------------------------
182 |             data = tomllib.load(f)
    -         isort_cfg = (
    -             data.get("tool", {}).get("ruff", {}).get("lint", {}).get("isort", {})
    -         )
183 +         isort_cfg = data.get("tool", {}).get("ruff", {}).get("lint", {}).get("isort", {})
184 |         kfp = isort_cfg.get("known-first-party", [])
    |

unformatted: File would be reformatted
   --> tests/test_stores_integration.py:481:23
    |
480 |         encoded_key = quote(key, safe="")
    -         filter_url = f'{base_url}?filter=title%20eq%20%22{encoded_key}%22'

✅ Secret Detection — Clean

✅ Large Files — Within limits

📊 Diff Stats — 6 file(s) changed

 src/envault/auth.py              |  3 ++-
 src/envault/serve.py             | 34 +++-----------------------
 src/envault/stores/__init__.py   | 10 ++++++--
 tests/test_auth.py               | 37 ++++++++++++++++++++++++++++
 tests/test_serve.py              | 25 +++++++++++++++++++
 tests/test_stores_integration.py | 52 ++++++++++++++++++++++++++++++++++++++++
 6 files changed, 127 insertions(+), 34 deletions(-)

Verdict: ⚠️ Warnings — Lint/format issues found. Recommend fixing before merge.

Automated by Coding-Dev-Tools/.github reusable workflow.

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.

1 participant