CurrentUserMode with session, load known attributes within ActiveSession
The original MR(Show admin mode within active sessions view) has been reverted due to failures: https://gitlab.com/gitlab-org/release/tasks/-/issues/8332#note_1748203585 on staging-canary. See discussion https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142158#note_1748221369 It was agreed to implement it in two steps, and this is step one. Within this MR CurrentUserMode is extend with session parameter and within load_raw_session only known attributes of ActiveSession are loaded. This fixes the root cause for the crash within staging-canary. In the future new attributes can be added without the risk of a crash as only known attributes are passed to the constructor.
显示
- app/models/active_session.rb 10 个添加, 2 个删除app/models/active_session.rb
- lib/gitlab/auth/current_user_mode.rb 8 个添加, 5 个删除lib/gitlab/auth/current_user_mode.rb
- spec/features/user_settings/active_sessions_spec.rb 16 个添加, 0 个删除spec/features/user_settings/active_sessions_spec.rb
- spec/lib/gitlab/auth/current_user_mode_spec.rb 49 个添加, 0 个删除spec/lib/gitlab/auth/current_user_mode_spec.rb
加载中
想要评论请 注册 或 登录