Skip to content

feat:[mono] add campsite_session_store to parse cookie#1117

Merged
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main
Jun 13, 2025
Merged

feat:[mono] add campsite_session_store to parse cookie#1117
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Jun 13, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2025 9:11am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the in-memory session store with a CampsiteApiStore, migrates all user_id fields from i64 to String, updates OAuth cookie handling, and propagates the new campsite_user_id through MR and issue endpoints.

  • Introduce CampsiteApiStore and wire it into the OAuth flow (cookie name, FromRequestParts)
  • Change all storage and model user_id fields from i64 to String and add a migration
  • Update MR/issue routers to accept LoginUser and pass campsite_user_id to storage calls

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
mono/src/api/oauth/mod.rs Switched from MemoryStore to CampsiteApiStore, new cookie
mono/src/api/oauth/campsite_store.rs Implement SessionStore::load_session, stubs for other methods
mono/src/api/mr/mr_router.rs Inject LoginUser, use campsite_user_id in MR actions
mono/src/api/mr/mod.rs Change MegaConversation.user_id type to String
mono/src/api/mod.rs Use CampsiteApiStore in service state
mono/src/api/issue/issue_router.rs Inject LoginUser, use campsite_user_id in issue actions
jupiter/src/storage/{user,mr,issue}_storage.rs Update storage method signatures to String user_id
jupiter/migration/src/m20250613_033821_alter_user_id.rs Migration to alter user_id columns to string
jupiter/callisto/src/{ssh_keys,mega_mr,mega_conversation,access_token}.rs Update entity definitions to use String user_id; remove unique on path
config/config.toml Add campsite_api_domain and allowed_cors_origins
common/src/config.rs Extend OauthConfig with new fields
ceres/src/pack/monorepo.rs Use empty String for system events, update add_mr_conversation
ceres/src/api_service/mono_api_service.rs Change merge_mr signature to accept user_id: String
Comments suppressed due to low confidence (2)

mono/src/api/mr/mr_router.rs:155

  • Cannot borrow a mutable reference to a temporary (model.into()); assign model.into() to let mut mr and then call merge_mr(..., &mut mr).
.merge_mr(user.campsite_user_id, &mut model.into())

common/src/config.rs:542

  • Adding new config fields requires updating the deserialization logic; ensure these fields are included in the config loader or deserialization will fail.
pub campsite_api_domain: String,

Comment thread mono/src/api/oauth/campsite_store.rs Outdated
Comment thread mono/src/api/oauth/campsite_store.rs Outdated
Comment thread mono/src/api/mr/mr_router.rs
Comment thread jupiter/migration/src/m20250613_033821_alter_user_id.rs Outdated
Comment thread jupiter/callisto/src/mega_mr.rs
@genedna
genedna added this pull request to the merge queue Jun 13, 2025
Merged via the queue into gitmono-dev:main with commit 1c6c812 Jun 13, 2025
10 of 13 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Mega UI 重构 Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants