ragfly-cli 1.17.1__tar.gz → 1.17.2__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.
Files changed (24) hide show
  1. {ragfly_cli-1.17.1/ragfly_cli.egg-info → ragfly_cli-1.17.2}/PKG-INFO +1 -1
  2. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/pyproject.toml +1 -1
  3. ragfly_cli-1.17.2/ragfly_cli/__init__.py +1 -0
  4. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/cloud_commands.py +12 -1
  5. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/keyring_store.py +23 -2
  6. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2/ragfly_cli.egg-info}/PKG-INFO +1 -1
  7. ragfly_cli-1.17.1/ragfly_cli/__init__.py +0 -1
  8. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/LICENSE +0 -0
  9. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/README.md +0 -0
  10. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/__main__.py +0 -0
  11. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/_http.py +0 -0
  12. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/cli.py +0 -0
  13. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/config.py +0 -0
  14. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/grupo_activo.py +0 -0
  15. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/oop/__init__.py +0 -0
  16. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/oop/cli_command.py +0 -0
  17. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/oop/http_client.py +0 -0
  18. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli/version_check.py +0 -0
  19. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli.egg-info/SOURCES.txt +0 -0
  20. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli.egg-info/dependency_links.txt +0 -0
  21. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli.egg-info/entry_points.txt +0 -0
  22. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli.egg-info/requires.txt +0 -0
  23. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/ragfly_cli.egg-info/top_level.txt +0 -0
  24. {ragfly_cli-1.17.1 → ragfly_cli-1.17.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 1.17.1
3
+ Version: 1.17.2
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ragfly-cli"
7
- version = "1.17.1"
7
+ version = "1.17.2"
8
8
  description = "RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1 @@
1
+ __version__ = "1.17.2"
@@ -211,5 +211,16 @@ def login(email: str, password: str) -> dict:
211
211
  raise CloudError("El servidor no retornó un token.", exit_code=2)
212
212
 
213
213
  expires_in = data.get("expires_in", 3600)
214
- guardar_credenciales(token, email, expires_in)
214
+ try:
215
+ guardar_credenciales(token, email, expires_in)
216
+ except keyring_store.KeyringStoreError:
217
+ raise CloudError(
218
+ "Login correcto, pero no se pudo guardar la sesión: el keyring del "
219
+ "SO no está disponible (típico en headless/CI).\n"
220
+ " Para entornos sin llavero usá una API key de larga duración:\n"
221
+ " export RAGFLY_TOKEN=slm_live_...\n"
222
+ " (creala con `ragfly cloud api-key crear --nombre ci`, o desde la "
223
+ "web). El login interactivo requiere una terminal con keyring.",
224
+ exit_code=1,
225
+ )
215
226
  return data
@@ -19,6 +19,14 @@ SERVICE = "ragfly-ragflydesktop"
19
19
  KEY_TOKEN = "jwt"
20
20
  KEY_EMAIL = "email"
21
21
 
22
+
23
+ class KeyringStoreError(Exception):
24
+ """El keyring del SO no está disponible o falló al guardar la sesión.
25
+
26
+ Típico en entornos headless/CI (sin Keychain/libsecret). El llamador debe
27
+ capturarlo y sugerir el flujo por `RAGFLY_TOKEN`.
28
+ """
29
+
22
30
  # Cache en RAM por sesión del proceso. Evita re-leer el Keychain en cada
23
31
  # llamada (cada lectura dispara un prompt del llavero cuando la app está
24
32
  # firmada ad-hoc, como en builds de desarrollo). Se lee una sola vez y se
@@ -30,9 +38,22 @@ _cache_email: object | str | None = _NO_LEIDO
30
38
 
31
39
 
32
40
  def guardar(token: str, email: str) -> None:
41
+ """Persiste JWT+email en el keyring del SO.
42
+
43
+ Lanza `KeyringStoreError` si el keyring no está disponible (headless/CI) o
44
+ falla, sin dejar sesión parcial.
45
+ """
33
46
  global _cache_token, _cache_email
34
- keyring.set_password(SERVICE, KEY_TOKEN, token)
35
- keyring.set_password(SERVICE, KEY_EMAIL, email)
47
+ try:
48
+ keyring.set_password(SERVICE, KEY_TOKEN, token)
49
+ keyring.set_password(SERVICE, KEY_EMAIL, email)
50
+ except Exception as e: # KeyringError y backends sin llavero (NoKeyringError, etc.)
51
+ # Rollback best-effort para no dejar sesión parcial (token sin email).
52
+ try:
53
+ keyring.delete_password(SERVICE, KEY_TOKEN)
54
+ except Exception:
55
+ pass
56
+ raise KeyringStoreError(str(e)) from e
36
57
  _cache_token = token
37
58
  _cache_email = email
38
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 1.17.1
3
+ Version: 1.17.2
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
@@ -1 +0,0 @@
1
- __version__ = "1.17.1"
File without changes
File without changes
File without changes