Repository navigation
docs(templates): add API Service Stellar config validation examples - #281
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
templates/api-service/src/config.jswith field-specific validation for Stellar Horizon and RPC URLs, strict protocol enforcement (HTTPS required for remote endpoints; plain HTTP permitted only for localhost/127.0.0.1 development), embedded credentials rejection, non-empty network and host checks, and strict integer port boundary parsing.templates/api-service/test/config.test.jscovering accurate public Testnet defaults, valid custom HTTPS endpoints, localhost/loopback exceptions, clear URL validation errors, remote HTTP rejection, unsupported protocol rejection, user credential rejection, API port validation, non-empty network/host strings, and secret-free boundary guarantees.templates/api-service/.env.exampleandtemplates/api-service/README.mdwith official public Testnet defaults, an explicit local standalone development example (http://127.0.0.1:8000), clear startup validation rules, and security guidance against storing secrets.tests/api-service-template.test.tsto assert thattest/config.test.jsexists in generated projects and that the standalone network examples and validation rules are documented.Testing
node --test templates/api-service/test/*.test.js: 13/13 tests passed (10 inconfig.test.js+ 3 inserver.test.js).npm test -- tests/api-service-template.test.ts: Passed (verifiesnpm run checkandnpm testexecute cleanly in generated project output).Security
localhostand127.0.0.1development.src/stellar-client.js: does not accept, store, or expose signing secrets, seed phrases, or private keys.Closes #147
Fixes #147