Skip to content

feat(http): GET /messages/{messageId} 구현 시 인증 미들웨어 적용 #31

Description

@ppzxc

배경

PR #29에서 GET /inputs/{inputId}/messages/{messageId} 라우트를 501 Not Implemented placeholder로 교체함.

현재 핸들러에 인증 검사가 없어, 유효하지 않은 토큰으로도 501 응답을 받을 수 있음.

// 현재 (인증 없음)
r.Get("/messages/{messageId}", func(w http.ResponseWriter, r *http.Request) {
    writeError(w, r, http.StatusNotImplemented, "Not Implemented",
        "get message by ID is not yet implemented")
})

작업 내용

해당 엔드포인트 실제 구현 시 반드시 포함할 것:

  1. Bearer 토큰 검증 (tokenFromHeader + resolver.ValidateToken)
  2. 미인증 요청 → 401 반환 (다른 엔드포인트와 동일한 패턴)
  3. 인증 포함 테스트 케이스 추가

참고

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions