-
Notifications
You must be signed in to change notification settings - Fork 63
LCORE-675: rename module auth to authentication to distinguish it from authorization #538
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
Changes from all commits
20d8ce8
3c95055
74b12da
4c2b26c
db27483
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,8 @@ | |
|
|
||
| import logging | ||
|
|
||
| from auth.interface import AuthInterface | ||
| from auth import noop, noop_with_token, k8s, jwk_token | ||
| from authentication.interface import AuthInterface | ||
| from authentication import noop, noop_with_token, k8s, jwk_token | ||
|
Comment on lines
+5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainRename looks good; consider relative imports + optional compatibility shim.
Apply this local import tweak: -from authentication.interface import AuthInterface
-from authentication import noop, noop_with_token, k8s, jwk_token
+from .interface import AuthInterface
+from . import noop, noop_with_token, k8s, jwk_tokenOptional: add a deprecation shim to keep old imports working during transition: +// New file: src/auth/__init__.py
+import warnings, importlib, sys
+warnings.warn(
+ "Package 'auth' has been renamed to 'authentication'. Please update imports.",
+ DeprecationWarning, stacklevel=2
+)
+# Re-export submodules so auth.k8s, auth.interface, etc. continue to work.
+for _mod in ("k8s", "interface", "noop", "noop_with_token", "jwk_token"):
+ sys.modules[__name__ + "." + _mod] = importlib.import_module("authentication." + _mod)Verify no lingering imports from the old path: 🏁 Script executed: #!/bin/bash
# Find any remaining 'auth.' imports/usages.
rg -nP -C2 '\bfrom\s+auth(\.| \b)|\bimport\s+auth\b|\bauth\.' --glob '!**/.venv/**' --glob '!**/node_modules/**'Length of output: 148 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Attempting robust search for 'auth' imports/usages..."
echo "1) ripgrep (unrestricted, include hidden, ignore VCS ignore):"
rg -n -uu --hidden --no-ignore-vcs -C2 \
-e '^\s*from\s+auth\b' \
-e '^\s*import\s+auth\b' \
-e '\bauth\.' \
-g '!**/node_modules/**' -g '!**/.venv/**' || echo "No matches from ripgrep (attempt 1)"
echo "2) Fallback: search tracked files (if in a git repo):"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
git ls-files | while IFS= read -r f; do
rg -n -C2 -e '^\s*from\s+auth\b' -e '^\s*import\s+auth\b' -e '\bauth\.' "$f" || true
done || true
else
echo "Not a git repo; skipping fallback."
fi
echo "Search complete."Length of output: 1072 Use relative imports and add a temporary Search found a legacy Change in src/authentication/init.py (lines 5–6): -from authentication.interface import AuthInterface
-from authentication import noop, noop_with_token, k8s, jwk_token
+from .interface import AuthInterface
+from . import noop, noop_with_token, k8s, jwk_tokenOptional temporary shim (new file src/auth/init.py): import warnings, importlib, sys
warnings.warn(
"Package 'auth' has been renamed to 'authentication'. Update imports.",
DeprecationWarning, stacklevel=2
)
for _mod in ("k8s", "interface", "noop", "noop_with_token", "jwk_token"):
sys.modules[__name__ + "." + _mod] = importlib.import_module("authentication." + _mod)🤖 Prompt for AI Agents |
||
| from configuration import configuration | ||
| import constants | ||
|
|
||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
LGTM: updated Pyright exclude path.
Change aligns with the module rename.
Run this to ensure no lingering
authimports/paths remain:🏁 Script executed:
Length of output: 42
🏁 Script executed:
Length of output: 377
🏁 Script executed:
Length of output: 2078
Hold — update remaining
authreferences toauthenticationPyright exclude change aligns with the rename, but leftover references to "auth" remain — update the following:
No "import auth" / "from auth ..." occurrences were found.
🤖 Prompt for AI Agents