Skip to content

feat(config): add startup validation to fail fast on invalid secrets#90

Open
abdrassulov wants to merge 1 commit into
Grainlify:mainfrom
abdrassulov:feat/config-validation-hardening
Open

feat(config): add startup validation to fail fast on invalid secrets#90
abdrassulov wants to merge 1 commit into
Grainlify:mainfrom
abdrassulov:feat/config-validation-hardening

Conversation

@abdrassulov

Copy link
Copy Markdown

📌 Description

This PR implements fail-fast startup configuration validation for critical configuration secrets, preventing runtime failures and timing/parsing bugs later.

✅ Solution

  • Added a new method to the struct in .
  • Validates that and are present.
  • Validates that is valid base64 and decodes to exactly 32 bytes (required for AES-256-GCM OAuth token encryption at rest).
  • Validates that Soroban secrets (, , , contract IDs) are present and valid, including checking that is a valid Stellar secret key (starts with "S" and is 56 characters long).
  • Integrated the validation checks into and entrypoints.
  • Created a comprehensive unit test suite in covering all validation cases.

🧪 Test Results

All unit tests pass successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant