gws-cli 1.0.1__tar.gz → 1.1.0__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 (69) hide show
  1. {gws_cli-1.0.1 → gws_cli-1.1.0}/PKG-INFO +2 -2
  2. {gws_cli-1.0.1 → gws_cli-1.1.0}/pyproject.toml +2 -2
  3. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/auth/server.py +4 -1
  4. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/cli.py +1 -0
  5. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/output.py +14 -1
  6. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/utils/security.py +4 -0
  7. {gws_cli-1.0.1 → gws_cli-1.1.0}/.gitignore +0 -0
  8. {gws_cli-1.0.1 → gws_cli-1.1.0}/CLAUDE.md +0 -0
  9. {gws_cli-1.0.1 → gws_cli-1.1.0}/LICENSE +0 -0
  10. {gws_cli-1.0.1 → gws_cli-1.1.0}/LIVE_TESTING.md +0 -0
  11. {gws_cli-1.0.1 → gws_cli-1.1.0}/README.md +0 -0
  12. {gws_cli-1.0.1 → gws_cli-1.1.0}/SKILL-advanced.md +0 -0
  13. {gws_cli-1.0.1 → gws_cli-1.1.0}/SKILL-typesetting.md +0 -0
  14. {gws_cli-1.0.1 → gws_cli-1.1.0}/SKILL.md +0 -0
  15. {gws_cli-1.0.1 → gws_cli-1.1.0}/TESTING.md +0 -0
  16. {gws_cli-1.0.1 → gws_cli-1.1.0}/docker-compose-kroki.yml +0 -0
  17. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/calendar.md +0 -0
  18. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/contacts.md +0 -0
  19. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/docs.md +0 -0
  20. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/drive.md +0 -0
  21. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/gmail.md +0 -0
  22. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/sheets.md +0 -0
  23. {gws_cli-1.0.1 → gws_cli-1.1.0}/reference/slides.md +0 -0
  24. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/__init__.py +0 -0
  25. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/__main__.py +0 -0
  26. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/auth/__init__.py +0 -0
  27. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/auth/oauth.py +0 -0
  28. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/auth/provider.py +0 -0
  29. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/auth/scopes.py +0 -0
  30. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/__init__.py +0 -0
  31. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/_account.py +0 -0
  32. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/calendar.py +0 -0
  33. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/contacts.py +0 -0
  34. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/convert.py +0 -0
  35. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/docs.py +0 -0
  36. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/drive.py +0 -0
  37. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/gmail.py +0 -0
  38. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/sheets.py +0 -0
  39. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/commands/slides.py +0 -0
  40. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/config.py +0 -0
  41. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/context.py +0 -0
  42. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/crypto.py +0 -0
  43. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/exceptions.py +0 -0
  44. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/__init__.py +0 -0
  45. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/base.py +0 -0
  46. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/calendar.py +0 -0
  47. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/contacts.py +0 -0
  48. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/convert.py +0 -0
  49. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/docs.py +0 -0
  50. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/drive.py +0 -0
  51. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/gmail.py +0 -0
  52. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/sheets.py +0 -0
  53. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/services/slides.py +0 -0
  54. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/utils/__init__.py +0 -0
  55. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/utils/colors.py +0 -0
  56. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/utils/diagrams.py +0 -0
  57. {gws_cli-1.0.1 → gws_cli-1.1.0}/src/gws/utils/retry.py +0 -0
  58. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/__init__.py +0 -0
  59. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/conftest.py +0 -0
  60. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_account_commands.py +0 -0
  61. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_account_enforcement.py +0 -0
  62. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_auth_accounts.py +0 -0
  63. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_auth_provider.py +0 -0
  64. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_config_accounts.py +0 -0
  65. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_crypto.py +0 -0
  66. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_docs.py +0 -0
  67. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_gmail_mime.py +0 -0
  68. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_output.py +0 -0
  69. {gws_cli-1.0.1 → gws_cli-1.1.0}/tests/test_server_auth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gws-cli
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Google Workspace CLI - Unified management for Docs, Sheets, Slides, Drive, Gmail, Calendar, and Contacts
5
5
  Project-URL: Homepage, https://github.com/andmarios/google-workspace-skill
6
6
  Project-URL: Repository, https://github.com/andmarios/google-workspace-skill
@@ -24,7 +24,7 @@ Requires-Dist: google-api-python-client>=2.100.0
24
24
  Requires-Dist: google-auth-oauthlib>=1.1.0
25
25
  Requires-Dist: google-auth>=2.23.0
26
26
  Requires-Dist: httpx>=0.25.0
27
- Requires-Dist: prompt-security-utils>=1.0.0
27
+ Requires-Dist: prompt-security-utils>=1.2.0
28
28
  Requires-Dist: rich>=13.0.0
29
29
  Requires-Dist: typer>=0.9.0
30
30
  Provides-Extra: dev
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "gws-cli"
7
- version = "1.0.1"
7
+ version = "1.1.0"
8
8
  description = "Google Workspace CLI - Unified management for Docs, Sheets, Slides, Drive, Gmail, Calendar, and Contacts"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -32,7 +32,7 @@ dependencies = [
32
32
  "google-auth>=2.23.0",
33
33
  "google-auth-oauthlib>=1.1.0",
34
34
  "httpx>=0.25.0",
35
- "prompt-security-utils>=1.0.0",
35
+ "prompt-security-utils>=1.2.0",
36
36
  "cryptography>=46.0.4",
37
37
  ]
38
38
 
@@ -671,7 +671,10 @@ class ServerAuthProvider:
671
671
 
672
672
  client_id = token_data.get("client_id", "server-managed")
673
673
  resolved_refresh = token_data.get("refresh_token", refresh_token)
674
- expires_in = token_data.get("expires_in", 3600)
674
+ expires_in = token_data.get("expires_in", 0)
675
+ # expires_in=0 means the provider doesn't set expiry — default to 1 hour
676
+ if not expires_in:
677
+ expires_in = 3600
675
678
  # Use naive UTC to match google-auth's internal convention
676
679
  expiry = (datetime.now(timezone.utc) + timedelta(seconds=expires_in)).replace(tzinfo=None)
677
680
 
@@ -17,6 +17,7 @@ app = typer.Typer(
17
17
  help="Google Workspace CLI - Unified management for Google services.",
18
18
  no_args_is_help=True,
19
19
  add_completion=False,
20
+ pretty_exceptions_show_locals=False,
20
21
  )
21
22
 
22
23
 
@@ -6,9 +6,19 @@ from typing import Any
6
6
 
7
7
  from prompt_security import output_external_content as _output_external_content
8
8
  from prompt_security import load_config as load_security_config
9
+ from prompt_security import generate_markers
9
10
 
10
11
  from gws.config import Config
11
12
 
13
+ # Session-scoped security markers — generated once at import time.
14
+ # For CLI tools the human controls the pipeline, so these are defense-in-depth.
15
+ _SESSION_START, _SESSION_END = generate_markers()
16
+
17
+
18
+ def _get_session_markers() -> tuple[str, str]:
19
+ """Return the module-level session markers."""
20
+ return _SESSION_START, _SESSION_END
21
+
12
22
 
13
23
  def output_json(data: dict[str, Any]) -> None:
14
24
  """Output JSON to stdout."""
@@ -87,13 +97,16 @@ def output_external_content(
87
97
  output_json(response)
88
98
  return
89
99
 
90
- # Security enabled - wrap content with markers
100
+ # Security enabled - wrap content with session markers
101
+ start, end = _get_session_markers()
91
102
  security_config = load_security_config()
92
103
  response = _output_external_content(
93
104
  operation=operation,
94
105
  source_type=source_type,
95
106
  source_id=source_id,
96
107
  content_fields=content_fields,
108
+ start_marker=start,
109
+ end_marker=end,
97
110
  config=security_config,
98
111
  **kwargs,
99
112
  )
@@ -1,6 +1,8 @@
1
1
  """Security utilities for GWS - thin wrapper around prompt-security-utils."""
2
2
 
3
3
  from prompt_security import (
4
+ generate_markers,
5
+ security_instructions,
4
6
  wrap_untrusted_content,
5
7
  wrap_field,
6
8
  wrap_fields,
@@ -12,6 +14,8 @@ from prompt_security import (
12
14
  )
13
15
 
14
16
  __all__ = [
17
+ "generate_markers",
18
+ "security_instructions",
15
19
  "wrap_untrusted_content",
16
20
  "wrap_field",
17
21
  "wrap_fields",
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