1. 21 Apr, 2026 14 commits
  2. 20 Apr, 2026 15 commits
    • IanShaw027's avatar
      ebe75244
    • IanShaw027's avatar
      fix payment resume result consistency · a27a7add
      IanShaw027 authored
      a27a7add
    • IanShaw027's avatar
      fix frontend wechat oauth capability recovery · cd0338fb
      IanShaw027 authored
      cd0338fb
    • IanShaw027's avatar
      067eb23d
    • IanShaw027's avatar
      fix auth pending adoption and turnstile flow · 12f4af74
      IanShaw027 authored
      12f4af74
    • IanShaw027's avatar
      fix: close admin settings review gaps · 030da8c2
      IanShaw027 authored
      030da8c2
    • IanShaw027's avatar
      Close profile identity and avatar loop · 92041457
      IanShaw027 authored
      92041457
    • IanShaw027's avatar
      4f6966d7
    • IanShaw027's avatar
      0fa47f18
    • IanShaw027's avatar
      7ef7fd19
    • erio's avatar
      fix(openai): 移除已下线 Codex 模型并修复归一化兜底副作用 · bbc4aed3
      erio authored
      - backend: 删除 gpt-5 / 5.1 / 5.1-codex / 5.1-codex-max / 5.1-codex-mini / 5.2-codex / 5.4-nano 的内置映射与 DefaultModels 条目
      - backend: normalizeCodexModel 默认兜底由 gpt-5.1 改为 gpt-5.4,gpt-5.3-codex-spark 独立保留映射
      - backend: 修复 isOpenAIGPT54Model 与 shouldAutoInjectPromptCacheKeyForCompat 对 claude / gpt-4o 的误判(之前依赖 gpt-5.1 作为非 GPT 族的隐式 sentinel,改后需要显式前缀守卫)
      - backend: 清理 billing_service 中已不可达的 fallback 价格与 switch 分支
      - frontend: 从白名单、OpenCode 配置、预设映射中移除已下线模型
      - 同步更新所有相关单测
      
      Refs: #1758, parallels upstream #1759 but adds downstream guard fixes
      bbc4aed3
    • erio's avatar
      feat(payment): i18n payment error codes and label localization · 40d4e167
      erio authored
      Pairs with the backend structured payment errors (reason + metadata). The
      frontend now maps reason codes to localized messages with metadata as
      interpolation variables, and automatically localizes raw config-field names
      (e.g. "certSerial" → "证书序列号") using the existing UI-label i18n
      namespace.
      
      - frontend/src/utils/apiError.ts
        - extractApiErrorCode now prefers the string `reason` over the numeric HTTP
          `code`; reason is granular enough to drive i18n lookup, HTTP code is not.
        - New extractApiErrorMetadata to pull interpolation params off the error.
        - New extractI18nErrorMessage(err, t, namespace, fallback): looks up
          `<namespace>.<REASON>` in i18n and substitutes metadata. Before
          substitution, `metadata.key` and `metadata.keys` (slash-joined) are
          re-translated through `admin.settings.payment.field_<key>` so users see
          "缺少必填项:证书序列号" instead of "缺少必填项:certSerial".
      
      - frontend/src/i18n/locales/{zh,en}.ts
        - Add payment.errors entries for every structured reason code returned by
          the backend (PAYMENT_DISABLED, INVALID_AMOUNT, TOO_MANY_PENDING,
          DAILY_LIMIT_EXCEEDED, NO_AVAILABLE_INSTANCE, PAYMENT_PROVIDER_MISCONFIGURED,
          WXPAY_CONFIG_MISSING_KEY / INVALID_KEY_LENGTH / INVALID_KEY, NOT_FOUND,
          FORBIDDEN, CONFLICT, INVALID_ORDER_TYPE, INVALID_STATUS,
          BALANCE_NOT_ENOUGH, REFUND_AMOUNT_EXCEEDED, REFUND_FAILED, and more),
          with placeholders for template variables.
      
      - 13 payment-related Vue files
        - Migrate catch-block error reporting from extractApiErrorMessage to
          extractI18nErrorMessage(err, t, 'payment.errors', fallback).
        - Remove the ad-hoc paymentErrorMap computed in SettingsView.vue, which the
          new helper supersedes (it reads i18n directly via t).
      
      - frontend/src/components/payment/providerConfig.ts
        - wxpay: publicKey and publicKeyId are now required (was optional), matching
          the pubkey-only verifier direction; certSerial is already required.
      
      This PR is drop-in safe: reason-preferring extractApiErrorCode is backward
      compatible with callers that pass their own i18nMap, and error codes missing
      from i18n fall back to the existing message-based path.
      40d4e167
    • IanShaw027's avatar
      feat: wire payment return url payloads · b51bc7ee
      IanShaw027 authored
      b51bc7ee
    • IanShaw027's avatar
      feat: add profile auth identity binding flow · c6d85924
      IanShaw027 authored
      c6d85924
    • IanShaw027's avatar
      feat: rebuild auth identity foundation flow · e9de839d
      IanShaw027 authored
      e9de839d
  3. 19 Apr, 2026 1 commit
  4. 18 Apr, 2026 2 commits
    • erio's avatar
      feat(payment): redact provider secrets in admin config API · 235f7108
      erio authored
      Admin GET /api/v1/admin/payment/providers previously returned every
      config value — including privateKey / apiV3Key / secretKey etc. —
      verbatim. Any future XSS on the admin UI would hand attackers the
      full set of production payment credentials, and the plaintext values
      sat unnecessarily in browser memory for every operator.
      
      Treat those fields as write-only from the admin surface:
      
      - decryptAndMaskConfig() strips sensitive keys from the GET response.
        The authoritative list is an explicit per-provider registry that
        mirrors the frontend's PROVIDER_CONFIG_FIELDS sensitive flag:
          alipay   → privateKey, publicKey, alipayPublicKey
          wxpay    → privateKey, apiV3Key, publicKey
          stripe   → secretKey, webhookSecret (publishableKey stays plain)
          easypay  → pkey
        Payment runtime still reads the full config via decryptConfig, so
        nothing at the gateway changes.
      
      - mergeConfig() treats an empty value for a sensitive key as "leave
        unchanged" — the admin UI omits unchanged secrets so operators can
        tweak non-sensitive settings without re-entering credentials.
      
      - Admin dialog (PaymentProviderDialog.vue):
        * secret inputs get autocomplete="new-password", data-1p-ignore,
          data-lpignore and data-bwignore so password managers do not
          offer to save provider credentials
        * in edit mode the required-field check skips sensitive fields
          (empty is the "keep existing" signal) and the placeholder shows
          "leave empty to keep" instead of the default example value
        * create mode still requires every non-optional field, including
          secrets, since there is nothing to preserve
      
      - Unit test renamed to TestIsSensitiveProviderConfigField, covers
        the per-provider registry and specifically asserts that Stripe's
        publishableKey is NOT treated as a secret.
      235f7108
    • erio's avatar
      fix(payment): alipay redirect-only flow, H5 detection and popup sizing · c3cb0280
      erio authored
      The native Alipay provider previously tried to embed the payment page
      URL into a QR code on the client — the URL is not a scannable payload
      so the QR never worked. Merchants also hit a H5 detection mismatch
      whenever the backend UA sniffer missed iPadOS 13+ or embedded browsers,
      and the popup window was too small for Alipay's standard checkout
      layout (QR + account-login panel on the right), forcing the user to
      scroll horizontally and vertically.
      
      Changes:
      
      Backend
      - alipay.go: drop QR-on-URL path. Use redirect-only flow —
        alipay.trade.page.pay for PC (returns a gateway URL the browser
        opens in a new window) and alipay.trade.wap.pay for H5 (returns a
        URL the browser jumps to). Both flows produce pages on
        openapi.alipaydev.com / excashier.alipay.com; the client never
        renders a QR itself.
      - payment_handler.go: add optional is_mobile bool to
        CreateOrderRequest so the frontend can declare the device
        explicitly. Server still falls back to UA sniffing when absent.
      
      Frontend
      - types/payment.ts, PaymentView.vue: declare is_mobile in
        CreateOrderRequest and pass the computed isMobileDevice() value.
      - providerConfig.ts: replace the two fixed POPUP_WINDOW_FEATURES
        constants with getPaymentPopupFeatures(), which prefers 1250×900
        (Alipay's checkout footprint), clamps to window.screen.avail* and
        centers the popup so it never overflows on smaller laptops.
      - PaymentQRDialog.vue, PaymentStatusPanel.vue, StripePaymentInline.vue,
        PaymentView.vue: use the new helper at all popup call sites.
      c3cb0280
  5. 17 Apr, 2026 2 commits
    • erio's avatar
      fix(billing): reject rate_multiplier <= 0 on save; clamp negatives to 0 in compute · df57d277
      erio authored
      分组倍率和用户专属倍率在保存时没有校验,0 会触发计费层的 `<=0 → 1.0`
      防御条款,结果订阅/余额分组按标准价扣费;完全是沉默地绕过了业务规则。
      
      - 保存校验(admin_service):CreateGroup / UpdateGroup / BatchSetGroupRateMultipliers /
        UpdateUser.SyncUserGroupRates 全部要求 > 0
      - 计算层(billing_service):三处 `<=0 → 1.0` 改为 `<0 → 0`;负数按 0 结算,
        避免配置异常被静默按 1x 收费
      - 前端:分组倍率 / 用户专属倍率输入 min 统一到 0.001
      - 删除未使用的 IsFreeSubscription 方法
      
      测试:新增 billing_service_rate_multiplier_test.go 端到端验证;更新原有锁定
      旧 `<=0 → 1.0` 行为的测试。
      df57d277
    • erio's avatar
      fix(admin): prevent browser password manager from autofilling account API key · 948d8e6d
      erio authored
      Chrome's password manager matched the apikey-type account's Base URL + API Key
      inputs as a login form and autofilled the last saved password by domain, so
      editing a Gemini account could overwrite its apikey with a Claude key that
      shared the same Base URL. Add autocomplete="new-password" plus data-*-ignore
      attributes for 1Password / LastPass / Bitwarden to opt the field out of every
      major password manager's autofill.
      948d8e6d
  6. 16 Apr, 2026 1 commit
  7. 15 Apr, 2026 5 commits