flyshell 1.2.9__tar.gz → 1.2.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flyshell-1.2.9/src/flyshell.egg-info → flyshell-1.2.10}/PKG-INFO +1 -1
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/constants.py +2 -2
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/env.py +0 -2
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/loader.py +32 -1
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/main.py +1 -0
- {flyshell-1.2.9 → flyshell-1.2.10/src/flyshell.egg-info}/PKG-INFO +1 -1
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_env_keys.py +0 -1
- {flyshell-1.2.9 → flyshell-1.2.10}/LICENSE +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/README.md +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/pyproject.toml +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/setup.cfg +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/__init__.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/abstract/__init__.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/abstract/base_cmd.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/abstract/base_plugin.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/abstract/parent_cmd.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/__init__.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/diskops.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/fs.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/pkg.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/system.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/builtin/utils.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/__init__.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/auth.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/console.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/data.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell/core/directory.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell.egg-info/SOURCES.txt +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell.egg-info/dependency_links.txt +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell.egg-info/entry_points.txt +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell.egg-info/requires.txt +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/src/flyshell.egg-info/top_level.txt +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_auth.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_data.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_directory.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_diskops.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_fs.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_loader.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_pkg.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_security.py +0 -0
- {flyshell-1.2.9 → flyshell-1.2.10}/tests/test_utils.py +0 -0
|
@@ -39,7 +39,6 @@ def read_env_file() -> dict[str, str]:
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def _resolve_plugin_dir_name(target_name: str) -> tuple[str, object | None]:
|
|
42
|
-
"""Resolves an identifier, display name, or dir name to (dir_name, plugin_instance)."""
|
|
43
42
|
target_lower = target_name.strip().lower()
|
|
44
43
|
if hasattr(c, "PLUGINS"):
|
|
45
44
|
if target_lower in c.PLUGINS:
|
|
@@ -85,7 +84,6 @@ def get_plugin_api_keys(plugin_name_or_dir: str) -> dict[str, str]:
|
|
|
85
84
|
|
|
86
85
|
|
|
87
86
|
def get_all_keys() -> tuple[int, str]:
|
|
88
|
-
"""Retrieve and display all configured API keys in the environment."""
|
|
89
87
|
env_path = get_env_path()
|
|
90
88
|
if not env_path.exists():
|
|
91
89
|
return (1, f"File Config Error: Environment file not found at '{env_path}'.")
|
|
@@ -67,7 +67,7 @@ def scan_plugins(plugin_folder=None):
|
|
|
67
67
|
print(f"Please define them in: {env_file} as:")
|
|
68
68
|
for mk in missing_keys:
|
|
69
69
|
print(f"{default_name}_{mk}=<your_key>")
|
|
70
|
-
|
|
70
|
+
print("You can do this once Flyshell has booted.")
|
|
71
71
|
instance = obj(ctx)
|
|
72
72
|
candidates.setdefault(resolved_name, []).append(
|
|
73
73
|
(instance, file_path)
|
|
@@ -114,3 +114,34 @@ def build_context(plugin_name, default_name, file_path=None):
|
|
|
114
114
|
"storage": plugin_storage,
|
|
115
115
|
}
|
|
116
116
|
return context
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def check_plugin_api_keys():
|
|
120
|
+
if not c.PLUGINS:
|
|
121
|
+
return
|
|
122
|
+
print("\nFlyshell will now check plugin API keys.")
|
|
123
|
+
has_keys_to_report = False
|
|
124
|
+
for identifier, plugin in c.PLUGINS.items():
|
|
125
|
+
required_keys = getattr(plugin, "api_keys", [])
|
|
126
|
+
configured_keys = getattr(plugin, "api_keys_data", {})
|
|
127
|
+
dir_name = plugin.context.get("plugin_dir_name", identifier)
|
|
128
|
+
if not required_keys and not configured_keys:
|
|
129
|
+
continue
|
|
130
|
+
has_keys_to_report = True
|
|
131
|
+
configured_lookup = {k.lower(): (k, v) for k, v in configured_keys.items()}
|
|
132
|
+
seen_keys = set()
|
|
133
|
+
print(f"\nPlugin: {plugin.name} ({identifier})")
|
|
134
|
+
for req in required_keys:
|
|
135
|
+
req_lower = req.lower()
|
|
136
|
+
seen_keys.add(req_lower)
|
|
137
|
+
if req_lower in configured_lookup:
|
|
138
|
+
orig_k, _ = configured_lookup[req_lower]
|
|
139
|
+
print(f"✅ {orig_k} - Key found [Required]")
|
|
140
|
+
else:
|
|
141
|
+
print(f"⚠️ {req} - KEY NOT FOUND [Required]")
|
|
142
|
+
print(f"Please define in the .env file as: {dir_name}_{req}=<your_key>")
|
|
143
|
+
for k_lower, (orig_k, _) in sorted(configured_lookup.items()):
|
|
144
|
+
if k_lower not in seen_keys:
|
|
145
|
+
print(f"✅ {orig_k} - Key found [Optional/Extra]")
|
|
146
|
+
if not has_keys_to_report:
|
|
147
|
+
print("✅ No API keys required for any loaded plugins.")
|
|
@@ -82,7 +82,6 @@ def test_loader_rejects_plugin_with_missing_keys(
|
|
|
82
82
|
)
|
|
83
83
|
monkeypatch.setattr(c, "USER_PLUGIN_DIR", tmp_path)
|
|
84
84
|
loader.scan_plugins(plugin_folder=tmp_path)
|
|
85
|
-
assert "needkey" not in c.PLUGINS
|
|
86
85
|
out = capsys.readouterr().out
|
|
87
86
|
assert "API Key Error" in out
|
|
88
87
|
assert "second" in out
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|