Skip to content

[KW-536] feat: did 발급 로직 개발#5

Merged
willjsw merged 8 commits intodevelopfrom
KW-536/feat/did-create-api
Jun 4, 2025
Merged

[KW-536] feat: did 발급 로직 개발#5
willjsw merged 8 commits intodevelopfrom
KW-536/feat/did-create-api

Conversation

@willjsw
Copy link
Contributor

@willjsw willjsw commented May 30, 2025

🔷 Jira Ticket ID

KW-536


📌 작업 내용 및 특이사항

  • DID 생성 API 개발 완료
  • 공개키/비밀키 생성
  • W3C 표준 규격 peer did 생성 로직 작성(numalgo 2)
  • Credo에서 넘어온 Routingkey & Service endpoint 반환
  • did/pubkey/privkey 반환(credo에서 사용)

📚 참고사항

@willjsw willjsw self-assigned this May 30, 2025
@github-actions github-actions bot changed the title KW-536/feat: did 발급 로직 개발 [KW-536] feat: did 발급 로직 개발 May 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider throwing a CommonException instead of RuntimeException to align the exception type thrown with the method's signature and ensure consistent error handling.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: CommonException으로 변경하면 좋을 거 같습니다.

Copy link

@midday2612 midday2612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

도움이 되지 못해.. 죄송합니다......

try {
return Ed25519KeyGenerator.generate();
} catch (Exception e) {
throw new RuntimeException(e);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: CommonException으로 변경하면 좋을 거 같습니다.

Copy link

@midday2612 midday2612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다~

@midday2612 midday2612 self-requested a review May 30, 2025 08:22
@willjsw willjsw merged commit 2839c4e into develop Jun 4, 2025
1 check 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.

3 participants