secretspec-derive 0.3.1

Derive macros for SecretSpec type-safe code generation
Documentation

SecretSpec Derive Macros

This crate provides procedural macros for the SecretSpec library, enabling compile-time generation of strongly-typed secret structs from secretspec.toml configuration files.

Overview

The macro system reads your secretspec.toml at compile time and generates:

  • A SecretSpec struct with all secrets as fields (union of all profiles)
  • A SecretSpecProfile enum with profile-specific structs
  • A Profile enum representing available profiles
  • Type-safe loading methods with automatic validation

Key Features

  • Compile-time validation: Invalid configurations are caught during compilation
  • Type safety: Secrets are accessed as struct fields, not strings
  • Profile awareness: Different types for different profiles (e.g., production vs development)
  • Builder pattern: Flexible configuration with method chaining
  • Environment integration: Automatic environment variable handling