Skip to content

Validate Stellar DID/address format and remove hardcoded default recipient#15

Merged
DanielCotoJ merged 1 commit into
ACTA-Team:mainfrom
Kingvic300:fix/credential-did-validation
Jun 29, 2026
Merged

Validate Stellar DID/address format and remove hardcoded default recipient#15
DanielCotoJ merged 1 commit into
ACTA-Team:mainfrom
Kingvic300:fix/credential-did-validation

Conversation

@Kingvic300

Copy link
Copy Markdown

Summary

  • Adds isStellarAddress / isStellarTestnetDid validators in src/lib/validation.ts.
  • Removes the hardcoded default subjectDid Stellar address from the credential form's initial state (still available via the existing "Fill Example" button and input placeholder).
  • Rejects malformed Subject DIDs in handleCreate with a clear toast error before reaching the SDK.
  • makeDidForAddress now validates the address and returns null instead of building a malformed DID.
  • Adds inline red helper text and aria-invalid on the Subject DID input when the value doesn't match the expected format.

Fixes #11.

Test plan

  • Submit with an empty Subject DID → blocked with existing "fill all fields" message.
  • Submit with did:pkh:stellar:testnet:invalid → blocked with new "Invalid Subject DID format" message.
  • Submit with a valid testnet DID → proceeds to SDK call.
  • Confirm the Subject DID field is empty by default (no longer pre-filled with a real address).

…ecipient

Subject DID input only checked for non-empty values and the form shipped
with a real hardcoded Stellar address as the default recipient, risking
credentials being issued to the wrong holder.
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Kingvic300 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a92c3788-5f5d-4fea-94b0-0df44803eb73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DanielCotoJ DanielCotoJ merged commit 1d7364d into ACTA-Team:main Jun 29, 2026
4 checks passed
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.

2 participants