Badge service for .NET packages and CI/CD test results with secure authentication and performance optimizations.
BadgeSmith is a general-purpose, high-performance badge service that provides Shields.io-compatible endpoints for NuGet packages, GitHub packages, and CI/CD test results. Built with .NET 9 Native AOT for sub-100ms cold starts and designed for extensibility.
Successor to localstack-nuget-badge-lambda with 5-10x performance improvements and security features.
BadgeSmith badges itself using its own API:
π¦ LocalStack.NET Client v1.x
π¦ LocalStack.NET Client v2.x
- HMAC-SHA256 authentication with replay protection for test ingestion
- AWS Secrets Manager integration for credential management
- Nonce-based replay prevention using DynamoDB
- Organization-level access control with token type separation
- Native AOT compilation for ~50-100ms cold starts (vs 500ms+ traditional)
- DynamoDB with GSI for efficient latest-result queries
- Caching with ETag support and configurable TTL
- CloudFront-compatible with proper cache headers
- Multi-provider support: NuGet.org, GitHub Packages (extensible)
- Version filtering: NuGet VersionRange support (
>=1.0.0
,[6.0,8.0)
) - Platform-specific test badges: Linux, Windows, macOS
- Branch-aware: Handles complex branch names with URL encoding
# NuGet packages
GET /badges/packages/nuget/{package}[?version={range}&prerelease={bool}]
# GitHub packages
GET /badges/packages/github/{org}/{package}[?version={pattern}&prerelease={bool}]
# Display test badge
GET /badges/tests/{platform}/{owner}/{repo}/{branch}
# Test result ingestion (HMAC authenticated)
POST /tests/results/{platform}/{owner}/{repo}/{branch}
# Redirect to test results
GET /redirect/test-results/{platform}/{owner}/{repo}/{branch}
# NuGet package badge
https://api.localstackfor.net/badges/packages/nuget/Newtonsoft.Json
# GitHub package with version filtering
https://api.localstackfor.net/badges/packages/github/localstack-dotnet/localstack.client?version=(1.0,2.0)
# Test results for this repository
https://api.localstackfor.net/badges/tests/linux/localstack-dotnet/badge-smith/master
BadgeSmith is organized with feature-based architecture, optimized for AWS Lambda performance.
Request Flow:
Client β CloudFront β API Gateway β Lambda β DynamoDB/Secrets Manager
Key Technologies:
- .NET 9 Native AOT - Sub-100ms cold starts
- AWS Lambda - Serverless compute
- DynamoDB - NoSQL storage with GSI optimization
- Custom routing - High-performance request handling
For detailed architectural decisions, performance considerations, data design, and deployment strategies, see ARCHITECTURE.md.
<!-- Add to your README.md -->


# Clone and deploy
git clone https://github.com/localstack-dotnet/badge-smith.git
cd badge-smith/build
dotnet run --project BadgeSmith.CDK
# Start with .NET Aspire + LocalStack
dotnet run --project src/BadgeSmith.Host
Copy the reusable workflows to your repository:
cp -r .github/workflows/run-dotnet-tests/ your-repo/.github/workflows/
cp -r .github/workflows/update-test-badge/ your-repo/.github/workflows/
Then use in your workflow:
- name: Update test badge
uses: ./.github/workflows/update-test-badge
with:
platform: 'Linux'
test_passed: '${{ steps.test-results.outputs.passed }}'
test_failed: '${{ steps.test-results.outputs.failed }}'
test_skipped: '${{ steps.test-results.outputs.skipped }}'
hmac_secret: '${{ secrets.TESTDATASECRET }}'
api_domain: 'api.localstackfor.net'
While designed as a white-label solution, BadgeSmith was created to serve the LocalStack.NET organization badge requirements:
- NuGet package badges for LocalStack.NET client libraries, two track support (v1.x and v2.x)
- GitHub package badges for given repository, including pre-release versions
- Multi-repository test badges with platform-specific results
- Secure test result ingestion from CI/CD workflows
BadgeSmith demonstrates current .NET development practices:
.NET Aspire Integration
- Local development orchestration with service discovery
- Observability with structured logging
- Shared infrastructure between dev/prod environments
- AWS Lambda and API Gateway emulation for local development
- CDK stack provisioning from Aspire host
- AWS service emulation for local development
- Identical schemas between local and production
- Local testing capabilities
- Environment-agnostic infrastructure design
- Shared constructs between local and production for deployment consistency
- Type-safe infrastructure with .NET CDK
Contributions are welcome! The codebase includes:
- Static analysis with multiple analyzers
- Zero warnings policy for code quality
- Native AOT compatibility throughout
MIT License - see LICENSE file for details.
Built with β€οΈ by the LocalStack.NET organization