Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a new DID generation API following the W3C standard for peer DIDs (numalgo 2) and includes utility classes for key generation, DID creation, and validation.
- Introduces the DID generation service (DidService) using Ed25519 key pairs.
- Implements peer DID utilities and validations through PeerDidUtil and PeerDidValidator.
- Updates the API controller and DTOs to support the new DID creation endpoint.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/doubleo/didagent/service/DidService.java | Adds service logic to generate a peer DID with key generation. |
| src/main/java/com/doubleo/didagent/global/util/PeerDidValidator.java | Implements validation for peer DID format. |
| src/main/java/com/doubleo/didagent/global/util/PeerDidUtil.java | Provides utility for constructing peer DIDs. |
| src/main/java/com/doubleo/didagent/global/util/KeyMaterial.java | Defines a record to encapsulate key material. |
| src/main/java/com/doubleo/didagent/global/util/Ed25519KeyGenerator.java | Generates Ed25519 keys and formats them for use in DIDs. |
| src/main/java/com/doubleo/didagent/global/exception/errorcode/DIDErrorCode.java | Updates the error code message for malformed DIDs. |
| src/main/java/com/doubleo/didagent/dto/response/DidCreateResponse.java | Updates the response DTO for DID creation. |
| src/main/java/com/doubleo/didagent/dto/request/DidCreateRequest.java | Introduces a new request DTO for creating DIDs. |
| src/main/java/com/doubleo/didagent/controller/DidController.java | Wires the new DID generation service into the API endpoint. |
| did-agent | Updates subproject commit reference. |
| try { | ||
| return Ed25519KeyGenerator.generate(); | ||
| } catch (Exception e) { | ||
| throw new RuntimeException(e); |
There was a problem hiding this comment.
Consider throwing a CommonException instead of RuntimeException to align the exception type thrown with the method's signature and ensure consistent error handling.
There was a problem hiding this comment.
P3: CommonException으로 변경하면 좋을 거 같습니다.
midday2612
reviewed
May 30, 2025
| try { | ||
| return Ed25519KeyGenerator.generate(); | ||
| } catch (Exception e) { | ||
| throw new RuntimeException(e); |
There was a problem hiding this comment.
P3: CommonException으로 변경하면 좋을 거 같습니다.
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.
🔷 Jira Ticket ID
KW-536
📌 작업 내용 및 특이사항
📚 참고사항