agentonboard-sdk 0.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.
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+ with:
22
+ enable-cache: true
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ run: uv python install ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ uv venv --python ${{ matrix.python-version }}
30
+ uv pip install -e ".[dev]"
31
+
32
+ - name: Run Ruff Lint
33
+ run: uv run ruff check .
34
+
35
+ - name: Run Ruff Format Check
36
+ run: uv run ruff format --check .
37
+
38
+ - name: Run Type Check (mypy)
39
+ run: uv run mypy src/
40
+
41
+ - name: Run Test Suite
42
+ run: uv run pytest -v
@@ -0,0 +1,39 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ publish:
11
+ name: Build and publish to PyPI
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write # Required for PyPI Trusted Publishing
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+ with:
22
+ enable-cache: true
23
+
24
+ - name: Set up Python
25
+ run: uv python install 3.12
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ uv venv --python 3.12
30
+ uv pip install -e ".[dev]"
31
+
32
+ - name: Run Test Suite
33
+ run: uv run pytest -v
34
+
35
+ - name: Build distributions
36
+ run: uv build
37
+
38
+ - name: Publish to PyPI
39
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,32 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ develop-eggs/
8
+ dist/
9
+ downloads/
10
+ eggs/
11
+ .eggs/
12
+ lib/
13
+ lib64/
14
+ parts/
15
+ sdist/
16
+ var/
17
+ wheels/
18
+ share/python-wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+ .env
24
+ .venv
25
+ env/
26
+ venv/
27
+ ENV/
28
+ env.bak/
29
+ venv.bak/
30
+ .pytest_cache/
31
+ .mypy_cache/
32
+ .ruff_cache/
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.5
2
+ Name: agentonboard-sdk
3
+ Version: 0.1.0
4
+ Summary: Universal identity layer for AI agents — Python Partner SDK for token verification and account creation
5
+ Author-email: AgentOnboard <hello@agentonboard.xyz>
6
+ License-Expression: MIT
7
+ Keywords: agentonboard,ai-agents,authentication,fastapi,flask,identity,jwt
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Security
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: httpx>=0.25.0
21
+ Requires-Dist: pyjwt[crypto]>=2.8.0
22
+ Provides-Extra: all
23
+ Requires-Dist: fastapi>=0.100.0; extra == 'all'
24
+ Requires-Dist: flask>=2.0.0; extra == 'all'
25
+ Requires-Dist: starlette>=0.27.0; extra == 'all'
26
+ Provides-Extra: dev
27
+ Requires-Dist: cryptography>=42.0.0; extra == 'dev'
28
+ Requires-Dist: fastapi>=0.100.0; extra == 'dev'
29
+ Requires-Dist: flask>=2.0.0; extra == 'dev'
30
+ Requires-Dist: mypy>=1.9.0; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
32
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
34
+ Provides-Extra: fastapi
35
+ Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
36
+ Requires-Dist: starlette>=0.27.0; extra == 'fastapi'
37
+ Provides-Extra: flask
38
+ Requires-Dist: flask>=2.0.0; extra == 'flask'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # agentonboard-sdk (Python Partner SDK)
42
+
43
+ The Python partner SDK for [AgentOnboard](https://agentonboard.xyz) — verify ephemeral agent session tokens and safely resolve or provision partner accounts.
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install agentonboard-sdk
49
+ ```
50
+
51
+ Optional framework shortcuts:
52
+ ```bash
53
+ pip install "agentonboard-sdk[fastapi]"
54
+ pip install "agentonboard-sdk[flask]"
55
+ ```
56
+
57
+ ## Quickstart
58
+
59
+ ### Verify an Agent Token
60
+
61
+ ```python
62
+ from agentonboard import verify_agent_token
63
+
64
+ result = verify_agent_token(
65
+ token=bearer_token,
66
+ audience="notes.com",
67
+ )
68
+
69
+ if not result.ok:
70
+ print(f"Auth failed: {result.code} - {result.error}")
71
+ else:
72
+ print(f"Authenticated human: {result.email}")
73
+ ```
74
+
75
+ ### Async Verification
76
+
77
+ ```python
78
+ from agentonboard import verify_agent_token_async
79
+
80
+ result = await verify_agent_token_async(
81
+ token=bearer_token,
82
+ audience="notes.com",
83
+ )
84
+ ```
85
+
86
+ ### Account Resolution & Provisioning
87
+
88
+ ```python
89
+ from agentonboard import verify_agent_account, create_agent_account, AgentIdentity
90
+
91
+ def find_user_by_email(identity: AgentIdentity):
92
+ return db.query(User).filter(User.email == identity.email).first()
93
+
94
+ def create_user_for_agent(identity: AgentIdentity):
95
+ return db.create_user(email=identity.email)
96
+
97
+ # Read-only verification
98
+ outcome = verify_agent_account(
99
+ token=bearer_token,
100
+ audience="notes.com",
101
+ resolver=find_user_by_email,
102
+ )
103
+
104
+ # Provisioning if account doesn't exist
105
+ outcome = create_agent_account(
106
+ token=bearer_token,
107
+ audience="notes.com",
108
+ resolver=find_user_by_email,
109
+ creator=create_user_for_agent,
110
+ )
111
+ ```
@@ -0,0 +1,71 @@
1
+ # agentonboard-sdk (Python Partner SDK)
2
+
3
+ The Python partner SDK for [AgentOnboard](https://agentonboard.xyz) — verify ephemeral agent session tokens and safely resolve or provision partner accounts.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install agentonboard-sdk
9
+ ```
10
+
11
+ Optional framework shortcuts:
12
+ ```bash
13
+ pip install "agentonboard-sdk[fastapi]"
14
+ pip install "agentonboard-sdk[flask]"
15
+ ```
16
+
17
+ ## Quickstart
18
+
19
+ ### Verify an Agent Token
20
+
21
+ ```python
22
+ from agentonboard import verify_agent_token
23
+
24
+ result = verify_agent_token(
25
+ token=bearer_token,
26
+ audience="notes.com",
27
+ )
28
+
29
+ if not result.ok:
30
+ print(f"Auth failed: {result.code} - {result.error}")
31
+ else:
32
+ print(f"Authenticated human: {result.email}")
33
+ ```
34
+
35
+ ### Async Verification
36
+
37
+ ```python
38
+ from agentonboard import verify_agent_token_async
39
+
40
+ result = await verify_agent_token_async(
41
+ token=bearer_token,
42
+ audience="notes.com",
43
+ )
44
+ ```
45
+
46
+ ### Account Resolution & Provisioning
47
+
48
+ ```python
49
+ from agentonboard import verify_agent_account, create_agent_account, AgentIdentity
50
+
51
+ def find_user_by_email(identity: AgentIdentity):
52
+ return db.query(User).filter(User.email == identity.email).first()
53
+
54
+ def create_user_for_agent(identity: AgentIdentity):
55
+ return db.create_user(email=identity.email)
56
+
57
+ # Read-only verification
58
+ outcome = verify_agent_account(
59
+ token=bearer_token,
60
+ audience="notes.com",
61
+ resolver=find_user_by_email,
62
+ )
63
+
64
+ # Provisioning if account doesn't exist
65
+ outcome = create_agent_account(
66
+ token=bearer_token,
67
+ audience="notes.com",
68
+ resolver=find_user_by_email,
69
+ creator=create_user_for_agent,
70
+ )
71
+ ```
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "agentonboard-sdk"
7
+ version = "0.1.0"
8
+ description = "Universal identity layer for AI agents — Python Partner SDK for token verification and account creation"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "AgentOnboard", email = "hello@agentonboard.xyz" }
14
+ ]
15
+ keywords = ["agentonboard", "ai-agents", "authentication", "identity", "jwt", "fastapi", "flask"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ "Topic :: Security",
27
+ "Typing :: Typed",
28
+ ]
29
+ dependencies = [
30
+ "httpx>=0.25.0",
31
+ "pyjwt[crypto]>=2.8.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ fastapi = [
36
+ "fastapi>=0.100.0",
37
+ "starlette>=0.27.0",
38
+ ]
39
+ flask = [
40
+ "flask>=2.0.0",
41
+ ]
42
+ all = [
43
+ "agentonboard-sdk[fastapi,flask]",
44
+ ]
45
+ dev = [
46
+ "pytest>=8.0.0",
47
+ "pytest-asyncio>=0.23.0",
48
+ "ruff>=0.4.0",
49
+ "mypy>=1.9.0",
50
+ "cryptography>=42.0.0",
51
+ "fastapi>=0.100.0",
52
+ "flask>=2.0.0",
53
+ ]
54
+
55
+ [tool.hatch.build.targets.wheel]
56
+ packages = ["src/agentonboard"]
57
+
58
+ [tool.pytest.ini_options]
59
+ asyncio_mode = "auto"
60
+ asyncio_default_fixture_loop_scope = "function"
61
+ testpaths = ["tests"]
62
+
63
+ [tool.ruff]
64
+ line-length = 100
65
+ target-version = "py310"
66
+
67
+ [tool.ruff.lint]
68
+ select = ["E", "F", "I", "UP", "B"]
69
+ ignore = [
70
+ "B008", # FastAPI Depends in parameter defaults is idiomatic
71
+ "E501", # Line length handled by formatter
72
+ ]
73
+
74
+ [tool.mypy]
75
+ python_version = "3.10"
76
+ strict = true
77
+ warn_return_any = true
78
+ warn_unused_configs = true
79
+ disallow_untyped_defs = true
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Syncs or checks agent-token-v1.json fixture against the canonical AgentOnboard repo.
4
+ """
5
+
6
+ import hashlib
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ CANONICAL_PATH = Path(__file__).resolve().parent.parent.parent / "agentonboard" / "packages" / "sdk" / "vectors" / "agent-token-v1.json"
11
+ LOCAL_FIXTURE_PATH = Path(__file__).resolve().parent.parent / "tests" / "fixtures" / "agent-token-v1.json"
12
+
13
+
14
+ def sha256_of(p: Path) -> str:
15
+ return hashlib.sha256(p.read_bytes()).hexdigest()
16
+
17
+
18
+ def main():
19
+ if not CANONICAL_PATH.exists():
20
+ print(f"Canonical file not found at {CANONICAL_PATH}; skipping sync check.")
21
+ return 0
22
+
23
+ local_hash = sha256_of(LOCAL_FIXTURE_PATH)
24
+ canonical_hash = sha256_of(CANONICAL_PATH)
25
+
26
+ if local_hash == canonical_hash:
27
+ print("agent-token-v1.json is in sync with canonical repository.")
28
+ return 0
29
+
30
+ if "--check" in sys.argv:
31
+ print(f"ERROR: Local fixture {LOCAL_FIXTURE_PATH} differs from {CANONICAL_PATH}!", file=sys.stderr)
32
+ return 1
33
+
34
+ LOCAL_FIXTURE_PATH.write_bytes(CANONICAL_PATH.read_bytes())
35
+ print("Updated local agent-token-v1.json from canonical source.")
36
+ return 0
37
+
38
+
39
+ if __name__ == "__main__":
40
+ sys.exit(main())
@@ -0,0 +1,60 @@
1
+ """
2
+ AgentOnboard Python SDK — Universal identity layer for AI agents.
3
+ """
4
+
5
+ from agentonboard.account import (
6
+ AccountCreator,
7
+ AccountOutcome,
8
+ AccountResolver,
9
+ AgentIdentity,
10
+ AsyncAccountCreator,
11
+ AsyncAccountResolver,
12
+ create_agent_account,
13
+ create_agent_account_async,
14
+ normalize_email,
15
+ verify_agent_account,
16
+ verify_agent_account_async,
17
+ )
18
+ from agentonboard.codes import (
19
+ ACCOUNT_ERROR_DESCRIPTIONS,
20
+ VERIFY_ERROR_DESCRIPTIONS,
21
+ AccountErrorCode,
22
+ VerifyErrorCode,
23
+ status_from_code,
24
+ )
25
+ from agentonboard.verify import (
26
+ DEFAULT_CLOCK_TOLERANCE_SECONDS,
27
+ Verifier,
28
+ VerifyAgentTokenResult,
29
+ normalize_audience,
30
+ verify_agent_token,
31
+ verify_agent_token_async,
32
+ )
33
+
34
+ __version__ = "0.1.0"
35
+
36
+ __all__ = [
37
+ "ACCOUNT_ERROR_DESCRIPTIONS",
38
+ "AccountCreator",
39
+ "AccountErrorCode",
40
+ "AccountOutcome",
41
+ "AccountResolver",
42
+ "AgentIdentity",
43
+ "AsyncAccountCreator",
44
+ "AsyncAccountResolver",
45
+ "DEFAULT_CLOCK_TOLERANCE_SECONDS",
46
+ "VERIFY_ERROR_DESCRIPTIONS",
47
+ "Verifier",
48
+ "VerifyAgentTokenResult",
49
+ "VerifyErrorCode",
50
+ "__version__",
51
+ "create_agent_account",
52
+ "create_agent_account_async",
53
+ "normalize_audience",
54
+ "normalize_email",
55
+ "status_from_code",
56
+ "verify_agent_account",
57
+ "verify_agent_account_async",
58
+ "verify_agent_token",
59
+ "verify_agent_token_async",
60
+ ]