Skip to content

test(identity): verify OAuth browser sessions over HTTP - #30

Merged
seonghobae merged 10 commits into
mainfrom
test/oauth-http-integration
Aug 3, 2026
Merged

test(identity): verify OAuth browser sessions over HTTP#30
seonghobae merged 10 commits into
mainfrom
test/oauth-http-integration

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the missing production-controller integration evidence for the Phase 1 identity capability.

  • starts an ephemeral NestJS server with the production OAuth controller
  • verifies Google start, callback, secure session issuance, introspection, replay rejection, logout, and revoked-session rejection
  • verifies GitHub cross-browser state rejection before provider access and successful completion from the bound browser
  • asserts fixed-origin redirects, secure cookie attributes, no-store responses, credential-free bodies, correlation IDs, and audit outcomes

Validation gate

Merge only when all exact-head CI, AppGuardrail, Semgrep, Security Scan, Commercial Readiness, CodeRabbit, and review requirements pass with no unresolved actionable findings.

Part of #18.

Summary by CodeRabbit

  • 테스트

    • Google·GitHub OAuth 로그인, 콜백, 세션 조회 및 로그아웃 흐름에 대한 통합 검증을 추가했습니다.
    • 재사용·폐기된 세션 거부, 브라우저 상태 검증, 쿠키 보안 속성, 감사 기록 및 상관관계 ID 전달을 확인합니다.
  • 문서

    • OAuth HTTP 통합 검증 범위와 품질 기준을 문서화했습니다.
  • 품질 개선

    • OAuth 관련 소스와 문서가 자동 형식 검사 대상에 포함되었습니다.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7e22b70-a5c7-4bde-bfae-e0222b0ed915

📥 Commits

Reviewing files that changed from the base of the PR and between b407864 and 6f848c2.

📒 Files selected for processing (1)
  • apps/identity-service/src/oauth-http.integration.test.ts
📝 Walkthrough

Walkthrough

Nest HTTP 애플리케이션을 사용하는 OAuth 통합 테스트를 추가했습니다. Google OAuth 세션 수명주기와 GitHub 브라우저 쿠키 바인딩을 검증합니다. 감사 이벤트, correlation ID, 보안 응답, 포맷 검사 대상도 추가했습니다.

Changes

OAuth HTTP 통합 검증

Layer / File(s) Summary
통합 테스트 하네스와 검사 설정
apps/identity-service/src/oauth-http.integration.test.ts, docs/superpowers/plans/..., package.json
인메모리 저장소, 모의 provider, 감사 이벤트 수집기와 Nest 애플리케이션 수명주기를 구성합니다. 관련 계획 문서를 추가하고 format:check 대상에 파일을 포함합니다.
Google OAuth 세션 수명주기
apps/identity-service/src/oauth-http.integration.test.ts
OAuth 시작 응답, 보안 쿠키, 캐시 제어, 세션 생성, 민감 정보 비노출, 콜백 재사용 거부, 로그아웃과 세션 폐기를 검증합니다.
GitHub 브라우저 상태 바인딩
apps/identity-service/src/oauth-http.integration.test.ts
잘못된 브라우저 쿠키를 사용한 콜백을 거부합니다. 올바른 쿠키를 사용하면 리디렉션, correlation ID, 성공 감사 이벤트를 검증합니다.

Estimated code review effort: 4 (Complex) | ~30 minutes

Possibly related issues

Possibly related PRs

  • ContextualWisdomLab/life-os#22 — 쿠키, 콜백, 세션, 로그아웃, 리디렉션 및 감사 처리를 도입한 OAuth 경계를 이 통합 테스트가 직접 검증합니다.
  • ContextualWisdomLab/life-os#24 — 이 통합 테스트가 해당 PR의 Google OIDC 클라이언트에 의존하는 Google 콜백 흐름을 실행합니다.
  • ContextualWisdomLab/life-os#28 — provider 콜백, 쿠키, correlation ID, 세션 및 감사 이벤트 동작을 이 통합 테스트가 직접 검증합니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 HTTP 환경에서 OAuth 브라우저 세션을 검증하는 통합 테스트 추가라는 주요 변경 사항을 명확하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/oauth-http-integration

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/identity-service/src/oauth-http.integration.test.ts (1)

127-134: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

@Module 데코레이터 구문 사용을 고려하십시오.

현재 코드는 Module({...})(OAuthHttpIntegrationModule) 형태로 데코레이터 팩토리 함수를 직접 호출합니다. NestJS의 Module 함수는 ClassDecorator를 반환하므로 @Module({...}) 구문과 동작이 동일합니다. 표준 데코레이터 구문을 사용하면 가독성이 향상됩니다.

♻️ 제안하는 리팩터링
-  class OAuthHttpIntegrationModule {}
-  Module({
-    controllers: [OAuthHttpController],
-    providers: [
-      { provide: OAUTH_HTTP_APPLICATION, useValue: httpApplication },
-      { provide: OAUTH_CALLBACK_APPLICATION, useValue: callbackApplication },
-    ],
-  })(OAuthHttpIntegrationModule);
+  `@Module`({
+    controllers: [OAuthHttpController],
+    providers: [
+      { provide: OAUTH_HTTP_APPLICATION, useValue: httpApplication },
+      { provide: OAUTH_CALLBACK_APPLICATION, useValue: callbackApplication },
+    ],
+  })
+  class OAuthHttpIntegrationModule {}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/identity-service/src/oauth-http.integration.test.ts` around lines 127 -
134, OAuthHttpIntegrationModule에 적용한 Module 데코레이터를 직접 호출하는 방식에서 표준
`@Module`({...}) 구문으로 변경하세요. OAuthHttpController와 기존 OAUTH_HTTP_APPLICATION 및
OAUTH_CALLBACK_APPLICATION provider 설정은 그대로 유지하고, 클래스 선언에 데코레이터를 직접 부착하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/identity-service/src/oauth-http.integration.test.ts`:
- Around line 1-296: oauth-http.integration.test.ts의 Prettier 서식을 맞추십시오. 특히
OAuth HTTP 통합 테스트 파일 전체를 Prettier로 포맷하고, 기존 테스트 동작은 변경하지 않은 채 format:check가
통과하도록 수정하십시오.

---

Nitpick comments:
In `@apps/identity-service/src/oauth-http.integration.test.ts`:
- Around line 127-134: OAuthHttpIntegrationModule에 적용한 Module 데코레이터를 직접 호출하는
방식에서 표준 `@Module`({...}) 구문으로 변경하세요. OAuthHttpController와 기존
OAUTH_HTTP_APPLICATION 및 OAUTH_CALLBACK_APPLICATION provider 설정은 그대로 유지하고, 클래스
선언에 데코레이터를 직접 부착하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 480d3330-662a-45d2-a1b7-dbbe762325f8

📥 Commits

Reviewing files that changed from the base of the PR and between f756266 and b407864.

📒 Files selected for processing (3)
  • apps/identity-service/src/oauth-http.integration.test.ts
  • docs/superpowers/plans/2026-08-03-oauth-http-integration-slice.md
  • package.json

Comment thread apps/identity-service/src/oauth-http.integration.test.ts
@seonghobae
seonghobae merged commit fc961a4 into main Aug 3, 2026
34 of 35 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.

1 participant