authsec-sdk-vnext 4.2.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 (29) hide show
  1. authsec_sdk_vnext-4.2.0/MANIFEST.in +3 -0
  2. authsec_sdk_vnext-4.2.0/PKG-INFO +134 -0
  3. authsec_sdk_vnext-4.2.0/README.md +113 -0
  4. authsec_sdk_vnext-4.2.0/pyproject.toml +45 -0
  5. authsec_sdk_vnext-4.2.0/setup.cfg +4 -0
  6. authsec_sdk_vnext-4.2.0/setup.py +3 -0
  7. authsec_sdk_vnext-4.2.0/src/authsec_sdk/__init__.py +54 -0
  8. authsec_sdk_vnext-4.2.0/src/authsec_sdk/ciba_sdk.py +398 -0
  9. authsec_sdk_vnext-4.2.0/src/authsec_sdk/cli.py +229 -0
  10. authsec_sdk_vnext-4.2.0/src/authsec_sdk/core.py +1661 -0
  11. authsec_sdk_vnext-4.2.0/src/authsec_sdk/delegation_sdk.py +362 -0
  12. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/__init__.py +31 -0
  13. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/api/__init__.py +9 -0
  14. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/api/workload.proto +126 -0
  15. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/api/workload_pb2.py +81 -0
  16. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/api/workload_pb2_grpc.py +278 -0
  17. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/client.py +437 -0
  18. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spiffe_workload_api/simple.py +248 -0
  19. authsec_sdk_vnext-4.2.0/src/authsec_sdk/spire_sdk.py +368 -0
  20. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/PKG-INFO +134 -0
  21. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/SOURCES.txt +27 -0
  22. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/dependency_links.txt +1 -0
  23. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/entry_points.txt +2 -0
  24. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/requires.txt +13 -0
  25. authsec_sdk_vnext-4.2.0/src/authsec_sdk_vnext.egg-info/top_level.txt +1 -0
  26. authsec_sdk_vnext-4.2.0/tests/test_bearer_http_flow.py +177 -0
  27. authsec_sdk_vnext-4.2.0/tests/test_browser.py +981 -0
  28. authsec_sdk_vnext-4.2.0/tests/test_config_flow.py +323 -0
  29. authsec_sdk_vnext-4.2.0/tests/test_integration.py +733 -0
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ recursive-include src/authsec_sdk/spiffe_workload_api/api *.proto
3
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: authsec-sdk-vnext
3
+ Version: 4.2.0
4
+ Summary: Preview AuthSec SDK for bearer-first MCP auth, services, CIBA, and SPIFFE integration
5
+ Author-email: AuthSec Team <a@authnull.com>
6
+ Keywords: authsec,mcp,oauth,rbac,spiffe,ciba,authentication,authorization
7
+ Requires-Python: >=3.10.11
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: aiohttp>=3.9.0
10
+ Requires-Dist: certifi>=2024.0.0
11
+ Requires-Dist: fastapi>=0.110.0
12
+ Requires-Dist: grpcio>=1.60.0
13
+ Requires-Dist: protobuf<6.0.0,>=5.29.0
14
+ Requires-Dist: requests>=2.31.0
15
+ Requires-Dist: uvicorn>=0.27.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: build>=1.2.0; extra == "dev"
18
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
19
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
20
+ Requires-Dist: twine>=5.0.0; extra == "dev"
21
+
22
+ # AuthSec Python SDK vNext
23
+
24
+ Preview Python SDK for AuthSec bearer-first MCP authentication, RBAC, service access, CIBA, delegation, and SPIFFE integrations.
25
+
26
+ ## Install
27
+
28
+ From PyPI:
29
+
30
+ ```bash
31
+ pip install authsec-sdk-vnext
32
+ ```
33
+
34
+ For local SDK development:
35
+
36
+ ```bash
37
+ cd packages/python-sdk
38
+ pip install -e ".[dev]"
39
+ ```
40
+
41
+ ## Recommended Setup Flow
42
+
43
+ The default user flow is:
44
+
45
+ ```bash
46
+ pip install authsec-sdk-vnext
47
+ authsec init
48
+ ```
49
+
50
+ `authsec init` writes `.authsec.json` in the current working directory. If you choose the default setup path, it writes these prod endpoints:
51
+
52
+ - `https://prod.api.authsec.ai/sdkmgr/mcp-auth`
53
+ - `https://prod.api.authsec.ai/sdkmgr/services`
54
+ - `https://prod.api.authsec.ai`
55
+
56
+ Use `authsec config show` to verify the saved configuration.
57
+
58
+ If you need localhost, staging, or self-hosted AuthSec, choose the custom path in `authsec init` or set explicit environment overrides.
59
+
60
+ ## Team Knowledge Base Flow
61
+
62
+ The intended acceptance flow matches the protected Team Knowledge Base example:
63
+
64
+ 1. `pip install authsec-sdk-vnext`
65
+ 2. `authsec init`
66
+ 3. Run your protected MCP server
67
+ 4. Confirm startup logs show the prod AuthSec endpoints by default
68
+
69
+ When the app name is `Team Knowledge Base (Protected)`, the expected startup output is:
70
+
71
+ ```text
72
+ Auth configured: Team Knowledge Base (Protected) with client_id: 921c2209...
73
+ Auth service URL: https://prod.api.authsec.ai/sdkmgr/mcp-auth
74
+ Services URL: https://prod.api.authsec.ai/sdkmgr/services
75
+ Starting Team Knowledge Base (Protected) MCP Server on 0.0.0.0:3005
76
+ Authentication via: https://prod.api.authsec.ai/sdkmgr/mcp-auth
77
+ Services via: https://prod.api.authsec.ai/sdkmgr/services
78
+ SPIRE Workload Identity: DISABLED
79
+ ```
80
+
81
+ ## Example Server
82
+
83
+ This package includes a Python MCP demo at `examples/local_authsec_demo_server.py`.
84
+
85
+ Run it like this:
86
+
87
+ ```bash
88
+ cd packages/python-sdk-vnext
89
+ authsec init
90
+ set -a
91
+ source examples/local_authsec_demo.env.example
92
+ set +a
93
+ python examples/local_authsec_demo_server.py
94
+ ```
95
+
96
+ By default, the example relies on `.authsec.json` created by `authsec init`. Only set `AUTHSEC_AUTH_SERVICE_URL` or `AUTHSEC_SERVICES_URL` if you intentionally want to override the prod defaults.
97
+
98
+ ## Testing
99
+
100
+ Install the dev extras and run tests:
101
+
102
+ ```bash
103
+ cd packages/python-sdk-vnext
104
+ pip install -e ".[dev]"
105
+ pytest tests/test_config_flow.py
106
+ ```
107
+
108
+ The existing integration tests that point at localhost remain explicit local-service tests; they are not the default user path.
109
+
110
+ ## Maintainer Release Flow
111
+
112
+ Build and verify locally:
113
+
114
+ ```bash
115
+ cd packages/python-sdk-vnext
116
+ python -m build
117
+ python -m twine check dist/*
118
+ ```
119
+
120
+ Smoke test the built artifact in a fresh virtualenv:
121
+
122
+ ```bash
123
+ python -m venv /tmp/authsec-sdk-smoke
124
+ source /tmp/authsec-sdk-smoke/bin/activate
125
+ pip install /absolute/path/to/packages/python-sdk-vnext/dist/authsec_sdk_vnext-<version>-py3-none-any.whl
126
+ authsec init
127
+ ```
128
+
129
+ Publish with token-based Twine auth supplied via environment variables or `.pypirc`, then verify in a fresh virtualenv with:
130
+
131
+ ```bash
132
+ pip install authsec-sdk-vnext
133
+ authsec init
134
+ ```
@@ -0,0 +1,113 @@
1
+ # AuthSec Python SDK vNext
2
+
3
+ Preview Python SDK for AuthSec bearer-first MCP authentication, RBAC, service access, CIBA, delegation, and SPIFFE integrations.
4
+
5
+ ## Install
6
+
7
+ From PyPI:
8
+
9
+ ```bash
10
+ pip install authsec-sdk-vnext
11
+ ```
12
+
13
+ For local SDK development:
14
+
15
+ ```bash
16
+ cd packages/python-sdk
17
+ pip install -e ".[dev]"
18
+ ```
19
+
20
+ ## Recommended Setup Flow
21
+
22
+ The default user flow is:
23
+
24
+ ```bash
25
+ pip install authsec-sdk-vnext
26
+ authsec init
27
+ ```
28
+
29
+ `authsec init` writes `.authsec.json` in the current working directory. If you choose the default setup path, it writes these prod endpoints:
30
+
31
+ - `https://prod.api.authsec.ai/sdkmgr/mcp-auth`
32
+ - `https://prod.api.authsec.ai/sdkmgr/services`
33
+ - `https://prod.api.authsec.ai`
34
+
35
+ Use `authsec config show` to verify the saved configuration.
36
+
37
+ If you need localhost, staging, or self-hosted AuthSec, choose the custom path in `authsec init` or set explicit environment overrides.
38
+
39
+ ## Team Knowledge Base Flow
40
+
41
+ The intended acceptance flow matches the protected Team Knowledge Base example:
42
+
43
+ 1. `pip install authsec-sdk-vnext`
44
+ 2. `authsec init`
45
+ 3. Run your protected MCP server
46
+ 4. Confirm startup logs show the prod AuthSec endpoints by default
47
+
48
+ When the app name is `Team Knowledge Base (Protected)`, the expected startup output is:
49
+
50
+ ```text
51
+ Auth configured: Team Knowledge Base (Protected) with client_id: 921c2209...
52
+ Auth service URL: https://prod.api.authsec.ai/sdkmgr/mcp-auth
53
+ Services URL: https://prod.api.authsec.ai/sdkmgr/services
54
+ Starting Team Knowledge Base (Protected) MCP Server on 0.0.0.0:3005
55
+ Authentication via: https://prod.api.authsec.ai/sdkmgr/mcp-auth
56
+ Services via: https://prod.api.authsec.ai/sdkmgr/services
57
+ SPIRE Workload Identity: DISABLED
58
+ ```
59
+
60
+ ## Example Server
61
+
62
+ This package includes a Python MCP demo at `examples/local_authsec_demo_server.py`.
63
+
64
+ Run it like this:
65
+
66
+ ```bash
67
+ cd packages/python-sdk-vnext
68
+ authsec init
69
+ set -a
70
+ source examples/local_authsec_demo.env.example
71
+ set +a
72
+ python examples/local_authsec_demo_server.py
73
+ ```
74
+
75
+ By default, the example relies on `.authsec.json` created by `authsec init`. Only set `AUTHSEC_AUTH_SERVICE_URL` or `AUTHSEC_SERVICES_URL` if you intentionally want to override the prod defaults.
76
+
77
+ ## Testing
78
+
79
+ Install the dev extras and run tests:
80
+
81
+ ```bash
82
+ cd packages/python-sdk-vnext
83
+ pip install -e ".[dev]"
84
+ pytest tests/test_config_flow.py
85
+ ```
86
+
87
+ The existing integration tests that point at localhost remain explicit local-service tests; they are not the default user path.
88
+
89
+ ## Maintainer Release Flow
90
+
91
+ Build and verify locally:
92
+
93
+ ```bash
94
+ cd packages/python-sdk-vnext
95
+ python -m build
96
+ python -m twine check dist/*
97
+ ```
98
+
99
+ Smoke test the built artifact in a fresh virtualenv:
100
+
101
+ ```bash
102
+ python -m venv /tmp/authsec-sdk-smoke
103
+ source /tmp/authsec-sdk-smoke/bin/activate
104
+ pip install /absolute/path/to/packages/python-sdk-vnext/dist/authsec_sdk_vnext-<version>-py3-none-any.whl
105
+ authsec init
106
+ ```
107
+
108
+ Publish with token-based Twine auth supplied via environment variables or `.pypirc`, then verify in a fresh virtualenv with:
109
+
110
+ ```bash
111
+ pip install authsec-sdk-vnext
112
+ authsec init
113
+ ```
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "authsec-sdk-vnext"
7
+ version = "4.2.0"
8
+ description = "Preview AuthSec SDK for bearer-first MCP auth, services, CIBA, and SPIFFE integration"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10.11"
11
+ authors = [
12
+ { name = "AuthSec Team", email = "a@authnull.com" }
13
+ ]
14
+ dependencies = [
15
+ "aiohttp>=3.9.0",
16
+ "certifi>=2024.0.0",
17
+ "fastapi>=0.110.0",
18
+ "grpcio>=1.60.0",
19
+ "protobuf>=5.29.0,<6.0.0",
20
+ "requests>=2.31.0",
21
+ "uvicorn>=0.27.0"
22
+ ]
23
+ keywords = ["authsec", "mcp", "oauth", "rbac", "spiffe", "ciba", "authentication", "authorization"]
24
+
25
+ [project.scripts]
26
+ authsec = "authsec_sdk.cli:main"
27
+
28
+ [project.optional-dependencies]
29
+ dev = [
30
+ "build>=1.2.0",
31
+ "pytest>=8.0.0",
32
+ "pytest-asyncio>=0.23.0",
33
+ "twine>=5.0.0",
34
+ ]
35
+
36
+ [tool.setuptools]
37
+ package-dir = {"" = "src"}
38
+ include-package-data = true
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+ include = ["authsec_sdk*"]
43
+
44
+ [tool.setuptools.package-data]
45
+ authsec_sdk = ["spiffe_workload_api/api/*.proto"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from setuptools import setup
2
+
3
+ setup()
@@ -0,0 +1,54 @@
1
+ from .core import (
2
+ mcp_tool,
3
+ protected_by_AuthSec,
4
+ run_mcp_server_with_oauth,
5
+ ServiceAccessSDK,
6
+ ServiceAccessError,
7
+ configure_auth,
8
+ get_config,
9
+ is_configured,
10
+ load_config,
11
+ test_auth_service,
12
+ test_services
13
+ )
14
+
15
+ # Import CIBA SDK for voice clients and passwordless authentication
16
+ from .ciba_sdk import CIBAClient
17
+
18
+ # Import Delegation SDK for AI agent trust delegation
19
+ from .delegation_sdk import DelegationClient, DelegationError, DelegationTokenExpired, DelegationTokenNotFound
20
+
21
+ # Import standalone SPIFFE Workload API SDK
22
+ from .spiffe_workload_api import QuickStartSVID, WorkloadAPIClient
23
+
24
+ # Also import SDK Manager SPIRE integration (optional)
25
+ try:
26
+ from .spire_sdk import WorkloadSVID
27
+ except ImportError:
28
+ WorkloadSVID = None
29
+
30
+ __version__ = "4.2.0"
31
+ __all__ = [
32
+ # MCP Auth & Services
33
+ "protected_by_AuthSec",
34
+ "run_mcp_server_with_oauth",
35
+ "ServiceAccessSDK",
36
+ "ServiceAccessError",
37
+ "configure_auth",
38
+ "get_config",
39
+ "is_configured",
40
+ "load_config",
41
+ "test_auth_service",
42
+ "test_services",
43
+ # CIBA SDK for Voice Clients
44
+ "CIBAClient",
45
+ # Delegation SDK for AI Agent Trust Delegation
46
+ "DelegationClient",
47
+ "DelegationError",
48
+ "DelegationTokenExpired",
49
+ "DelegationTokenNotFound",
50
+ # SPIRE Workload Identity (Standalone SDK)
51
+ "QuickStartSVID",
52
+ "WorkloadAPIClient",
53
+ "WorkloadSVID",
54
+ ]