Embeddable auth server module for the pico ecosystem — JWT issuance, wallet login, JWKS endpoint
Project description
pico-server-auth
Embeddable auth server module for the pico-boot ecosystem.
Issues JWT tokens, handles wallet challenge-response login, and exposes JWKS — all compatible with pico-client-auth validation.
Two deployment modes
Embedded — add to any pico-boot app, auth runs in the same process. Auto-discovered — no need to list it in modules=[]:
container = init(modules=["myapp"], config=config)
# pico-server-auth endpoints are available automatically
Standalone — deploy as a separate auth service:
container = init(modules=[], config=config)
app = container.get(FastAPI)
# Other services point pico-client-auth to this service's /api/v1/auth/jwks
Scaffold a new project with pico-initializer — select pico-server-auth in the modules list.
Endpoints
GET /api/v1/auth/jwks JWKS public keys (pico-client-auth fetches this)
POST /api/v1/auth/challenge Request nonce for wallet login
POST /api/v1/auth/sign-in Verify wallet signature, issue JWT
POST /api/v1/auth/login Password login (admin bootstrap)
Wallet login flow
Client pico-server-auth
│ │
│ POST /api/v1/auth/challenge │
│ { address: "0x..." } │
│───────────────────────────>│
│ { challenge: "<nonce>" } │
│<───────────────────────────│
│ │
│ sign(nonce) with wallet │
│ │
│ POST /api/v1/auth/sign-in │
│ { address, public_key, │
│ signature, challenge, │
│ algorithm: "ML-DSA-65" } │
│───────────────────────────>│
│ { access_token, address } │
│<───────────────────────────│
Supported wallet algorithms
| Algorithm | Type | Library |
|---|---|---|
| ML-DSA-65 | Post-quantum lattice (FIPS 204) | cryptography |
| Ed25519 | Edwards curve | cryptography |
| secp256k1 | Elliptic curve (ECDSA) | cryptography |
Compatibility with pico-client-auth
Tokens issued by pico-server-auth are standard JWT (RS256). pico-client-auth validates them by fetching JWKS from the /api/v1/auth/jwks endpoint.
Same process: pico-client-auth discovers the JWKS endpoint automatically (same FastAPI app).
Separate processes: configure pico-client-auth to point to the server:
auth_client:
issuer: "http://auth-server:8100"
audience: "pico"
# JWKS fetched from http://auth-server:8100/api/v1/auth/jwks
Challenge store
By default, challenges are stored in memory with TTL expiry. For multi-instance deployments, register a custom ChallengeStore component:
@component
class RedisChallengeStore:
async def create(self, address: str) -> str: ...
async def validate(self, address: str, nonce: str) -> bool: ...
async def cleanup(self) -> int: ...
The in-memory default is replaced automatically via on_missing_selector.
Configuration
server_auth:
issuer: "http://localhost:8100"
audience: "pico"
algorithm: "RS256"
access_token_expire_minutes: 15
challenge_ttl_seconds: 60
supported_wallet_algorithms:
- "ML-DSA-65"
- "Ed25519"
- "secp256k1"
Stack
- pico-ioc — dependency injection
- pico-boot — auto-discovery
- pico-fastapi — controllers
- pico-client-auth — token validation
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pico_server_auth-0.1.1.tar.gz.
File metadata
- Download URL: pico_server_auth-0.1.1.tar.gz
- Upload date:
- Size: 39.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1435b960a85e7fe4081231246fd81c717fe3787a149bab8ddfb812bf0c97ac76
|
|
| MD5 |
9ec4ede108c6ea4218a343bdd568fad9
|
|
| BLAKE2b-256 |
84587e882d6839cafcb43beb6443377e9c15619c08f4c358a0c2b184e3374cf2
|
Provenance
The following attestation bundles were made for pico_server_auth-0.1.1.tar.gz:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-server-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_server_auth-0.1.1.tar.gz -
Subject digest:
1435b960a85e7fe4081231246fd81c717fe3787a149bab8ddfb812bf0c97ac76 - Sigstore transparency entry: 1191565100
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-server-auth@f227aa04d7317b22c2f0f7d3f2c639df87bdd994 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f227aa04d7317b22c2f0f7d3f2c639df87bdd994 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pico_server_auth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pico_server_auth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
524199b26df1b2396ac41965ebb6c172640392b7cd8e3f4c8fb4d05b6f595d37
|
|
| MD5 |
68778e9c52cd9f6ecabcb95b3cbf2ee9
|
|
| BLAKE2b-256 |
d0fa405a9eaa8ea3d787d743225ad5af58ff965aa5e732d269580dc0814b3503
|
Provenance
The following attestation bundles were made for pico_server_auth-0.1.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on dperezcabrera/pico-server-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_server_auth-0.1.1-py3-none-any.whl -
Subject digest:
524199b26df1b2396ac41965ebb6c172640392b7cd8e3f4c8fb4d05b6f595d37 - Sigstore transparency entry: 1191565104
- Sigstore integration time:
-
Permalink:
dperezcabrera/pico-server-auth@f227aa04d7317b22c2f0f7d3f2c639df87bdd994 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dperezcabrera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f227aa04d7317b22c2f0f7d3f2c639df87bdd994 -
Trigger Event:
release
-
Statement type: