Skip to content

main -> alpha - #1954

Merged
seefs001 merged 24 commits into
alphafrom
main
Oct 2, 2025
Merged

main -> alpha#1954
seefs001 merged 24 commits into
alphafrom
main

Conversation

@seefs001

@seefs001 seefs001 commented Oct 2, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Passkey (WebAuthn) login and secure verification flows (register, login, verify, delete), with admin reset and system settings UI.
    • Unified secure verification modal (Passkey/2FA) for sensitive actions like viewing channel keys.
    • Endpoint type selection for channel model testing.
    • Added embeddings endpoint support.
  • Improvements
    • Gemini Robotics ER 1.5 pricing and model ratio updates.
  • Bug Fixes
    • Prevented rare crashes in streaming responses; improved VolcEngine routing and Jina embeddings handling; reduced unnecessary .env warnings.
  • Chores
    • Upgraded Go toolchain and added WebAuthn-related dependencies.

seefs001 and others added 24 commits September 29, 2025 17:45
# Conflicts:
#	web/src/components/settings/PersonalSetting.jsx
#	web/src/i18n/locales/en.json
#	web/src/i18n/locales/zh.json
fix(jina): remove encoding_format for jina embedding
feat: 支持 gemini-robotics-er-1.5-preview
fix(openai): add nil checks for web_search streaming to prevent panic
@seefs001
seefs001 merged commit c1492be into alpha Oct 2, 2025
1 check was pending
@coderabbitai

coderabbitai Bot commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Passkey (WebAuthn) authentication and secure verification (2FA/Passkey) across backend and frontend, including controllers, middleware, services, models, routes, and UI. Introduces endpoint-type-aware channel testing and an embeddings endpoint type. Updates settings (system, operation, ratio), dependencies (Go toolchain, webauthn), and minor relay and logging adjustments.

Changes

Cohort / File(s) Summary of changes
Passkey backend (auth, model, service, router)
controller/passkey.go, controller/secure_verification.go, middleware/secure_verification.go, service/passkey/*, model/passkey.go, model/main.go, router/api-router.go, setting/system_setting/passkey.go, controller/misc.go
Implements Passkey (register/login/verify/delete/admin reset), universal verification (2FA/Passkey), middleware to enforce/optionalize secure verification, WebAuthn config/session/user adapters, PasskeyCredential model + migrations, routes for all endpoints, exposes passkey settings via status and config.
Secure key access flow
controller/channel.go, router/api-router.go
Replaces in-handler 2FA with SecureVerificationRequired middleware; updates success message and routing for channel key retrieval.
Frontend Passkey flows (auth + personal settings)
web/src/components/auth/LoginForm.jsx, web/src/components/settings/PersonalSetting.jsx, web/src/components/settings/personal/cards/AccountManagement.jsx, web/src/components/settings/SystemSetting.jsx, web/src/helpers/passkey.js, web/src/helpers/index.js
Adds Passkey login, registration/unbind UI, device support checks, helper utilities for WebAuthn encoding/decoding, and system settings UI/submit for passkey configuration.
Secure verification UX and helpers
web/src/components/common/modals/SecureVerificationModal.jsx, web/src/hooks/common/useSecureVerification.jsx, web/src/services/secureVerification.js, web/src/helpers/secureApiCall.js, web/src/components/common/examples/ChannelKeyViewExample.jsx
Introduces reusable verification modal, hook to orchestrate verification and wrap API calls, client service for 2FA/Passkey verification, error helpers, and an example key-view flow using verification.
Users admin: reset flows
web/src/components/table/users/UsersTable.jsx, web/src/components/table/users/UsersColumnDefs.jsx, web/src/components/table/users/modals/ResetPasskeyModal.jsx, web/src/components/table/users/modals/ResetTwoFAModal.jsx
Adds admin UI/actions/modals to reset Passkey and 2FA for users; replaces single delete button with dropdown actions.
Channel testing: endpoint-type aware
controller/channel-test.go, web/src/hooks/channels/useChannelsData.jsx, web/src/components/table/channels/modals/ModelTestModal.jsx
Adds endpointType plumbed through test flow, request-building per endpoint, relay format mapping, UI to select endpoint type, and batch passing of selection.
Endpoint defaults/types
common/endpoint_defaults.go, constant/endpoint_type.go
Adds EndpointTypeEmbeddings and its default path/method.
Relay/channel adjustments
relay/channel/volcengine/adaptor.go, relay/channel/openai/relay_responses.go, relay/channel/jina/adaptor.go
Volcengine URL selection now considers RelayFormat; OpenAI responses handler adds nil-guards for web search usage; Jina embeddings clears EncodingFormat.
Settings: model pricing/ratios
setting/operation_setting/tools.go, setting/ratio_setting/model_ratio.go
Adds Gemini Robotics ER 1.5 audio input price and model ratio entries.
Toolchain and deps
go.mod
Updates Go version/toolchain; adds webauthn and related dependencies; bumps x/* modules.
Misc logging
main.go
Only logs missing .env warning in debug mode.
i18n
web/src/i18n/locales/en.json, web/src/i18n/locales/zh.json
Adds extensive Passkey and secure verification strings.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User (Browser)
  participant FE as Frontend
  participant API as Server
  participant P as Passkey Controller
  participant S as Sessions
  participant W as WebAuthn

  rect rgb(230,245,255)
  note right of U: Passkey Login (Discoverable)
  U->>FE: Click "Passkey Sign-in"
  FE->>API: POST /user/passkey/login/begin
  API->>P: Build options via WebAuthn
  P->>S: Save LoginSession
  API-->>FE: Assertion options
  FE->>W: navigator.credentials.get(options)
  W-->>FE: Assertion
  FE->>API: POST /user/passkey/login/finish (assertion)
  API->>P: Verify, update last-used
  P->>S: Create user session
  API-->>FE: Success
  end
Loading
sequenceDiagram
  autonumber
  participant U as User (Browser)
  participant FE as Frontend
  participant API as Server
  participant SV as SecureVerification Ctl
  participant MW as SecureVerification Middleware
  participant CH as Channel Controller
  participant S as Sessions

  rect rgb(242,255,242)
  note over FE,API: Universal verification then access protected resource
  FE->>API: POST /verify (method: passkey|2fa)
  API->>SV: Validate method
  SV->>S: Set secure_verified_at
  API-->>FE: {verified, expires_at}
  FE->>API: POST /channel/:id/key
  API->>MW: Check secure_verified_at and expiry
  MW-->>API: OK
  API->>CH: GetChannelKey
  API-->>FE: Channel key
  end
Loading
sequenceDiagram
  autonumber
  participant FE as Frontend
  participant API as Server
  participant PS as Passkey Controller
  participant S as Sessions
  participant W as WebAuthn

  rect rgb(255,248,230)
  note right of FE: Passkey Registration (Bind)
  FE->>API: POST /self/passkey/register/begin
  API->>PS: Build creation options (excludes)
  PS->>S: Save RegistrationSession
  API-->>FE: Creation options
  FE->>W: navigator.credentials.create(options)
  W-->>FE: Credential
  FE->>API: POST /self/passkey/register/finish
  API->>PS: Persist credential (upsert)
  API-->>FE: Success
  end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • Calcium-Ion

Poem

A whisker twitch, a tap-tap key—
I bound my pawprint, passkey-free.
Two hops verify, doors swing wide,
Secure as burrowed roots inside.
New paths for tests, embeddings too—
Thump-thump! This bun approves of you. 🐇🔐

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aab82f2 and 2938246.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (43)
  • common/endpoint_defaults.go (1 hunks)
  • constant/endpoint_type.go (1 hunks)
  • controller/channel-test.go (9 hunks)
  • controller/channel.go (2 hunks)
  • controller/misc.go (2 hunks)
  • controller/passkey.go (1 hunks)
  • controller/secure_verification.go (1 hunks)
  • go.mod (5 hunks)
  • main.go (1 hunks)
  • middleware/secure_verification.go (1 hunks)
  • model/main.go (2 hunks)
  • model/passkey.go (1 hunks)
  • relay/channel/jina/adaptor.go (1 hunks)
  • relay/channel/openai/relay_responses.go (1 hunks)
  • relay/channel/volcengine/adaptor.go (1 hunks)
  • router/api-router.go (4 hunks)
  • service/passkey/service.go (1 hunks)
  • service/passkey/session.go (1 hunks)
  • service/passkey/user.go (1 hunks)
  • setting/operation_setting/tools.go (2 hunks)
  • setting/ratio_setting/model_ratio.go (3 hunks)
  • setting/system_setting/passkey.go (1 hunks)
  • web/src/components/auth/LoginForm.jsx (6 hunks)
  • web/src/components/common/examples/ChannelKeyViewExample.jsx (1 hunks)
  • web/src/components/common/modals/SecureVerificationModal.jsx (1 hunks)
  • web/src/components/settings/PersonalSetting.jsx (5 hunks)
  • web/src/components/settings/SystemSetting.jsx (5 hunks)
  • web/src/components/settings/personal/cards/AccountManagement.jsx (3 hunks)
  • web/src/components/table/channels/modals/EditChannelModal.jsx (6 hunks)
  • web/src/components/table/channels/modals/ModelTestModal.jsx (5 hunks)
  • web/src/components/table/users/UsersColumnDefs.jsx (5 hunks)
  • web/src/components/table/users/UsersTable.jsx (7 hunks)
  • web/src/components/table/users/modals/ResetPasskeyModal.jsx (1 hunks)
  • web/src/components/table/users/modals/ResetTwoFAModal.jsx (1 hunks)
  • web/src/helpers/index.js (1 hunks)
  • web/src/helpers/passkey.js (1 hunks)
  • web/src/helpers/secureApiCall.js (1 hunks)
  • web/src/hooks/channels/useChannelsData.jsx (6 hunks)
  • web/src/hooks/common/useSecureVerification.jsx (1 hunks)
  • web/src/hooks/users/useUsersData.jsx (3 hunks)
  • web/src/i18n/locales/en.json (3 hunks)
  • web/src/i18n/locales/zh.json (2 hunks)
  • web/src/services/secureVerification.js (1 hunks)

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

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

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.

4 participants