# yaml-language-server: $schema=./Secretfile.schema.json
# Secretfile.test.yml
# Test configuration using localstack for local development and testing
# Updated: Feb 2026

version: '1.0'

variables:
  aws_region: us-east-1
  aws_endpoint: http://localhost:4566
  environment: test

metadata:
  project: secretzero-test
  owner: development
  environments:
    - test
  description: Local testing configuration using LocalStack

providers:
  aws:
    kind: aws
    auth:
      kind: static
      config:
        access_key_id: test
        secret_access_key: test
        region: "{{var.aws_region}}"
        endpoint_url: "{{var.aws_endpoint}}"

secrets:
  # Test database password
  - name: test_db_password
    description: Random password for test database stored in localstack SSM
    kind: random_password
    config:
      length: 32
      special: true
      uppercase: true
      lowercase: true
      digits: true
      exclude_characters: '"@/\`'
    targets:
      - provider: aws
        kind: ssm_parameter
        config:
          name: /test/database/password
          type: SecureString
          overwrite: true
          region: "{{var.aws_region}}"
          endpoint_url: "{{var.aws_endpoint}}"

  # Test API key
  - name: test_api_key
    description: Random API key for testing
    kind: random_string
    config:
      length: 48
      charset: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    targets:
      - provider: aws
        kind: ssm_parameter
        config:
          name: /test/api/key
          type: SecureString
          overwrite: true
          region: "{{var.aws_region}}"
          endpoint_url: "{{var.aws_endpoint}}"

  - name: more_secure_api_key
    description: Random API key for testing into Secrets Manager
    kind: random_string
    config:
      length: 48
      charset: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    targets:
      - provider: aws
        kind: secrets_manager
        config:
          name: /test/api/key
          description: Random API key for testing
          overwrite: true
          region: "{{var.aws_region}}"
          endpoint_url: "{{var.aws_endpoint}}"
  # Test secret for Secrets Manager
  - name: test_secret_json
    description: JSON secret stored in LocalStack Secrets Manager
    kind: random_password
    config:
      length: 24
      special: true
    targets:
      - provider: aws
        kind: secrets_manager
        config:
          name: test/json-secret
          description: Test secret stored in LocalStack Secrets Manager
          region: "{{var.aws_region}}"
          endpoint_url: "{{var.aws_endpoint}}"
      - provider: local
        kind: file
        config:
          path: ./local_secret.json
          format: json