feat: Simplify User Onboarding by Auto-Generating Hedera Account, DID, and Keys via API #5795#6035
Open
gayanath8 wants to merge 4 commits intohashgraph:developfrom
Open
feat: Simplify User Onboarding by Auto-Generating Hedera Account, DID, and Keys via API #5795#6035gayanath8 wants to merge 4 commits intohashgraph:developfrom
gayanath8 wants to merge 4 commits intohashgraph:developfrom
Conversation
- Add new async onboard push endpoint - Add task endpoint to return the current status of an onboarding task - Add custom DTO for onboarding, extending existing DTOs - Update SUMMARY and documentation for new endpoint Signed-off-by: gayanath8 <gayanathr@xeptagon.com>
Add regex validation for Hedera account ID and key formats. Signed-off-by: Gayanath Ranasinghe <121780980+gayanath8@users.noreply.github.com>
- Fix accounts.ts duplicate imports and add Hedera account reuse check - Correct notifier lifecycle in ONBOARD_USER_ASYNC (start before startStep) and fix expectation 11→9 - Type payload as IOnboardingPayload, strip info/statuses from unauthenticated task endpoint, fix Swagger 202 decorator Signed-off-by: gayanath8 <gayanathr@xeptagon.com>
Signed-off-by: gayanath8 <gayanathr@xeptagon.com>
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.
Issue Labels
#5795
Requirements
Summary of Changes
POST /accounts/push/onboard— new async endpoint that accepts optional Hedera account, DID, and key fields; auto-generates any omitted values using the operator account. Returns ataskIdimmediately for polling.GET /tasks/onboard/{taskId}— new unauthenticated endpoint that returns onboarding task progress (sanitized — no credentials exposed). Only serves onboarding tasks; returns401for any other task type.OnboardingDTO— new DTO extendingRegisterUserDTOwith optional fields:hederaAccountId,hederaAccountKey,parent,vcDocument,didDocument,didKeys,useFireblocksSigning,fireblocksConfig. Includes format validation for Hedera account ID and key.TaskAction.ONBOARD_USER/MessageAPI.ONBOARD_USER_ASYNC— new enum values ininterfacesfor the async task pipeline.guardian-service— newONBOARD_USER_ASYNChandler inprofile.service.tsthat runs the full onboarding flow: creates Hedera account (if needed), registers user, publishes DID/VC, stores keys in vault, and returns credentials in the task result.GET /tasks/{taskId}endpoint.docs/guardian/users/user-operations/account-apis/unified-onboarding.mdand updateddocs/SUMMARY.md.Validation Rules
username— required, non-empty stringpassword— required, non-empty stringpassword_confirmation— required, must matchpasswordrole— required, must be one ofSTANDARD_REGISTRY,USERhederaAccountId— optional string, uniquehederaAccountKey— optional stringparent— optional stringdidDocument,vcDocument,didKeys— optional, typed objects/arrays401 UnauthorizedSTANDARD_REGISTRY(non-demo mode)403 ForbiddenhederaAccountKeyprovided buthederaAccountIdformat invalid (\d+.\d+.\d+)422 Unprocessable EntityhederaAccountIdprovided buthederaAccountKeyformat invalid (DER / raw hex)422 Unprocessable Entityrole = USERwith noparentprovided400 Bad Requestparentusername not found in system400 Bad Requestparentexists but is not aSTANDARD_REGISTRY400 Bad Request409 Conflict409 Conflict1. SR — auto Hedera, auto DID, with VC
2. SR — manual Hedera, auto DID, with VC
3. Default User — auto Hedera, with parent registry
Validations