Crates.io | atproto-xrpcs-helloworld |
lib.rs | atproto-xrpcs-helloworld |
version | 0.11.2 |
created_at | 2025-06-08 20:20:20.033855+00 |
updated_at | 2025-08-20 18:55:50.824451+00 |
description | Complete example implementation of an AT Protocol XRPC service with DID web functionality and JWT authentication |
homepage | |
repository | https://tangled.sh/@smokesignal.events/atproto-identity-rs |
max_upload_size | |
id | 1705237 |
size | 94,043 |
Example XRPC service with DID:web identity and JWT authentication.
Complete AT Protocol XRPC service demonstrating DID:web identity, service document generation, well-known endpoints, and JWT-based authentication patterns.
The following service binary is available:
atproto-xrpcs-helloworld
: Complete XRPC service demonstrating AT Protocol patterns with DID:web identity and optional JWT authenticationThe service provides these endpoints:
GET /
- HTML hello world pageGET /.well-known/did.json
- DID web documentGET /.well-known/atproto-did
- AT Protocol DID discoveryGET /xrpc/garden.lexicon.ngerakines.helloworld.Hello
- Example XRPC endpoint# Required
export EXTERNAL_BASE=your-service.com
export SERVICE_KEY=did:key:zQ3sh...
# Optional
export PLC_HOSTNAME=plc.directory
export DNS_NAMESERVERS=8.8.8.8;1.1.1.1
export USER_AGENT="my-xrpc-service/1.0"
# Unauthenticated request
curl "http://localhost:8080/xrpc/garden.lexicon.ngerakines.helloworld.Hello?subject=World"
# Response: {"message": "Hello, World!"}
# Authenticated request
curl -H "Authorization: Bearer <jwt-token>" \
"http://localhost:8080/xrpc/garden.lexicon.ngerakines.helloworld.Hello?subject=Alice"
# Response: {"message": "Hello, authenticated Alice!"}
# Start the service
cargo run --bin atproto-xrpcs-helloworld
# Test endpoints
curl http://localhost:8080/
curl http://localhost:8080/.well-known/did.json
curl "http://localhost:8080/xrpc/garden.lexicon.ngerakines.helloworld.Hello?subject=Test"
This example service is ideal for:
MIT License