Skip to content

chore/BACKEND-313 어드민 세션이 요청 없이 24시간이 지나야 만료된다 - #402

Merged
koosco merged 3 commits into
mainfrom
chore/BACKEND-313
Dec 1, 2026
Merged

koosco merged 3 commits into
mainfrom
chore/BACKEND-313

Conversation

@koosco

@koosco koosco commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

배경

어드민 세션은 마지막 요청 후 30분이 지나면 만료돼서, 운영자가 잠깐 자리를 비웠다 돌아와도 Google 로그인을 다시 해야 했습니다. 유휴 만료 시간을 24시간으로 늘립니다. 매 요청마다 SessionAuthorizationManager 가 DB 에서 관리자 권한을 다시 확인하므로, 세션이 길어져도 권한 회수는 바로 반영됩니다.

Sprint: BACKEND-313

변경 내용

  • spring.session.timeout 을 30m 에서 24h 로 변경함. Spring Session JDBC(ADMIN_SESSION)가 실제로 쓰는 값
  • Spring Session 이 읽지 않는 server.servlet.session.timeout 은 지움. 두 곳을 함께 맞춰야 하는 부담만 남기 때문
  • HLD·runbook 을 24시간 기준으로 맞추고, runbook 에 admin_session 행을 지워 세션을 끊는 "세션 강제 종료" 절차를 추가함
  • 로그인 시각 기준 상한(absolute timeout)은 두지 않음. Spring Session 이 제공하지 않아 필터를 따로 만들어야 하고, 운영자가 두세 명이라 강제 종료 절차로 대응함

검증

  • ./gradlew :apps:admin:test 86건 통과, 실패 0
    • 새 세션의 maxInactiveInterval 이 24시간인지 확인
    • 마지막 접근이 24시간 1분 전인 세션은 401 을 받는지 확인
  • runbook 의 강제 종료 SQL 을 로컬 Postgres(V41 스키마)에서 실행해, 지정한 관리자 세션과 속성 행만 지워지는 것을 확인함
  • 배포 후 확인할 것: 만료 시간은 세션을 만들 때 행에 저장되므로, 배포 전에 만든 세션은 30분이 유지되고 다시 로그인한 뒤부터 24시간이 적용됨. 이 PR 을 되돌려도 이미 만든 세션은 24시간이 유지되므로, 바로 줄이려면 강제 종료 절차를 씀
  • Admin 웹의 주석·운영 문서는 docs: Spring 어드민 세션 유휴 만료를 24시간 기준으로 맞춘다 Team-Neki-Admin#11 에서 함께 고침

🤖 Generated with Claude Code

운영자가 잠깐 자리를 비워도 30분이 지나면 다시 Google 로그인을 해야 했다.
권한 회수는 SessionAuthorizationManager 가 매 요청 DB 로 확인하므로 세션 길이와 무관하다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@koosco koosco self-assigned this Dec 1, 2026
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 86c3ece3-12d8-413c-a5ed-9a0536bc3379
Commits

Reviewing files that changed from the base of the PR and between 1c13fec and cd88fbd.

Files selected for processing: 5

  • apps/admin/src/main/resources/application.yaml
  • apps/admin/src/test/kotlin/com/neki/admin/auth/AdminAuthE2ETest.kt
  • apps/admin/src/test/resources/application-test.yml
  • docs/hld/2026-10-19-admin-auth-hld.md
  • docs/runbook/admin-auth.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@koovis-review-bot koovis-review-bot 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.

이 PR은 어드민 세션의 유휴 만료를 30분에서 24시간으로 늘립니다. apps/admin 의 세션 설정 2곳과 테스트 설정, AdminAuthE2ETest 의 기대값이 바뀌며 스키마 · API 계약 · 다른 레포 소비자에는 변경이 없습니다. 운영 위험(neki-pr-review)과 과설계(ponytail-review) 관점으로 봤고, /admin/** 가 매 요청마다 DB 에서 관리자 권한을 다시 확인한다는 본문 주장은 SessionAuthorizationManager 와 SessionSecurityConfig 에서 확인했습니다.

인라인 코멘트 3건

Deployment & Rollback

  • 만료 시간은 세션 행(ADMIN_SESSION.MAX_INACTIVE_INTERVAL)에 저장되므로 배포 전에 만든 세션은 30분이 유지됨 (PR 본문과 일치)
  • 같은 이유로 이 PR 을 되돌려도 이미 만들어진 세션은 24시간이 유지됨. 즉시 줄여야 하면 ADMIN_SESSION 행을 지워 재로그인을 강제해야 함
  • Admin 웹(Team-Neki-Admin origin/main)은 주기 조회 없이 탭 복귀 때만 /admin/auth/me 를 부르므로, 열어 둔 탭이 세션을 계속 연장하지는 않음

Missing Information

  • Sprint 맥락 미참조(MCP unauthorized, 재시도 1회 실패). BACKEND-313 의 수용 기준과는 대조하지 못함
  • 게시 시점에 Test 체크가 진행 중. 통과 여부는 머지 전에 확인 필요

머지를 막는 지적은 없어 승인합니다. 인라인 코멘트는 머지 후에 따로 처리해도 되는 수준입니다.

koosco and others added 2 commits December 2, 2026 01:16
spring.session.timeout 이 있으면 Spring Session 은 이 값을 쓰지 않아, 두 곳을 함께 맞춰야 하는 부담만 남는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HLD 와 runbook 이 30분을 기준으로 적고 있어 실제 동작과 어긋났다.
HLD 에는 24시간으로 바꾼 이유와 트레이드 오프를, runbook 에는 admin_session 행을 지워 세션을 끊는 절차를 남긴다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@koosco
koosco merged commit f294181 into main Dec 1, 2026
3 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