diff --git a/README.md b/README.md index 113cd8a6..83deef35 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ KETO_WRITE_URL = "http://keto:4467" - Makefile 타깃: - `make code-check-userfront-e2e-tests` - 전수 인벤토리: - - `docs/test-plan/userfront-wasm-e2e-route-inventory.md` + - `https://gitea.hmac.kr/baron/baron-sso/wiki/UserFront-WASM-E2E-Inventory.-` ### 로컬 개발 (Manual) Docker 없이는 개발할 수 없지만 Backend 및 [user/admin/dev]Front 코드는 개발모드로 수정하며 개발가능. diff --git a/docs/AGENTS.md b/docs/AGENTS.md index 00565a0e..61701da9 100644 --- a/docs/AGENTS.md +++ b/docs/AGENTS.md @@ -33,11 +33,11 @@ - `IDP_PROVIDER` Ory 전용 저장 구조지만 향후 마이그레이션으로 추가 스택 지원할 수 있음 - `sessionJwt`는 **JWT가 아닐 수 있음** (Kratos session token은 opaque 가능) - OIDC Consent 플로우는 UserFront의 `/consent` 경로에서 처리 -- 토큰/쿠키 전달 방식 변경 시 `docs/auth-flow.md`를 반드시 갱신 +- 토큰/쿠키 전달 방식 변경 시 `https://gitea.hmac.kr/baron/baron-sso/wiki/Authentication-and-Login-Flow.-`를 반드시 갱신 ## 작업 체크리스트 - 인증/로그인 변경 시 - - `docs/auth-flow.md` 업데이트 + - `https://gitea.hmac.kr/baron/baron-sso/wiki/Authentication-and-Login-Flow.-` 업데이트 - 세션/쿠키/Authorization 전달 방식 영향도 점검 - UserFront가 Ory/Oathkeeper 직접 호출하지 않도록 확인 @@ -63,4 +63,4 @@ - 민감정보 마스킹은 환경과 무관하게 항상 적용 ## 테스트 참고 -- 테스트 계획 및 수동 실행 기준은 `docs/test-plan.md`를 따른다. +- 테스트 계획 및 수동 실행 기준은 `https://gitea.hmac.kr/baron/baron-sso/wiki/Test-Plan-and-Principles.-`를 따른다. diff --git a/docs/auth-flow.md b/docs/auth-flow.md deleted file mode 100644 index 76d9dad5..00000000 --- a/docs/auth-flow.md +++ /dev/null @@ -1,113 +0,0 @@ -# 인증/로그인 플로우 정리 (Backend IDP 추상화 기준) - -이 문서는 **Backend IDP 추상화(IdentityProvider)**를 기준으로, 현재 지원하는 로그인 방식과 UserFront 연동 API, 그리고 **Kratos 세션 공유 방식**을 정리합니다. - -> 목적: ID/Password 방식부터 시작해, 현재 지원 중인 로그인 플로우를 **IDP 추상화를 해치지 않는 범위**에서 일관되게 구현하고, Front/Backend/Oathkeeper 간 세션 전달 방식을 명확히 한다. - ---- - -## 1) 지원 로그인 방식 요약 - -| 방식 | Backend 엔드포인트 | 세션 토큰 반환 | 비고 | -|---|---|---|---| -| ID/Password | `POST /api/v1/auth/password/login` | `sessionJwt` | IDP 추상화 사용 (Ory/Descope) | -| Enchanted Link (Email/SMS) | `POST /api/v1/auth/enchanted-link/init` → `POST /api/v1/auth/enchanted-link/poll` | `sessionJwt` | Ory는 `/api/v1/auth/login/code/verify`/`verify-short`(verifyOnly) 사용 | -| Magic Link Verify | `POST /api/v1/auth/magic-link/verify` | `token` | 비-Ory 경로(verifyOnly 가능) | -| SMS 코드 | `POST /api/v1/auth/sms` → `POST /api/v1/auth/verify-sms` | `token` | 현재는 내부 토큰(placeholder). Kratos 세션 교환 필요 | -| QR 로그인 | `POST /api/v1/auth/qr/init` → `POST /api/v1/auth/qr/poll` | `sessionJwt` | 모바일 승인: `POST /api/v1/auth/qr/approve` | - ---- - -## 2) UserFront 연동 API 매핑 - -### 2.1 ID/Password 로그인 -1. `POST /api/v1/auth/password/login` -2. 응답의 `sessionJwt` 사용 - -### 2.2 Enchanted Link (Email/SMS) -1. `POST /api/v1/auth/enchanted-link/init` → `pendingRef` 수신 -2. `POST /api/v1/auth/enchanted-link/poll`로 폴링 -3. 사용자가 링크 클릭하면 UserFront가 아래 중 하나 호출 - - Ory: `POST /api/v1/auth/login/code/verify` 또는 `/api/v1/auth/login/code/verify-short` (verifyOnly=1) - - 비-Ory: `POST /api/v1/auth/magic-link/verify` (verifyOnly=1) -4. Polling 응답에서 `sessionJwt` 수신 (승인 후 Backend에서 세션 발급) - -### 2.3 QR 로그인 -1. `POST /api/v1/auth/qr/init` → `qrCode`, `pendingRef` 수신 -2. 웹은 `POST /api/v1/auth/qr/poll`로 폴링 -3. 모바일 앱은 `POST /api/v1/auth/qr/approve`로 승인 (모바일 세션 토큰은 승인 검증용) -4. Polling 응답에서 `sessionJwt` 수신 - -### 2.4 SMS 코드 로그인 -1. `POST /api/v1/auth/sms`로 코드 발송 -2. `POST /api/v1/auth/verify-sms`로 코드 검증 -3. 현재는 내부 토큰 반환 (IDP 세션 교환은 TODO) - ---- - -## 3) Kratos 세션 생성/공유 방식 - -### 3.1 생성 (ID/Password 기준) -- Backend가 IDP 추상화(`IdentityProvider.SignIn`)를 호출해 `sessionJwt`를 발급 -- **Ory(Kratos)**의 경우: - - Kratos Login API를 통해 `session_token`을 반환 - - 이 값이 `sessionJwt`로 응답됨 - -### 3.2 공유 (Backend → UserFront / Oathkeeper) -현재 공유 방식은 **두 가지 선택지**가 있습니다. - -**A) Backend가 쿠키로 전달 (권장 방향)** -- `sessionJwt`가 Kratos `session_token`인 경우 `ory_kratos_session` 쿠키로 `Set-Cookie` -- Oathkeeper `cookie_session` authenticator가 Kratos `/sessions/whoami`로 검증 가능 - -**B) UserFront가 토큰을 보관/전달 (현재 동작)** -- `sessionJwt`를 로컬에 저장 후 Backend 호출 시 `Authorization: Bearer `로 전달 -- Oathkeeper 경유 경로에서는 쿠키가 필요하므로, 별도 토큰 교환 또는 Oathkeeper 인증기 추가가 필요 - -> 현재 구현은 **B 방식에 가깝고**, Oathkeeper 통과를 위한 쿠키 전달은 추가 구현이 필요합니다. - ---- - -## 4) IDP 추상화 관점에서의 구현 상태 - -- **ID/Password 로그인**: IDP 추상화 사용 (Ory/Descope) — 정상 -- **Enchanted/Magic Link**: 현재는 Descope 기반 로직이 포함됨. Ory 전환 시 Kratos `code/link` 플로우로 교체 필요 -- **SMS 코드**: 내부 토큰(placeholder). Kratos 세션 교환 로직 추가 필요 -- **QR 로그인**: 모바일 세션 토큰은 승인 검증용으로만 사용하고, 백엔드에서 웹 전용 세션을 새로 발급 - ---- - -## 5) 링크 로그인 ↔ QR 로그인 공유/분리 로직 - -### 5.1 공유되는 로직 (공통 기반) -- **IDP 코드 검증 로직 공유**: Ory 기준으로 링크 로그인과 QR 로그인 모두 `VerifyLoginCode`(코드 기반 로그인 검증)를 사용합니다. -- **Kratos courier relay 공유**: Kratos에서 발송되는 `login_code`를 `HandleKratosCourierRelay`에서 처리하며, 링크/QR 모두 이 경로를 거칩니다. -- **코드/플로우 상태 저장**: 코드 로그인 플로우의 `flow_id`는 공통 키(`prefixLoginCode`)에 저장됩니다. - -### 5.2 분리되는 로직 (pendingRef/승인 경로) -- **pendingRef 네임스페이스 분리**: - - 링크 로그인: `prefixSession`, `prefixLoginCodePending`, `prefixLoginMethod`, `prefixLoginFlow` - - QR 로그인: `prefixLoginCodeQrPending`, `prefixLoginCodeQr`, `prefixQrPending`, `prefixQrMeta`, `prefixQrApproverSession` -- **승인 엔드포인트 분리**: - - 링크 로그인: `/api/v1/auth/magic-link/verify` 또는 `/api/v1/auth/login/code/verify*` (verify-only) - - QR 로그인: `/api/v1/auth/qr/approve` -- **세션 발급 주체 분리**: - - 링크 로그인: Polling(요청 기기 A)에서 세션 발급 - - QR 로그인: Polling(웹)에서 세션 발급, 모바일은 승인만 수행 -- **audit 기록 경로 분리**: - - 링크 로그인: `writeLinkAuditLog` - - QR 로그인: `writeQrAuditLog` - -### 5.3 verify-only 적용 범위 -- 링크 로그인/코드 로그인 경로에만 적용됩니다. -- QR 로그인은 approve/poll 구조이므로 verify-only를 사용하지 않습니다. - ---- - -## 6) UserFront 주의사항 - -- `sessionJwt`가 **JWT 형식이 아닐 수 있음** (Kratos session token은 opaque 가능) -- 현재 UserFront는 Descope SDK 기반 세션 처리 로직을 제거했으니 남아 있다면 제거 대상임. 즉시 사용자에게 알리고 이슈로 생성 바람. - -참고. -- AdminFront, DevFront는 JWT 방식으로 RP중 하나인 것 처럼 동작시키는 설계. 따라서 JWT에 대한 대응도 내부적으로는 완벽히 진행해야 함. diff --git a/docs/auto-login-policy-p0-mobile-installed-webapp.md b/docs/auto-login-policy-p0-mobile-installed-webapp.md index 2fa56abc..605fca21 100644 --- a/docs/auto-login-policy-p0-mobile-installed-webapp.md +++ b/docs/auto-login-policy-p0-mobile-installed-webapp.md @@ -74,6 +74,6 @@ ## 8. 관련 문서 - `docs/AGENTS.md` -- `docs/auth-flow.md` +- `https://gitea.hmac.kr/baron/baron-sso/wiki/Authentication-and-Login-Flow.-` - `docs/consent_loop_fix_report.md` -- `docs/test-plan.md` +- `https://gitea.hmac.kr/baron/baron-sso/wiki/Test-Plan-and-Principles.-` diff --git a/docs/ory-usage.md b/docs/ory-usage.md index e82c702d..e0c6d37f 100644 --- a/docs/ory-usage.md +++ b/docs/ory-usage.md @@ -105,4 +105,4 @@ docker run --rm --network baron_net curlimages/curl:8.10.1 -fsS http://kratos:44 - `compose.ory.yaml` - `docker/ory/kratos/kratos.yml` - `.env.sample` -- `docs/auth-flow.md` +- `https://gitea.hmac.kr/baron/baron-sso/wiki/Authentication-and-Login-Flow.-` diff --git a/docs/test-plan.md b/docs/test-plan.md deleted file mode 100644 index 75984c1a..00000000 --- a/docs/test-plan.md +++ /dev/null @@ -1,47 +0,0 @@ -# 테스트 계획 및 원칙 (Baron SSO) - -## 1) 목적 -- 인증/인가 핵심 플로우의 안정성과 회귀 방지 -- 멀티 서비스(Backend/Ory Stack/Front) 연동 품질 확보 -- 릴리즈 기준과 장애 분석 기준의 표준화 - -## 2) 현재 기준 스냅샷 -- 기준 시각: 2026-02-19 16:32:09 KST -- 기준 커밋: `85998bd` -- Backend 전체 statement coverage: **24.7%** -- 테스트 인벤토리 수량: - - Backend(Go): **104개** - - UserFront(Flutter): **47개** - - AdminFront/DevFront(Playwright): **4개** - - UserFront WASM Playwright E2E: **42개** - -### Backend 패키지별 커버리지 -- `cmd/server`: 2.6% -- `internal/handler`: 25.0% -- `internal/idp`: 16.6% -- `internal/middleware`: 59.6% -- `internal/response`: 91.7% -- `internal/service`: 32.7% -- `internal/utils`: 24.5% -- `internal/validator`: 89.3% - -## 3) 하위 문서 (전수 목록) -- Backend 테스트 전수 목록: `docs/test-plan/backend-test-inventory.md` -- UserFront 테스트 전수 목록: `docs/test-plan/userfront-test-inventory.md` -- AdminFront/DevFront E2E 전수 목록: `docs/test-plan/web-e2e-test-inventory.md` -- UserFront WASM Playwright E2E 확장 계획: `docs/test-plan/userfront-wasm-e2e-expansion-plan.md` -- UserFront WASM Playwright E2E 전수 목록: `docs/test-plan/userfront-wasm-e2e-route-inventory.md` - -## 4) 실행 커맨드 -- Backend 전체 테스트: `cd backend && go test ./...` -- Backend 커버리지: `cd backend && go test ./... -coverprofile=coverage.out && go tool cover -func=coverage.out` -- UserFront 테스트: `cd userfront && flutter test` -- AdminFront E2E: `cd adminfront && npm test` -- DevFront E2E: `cd devfront && npm test` -- UserFront WASM E2E: `cd userfront-e2e && npm run test:wasm` -- UserFront WASM E2E(테스트만): `cd userfront-e2e && npm test` - -## 5) 유지 원칙 -- 신규 기능은 관련 테스트를 반드시 추가합니다. -- 회귀 이슈는 재현 테스트를 먼저 추가하고 수정합니다. -- 본 문서의 수치/목록은 `origin/dev` 기준으로 주기적으로 갱신합니다. diff --git a/docs/test-plan/userfront-test-inventory.md b/docs/test-plan/userfront-test-inventory.md deleted file mode 100644 index 8d2ca68e..00000000 --- a/docs/test-plan/userfront-test-inventory.md +++ /dev/null @@ -1,64 +0,0 @@ -# UserFront 테스트 전수 목록 - -- 범위: `userfront/test/*.dart` -- 기준: `test(...)`, `testWidgets(...)` 케이스 전수 - -| 파일 | 테스트 | 역할 | -|---|---|---| -| `userfront/test/dashboard_providers_test.dart` | `AuthTimelineNotifier는 다음 커서를 사용해 추가 로드한다` | 대시보드 타임라인 상태관리 검증 | -| `userfront/test/dashboard_providers_test.dart` | `AuthTimelineNotifier는 실패 시 오류 메시지를 보관한다` | 대시보드 타임라인 상태관리 검증 | -| `userfront/test/dashboard_providers_test.dart` | `AuthTimelineNotifier는 초기 페이지를 로드한다` | 대시보드 타임라인 상태관리 검증 | -| `userfront/test/dashboard_providers_test.dart` | `AuthTimelineNotifier는 커서가 없으면 추가 로드를 하지 않는다` | 대시보드 타임라인 상태관리 검증 | -| `userfront/test/error_screen_test.dart` | `개발환경은 원문 메시지를 노출한다` | 에러 노출 정책 검증 | -| `userfront/test/error_screen_test.dart` | `프로덕션은 ORY 코드를 bypass 처리한다` | 핵심 동작 회귀 방지 검증 | -| `userfront/test/error_screen_test.dart` | `프로덕션은 whitelist 메시지를 노출한다` | 에러 노출 정책 검증 | -| `userfront/test/error_screen_test.dart` | `프로덕션은 비허용 에러를 unknown_error로 처리한다` | 에러 노출 정책 검증 | -| `userfront/test/locale_registry_test.dart` | `extractSupportedLocaleCodesFromAssets excludes template and invalid` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_registry_test.dart` | `fallback locale prefers en when available` | fallback/복구 경로 검증 | -| `userfront/test/locale_registry_test.dart` | `fallback locale uses first sorted code when en is absent` | fallback/복구 경로 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `기본 모드에서는 local 우선으로 저장/조회한다` | locale 저장 우선순위 정책 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `legacy key를 읽으면 current key로 마이그레이션한다` | legacy migration 회귀 방지 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `localStorage가 차단되면 sessionStorage로 fallback 한다` | fallback/복구 경로 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `local/session 모두 차단되면 memory fallback 한다` | fallback/복구 경로 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `sessionOnly 모드에서는 session + memory만 사용한다` | 테스트 강제 모드 정책 검증 | -| `userfront/test/locale_storage_platform_test.dart` | `memoryOnly 모드에서는 memory만 사용한다` | 테스트 강제 모드 정책 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath applies locale` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath keeps unknown 2-letter prefix as path` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath preserves fragment` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath preserves query parameters` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath preserves raw query order and duplicates` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath preserves redirect_url parameter` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildLocalizedPath replaces existing locale` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildSigninRedirectPath keeps path without query` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildSigninRedirectPath preserves full raw query` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `buildSigninRedirectPath preserves redirect_url and redirect_uri` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `extractLocaleFromPath picks locale when present` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `extractLocaleFromPath returns null when missing` | fallback/복구 경로 검증 | -| `userfront/test/locale_utils_test.dart` | `normalizeLocaleCode falls back to default` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `normalizeLocaleCode handles supported locales` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `stripLocalePath keeps path without locale` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/locale_utils_test.dart` | `stripLocalePath removes locale segment` | i18n 로케일 해석/정규화 규칙 검증 | -| `userfront/test/login_challenge_resolver_test.dart` | `URI query가 비어 있으면 raw search에서 복구` | fallback/복구 경로 검증 | -| `userfront/test/login_challenge_resolver_test.dart` | `raw search도 비어 있으면 raw href에서 복구` | fallback/복구 경로 검증 | -| `userfront/test/login_challenge_resolver_test.dart` | `widget 값이 없으면 URI query에서 복구` | fallback/복구 경로 검증 | -| `userfront/test/login_challenge_resolver_test.dart` | `widget 값이 있으면 최우선으로 사용` | 핵심 동작 회귀 방지 검증 | -| `userfront/test/login_challenge_resolver_test.dart` | `값이 전부 없으면 missing` | fallback/복구 경로 검증 | -| `userfront/test/null_check_recovery_test.dart` | `Null check 오류 + 루트(/)면 선호 로케일 signin으로 복구` | Null-check 예외 복구 경로 검증 | -| `userfront/test/null_check_recovery_test.dart` | `Null check 오류 + /ko면 /ko/signin으로 복구` | Null-check 예외 복구 경로 검증 | -| `userfront/test/null_check_recovery_test.dart` | `이미 /ko/signin이면 복구 이동하지 않음` | Null-check 예외 복구 경로 검증 | -| `userfront/test/null_check_recovery_test.dart` | `Null check 오류여도 /ko/profile에서는 복구 이동하지 않음` | Null-check 예외 복구 경로 검증 | -| `userfront/test/null_check_recovery_test.dart` | `다른 오류 메시지면 복구 이동하지 않음` | Null-check 예외 복구 경로 검증 | -| `userfront/test/oidc_redirect_guard_test.dart` | `http/https 절대 URL만 허용` | 핵심 동작 회귀 방지 검증 | -| `userfront/test/oidc_redirect_guard_test.dart` | `빈 문자열과 파싱 실패를 차단` | 핵심 동작 회귀 방지 검증 | -| `userfront/test/password_login_flow_policy_test.dart` | `OIDC challenge가 없고 jwt가 있으면 로컬 로그인 완료로 진행한다` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/password_login_flow_policy_test.dart` | `OIDC challenge가 있고 redirectTo가 없으면 accept를 시도한다` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/password_login_flow_policy_test.dart` | `redirectTo/jwt 모두 없으면 invalid로 처리한다` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/password_login_flow_policy_test.dart` | `redirectTo가 있으면 OIDC redirect를 우선한다` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `루트 경로: /{locale} 로 접근 시 /{locale}/signin 으로 리다이렉트되어야 한다 (버그: 화면 렌더링 안됨)` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `/login: login_challenge와 redirect_uri를 전달` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `로그인 상태: profile 접근 시 signin으로 리다이렉트하지 않음` | 로그인 분기/라우팅 규칙 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `로그인 후 같은 브라우저 새 창/팝업에서도 세션이 유지된다` | 로그인 세션 지속성(동일 브라우저) 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `비로그인: redirect_uri/login_challenge가 signin으로 전달` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/router_redirect_widget_test.dart` | `비로그인: redirect_uri가 없으면 redirect_url을 전달` | 리다이렉트/쿼리 보존 규칙 검증 | -| `userfront/test/dashboard_screen_smoke_test.dart` | `대시보드는 로그인 토큰이 있으면 크래시 없이 기본 프레임을 렌더링한다` | 대시보드 Null-check 회귀 방지 스모크 검증 | -| `userfront/test/widget_test.dart` | `smoke test` | 기본 앱 렌더링 스모크 검증 | diff --git a/docs/test-plan/userfront-wasm-e2e-expansion-plan.md b/docs/test-plan/userfront-wasm-e2e-expansion-plan.md index ce5d9b58..8603bda4 100644 --- a/docs/test-plan/userfront-wasm-e2e-expansion-plan.md +++ b/docs/test-plan/userfront-wasm-e2e-expansion-plan.md @@ -80,7 +80,7 @@ - 참고: - WASM 렌더링에서는 접근성/DOM selector가 제한되어 로그인/리셋 폼은 `flt-glass-pane` 좌표 기반 입력으로 검증 - 전수 인벤토리: - - `docs/test-plan/userfront-wasm-e2e-route-inventory.md` + - `https://gitea.hmac.kr/baron/baron-sso/wiki/UserFront-WASM-E2E-Inventory.-` - 라우트 22개 + 기능 회귀 12개(총 42 테스트) 코드화 완료 - 프로필 소속 회귀 강화: - `tests/profile-department.spec.ts` 추가 diff --git a/docs/test-plan/userfront-wasm-e2e-route-inventory.md b/docs/test-plan/userfront-wasm-e2e-route-inventory.md deleted file mode 100644 index 2cf45a27..00000000 --- a/docs/test-plan/userfront-wasm-e2e-route-inventory.md +++ /dev/null @@ -1,59 +0,0 @@ -# UserFront WASM E2E 라우트/기능 전수 인벤토리 - -- 기준 소스: `userfront/lib/main.dart` -- 목적: 라우트 전수 항목을 Playwright 테스트로 코드화하고 CI에서 상시 검증 -- 현재 구현 파일: - - `userfront-e2e/tests/route-inventory.spec.ts` - - `userfront-e2e/tests/auth-routing.spec.ts` - - `userfront-e2e/tests/password-and-reset.spec.ts` - - `userfront-e2e/tests/profile-department.spec.ts` - -## 1) 라우트 전수 (main.dart 기준) - -| ID | Route | 검증 상태 | 테스트 파일 | -|---|---|---|---| -| R01 | `/` | 비로그인 시 `/{locale}/signin` 리다이렉트 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R02 | `/:locale` (`/ko`) | 비로그인 `signin` / 로그인 `dashboard` 분기 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts`, `userfront-e2e/tests/auth-routing.spec.ts` | -| R03 | `/:locale/dashboard` | 비로그인 `signin` / 로그인 유지 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts`, `userfront-e2e/tests/auth-routing.spec.ts` | -| R04 | `/:locale/profile` | 비로그인 `signin` / 로그인 유지 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R05 | `/:locale/signin` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R06 | `/:locale/login` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R07 | `/:locale/consent` | challenge 유무 케이스 진입 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R08 | `/:locale/signup` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R09 | `/:locale/registration` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R10 | `/:locale/verify` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R11 | `/:locale/verify/:token` | verify 경로 진입/처리 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R12 | `/:locale/verification` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R13 | `/:locale/l/:shortCode` | short code 경로 진입/처리 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R14 | `/:locale/forgot-password` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R15 | `/:locale/recovery` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R16 | `/:locale/reset-password` | token 기반 진입 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts`, `userfront-e2e/tests/password-and-reset.spec.ts` | -| R17 | `/:locale/error` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R18 | `/:locale/settings` | 진입 가능 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R19 | `/:locale/approve` | 비로그인 `signin?notice=...` / 로그인 `dashboard` 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts`, `userfront-e2e/tests/auth-routing.spec.ts` | -| R20 | `/:locale/ql/:ref` | 비로그인 `signin?notice=...` / 로그인 `dashboard` 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R21 | `/:locale/scan` | 비로그인 `signin` / 로그인 진입 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | -| R22 | `/:locale/admin/users` | 비로그인 `signin` / 로그인 진입 검증 완료 | `userfront-e2e/tests/route-inventory.spec.ts` | - -## 2) 기능 회귀 (핵심) - -| ID | 기능 | 검증 상태 | 테스트 파일 | -|---|---|---|---| -| F01 | `/ko` 비로그인 리다이렉트 | 완료 | `userfront-e2e/tests/auth-routing.spec.ts` | -| F02 | 로그인 후 `/ko` + 새로고침 세션 유지 | 완료 | `userfront-e2e/tests/auth-routing.spec.ts` | -| F03 | approve 경로 비로그인 보호 | 완료 | `userfront-e2e/tests/auth-routing.spec.ts` | -| F04 | approve 경로 로그인 자동 승인 | 완료 | `userfront-e2e/tests/auth-routing.spec.ts` | -| F05 | 비밀번호 로그인 성공 | 완료 | `userfront-e2e/tests/password-and-reset.spec.ts` | -| F06 | 비밀번호 로그인 실패 코드 처리 | 완료 | `userfront-e2e/tests/password-and-reset.spec.ts` | -| F07 | 비밀번호 재설정 완료 후 signin 이동 | 완료 | `userfront-e2e/tests/password-and-reset.spec.ts` | -| F08 | 프로필 소속 수정 후 blur 저장 요청 전송 | 완료 | `userfront-e2e/tests/profile-department.spec.ts` | -| F09 | 프로필 소속 입력 후 즉시 새로고침 시 저장 요청 미전송(재현) | 완료 | `userfront-e2e/tests/profile-department.spec.ts` | -| F10 | 프로필 소속 동일값 입력 시 저장 요청 미전송 | 완료 | `userfront-e2e/tests/profile-department.spec.ts` | -| F11 | 프로필 소속 빈값 입력 시 저장 요청 미전송 | 완료 | `userfront-e2e/tests/profile-department.spec.ts` | -| F12 | 프로필 소속 수정 후 새로고침 뒤 재수정 저장 요청 누락 방지 | 완료 | `userfront-e2e/tests/profile-department.spec.ts` | - -## 3) 실행/CI - -- 로컬 실행: `cd userfront-e2e && npm run test:wasm` -- CI 워크플로우: `.gitea/workflows/code_check.yml`의 `userfront-e2e-tests` 잡에서 매 실행 검증 -- 현재 스위트 수량: 총 42 테스트(라우트 30 + 인증/리다이렉트 4 + 비밀번호/리셋 3 + 프로필 소속 5) diff --git a/docs/개발완료보고서.md b/docs/개발완료보고서.md index 47af1fae..5ec115a7 100644 --- a/docs/개발완료보고서.md +++ b/docs/개발완료보고서.md @@ -581,7 +581,7 @@ Kratos가 사용자 SoT이며 Hydra는 순수 OIDC 토큰 엔진입니다. 비 - 인증 실패 시에는 사용자에게 직접적인 실패 원인을 전달하는 대신, 통일된 오류 메시지 형태로 안내합니다. **관련 문서/이슈 연결** -- `docs/auth-flow.md`의 ID/Password 로그인 흐름과 일치 +- `https://gitea.hmac.kr/baron/baron-sso/wiki/Authentication-and-Login-Flow.-`의 ID/Password 로그인 흐름과 일치 - 종료 이슈: 비밀번호 로그인/변경 기능 보강 이슈들(#67, #70 등) --- @@ -784,7 +784,7 @@ Kratos가 사용자 SoT이며 Hydra는 순수 OIDC 토큰 엔진입니다. 비 - 네트워크 경계 검증 **관련 문서** -- `docs/test-plan.md` +- `https://gitea.hmac.kr/baron/baron-sso/wiki/Test-Plan-and-Principles.-` ---