GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 为什么限制在GETS中使用@combine · Issue #425 · APIJSON/APIJSON

为什么限制在GETS中使用@combine #425

New issue
Copy link
New issue
Copy link
Closed
Closed
为什么限制在GETS中使用@combine#425
Copy link
Labels
Question 使用问题使用问题使用问题help wanted请求帮助请求帮助

Description

@aldag
aldag
opened on Jul 22, 2022
Issue body actions

在GETS请求中使用@combine时得到了这样的提示:
"msg": "StandardAdvice:{} 里的 @combine:value 不合法!DELETE,GETS,HEADS 请求不允许传 @combine:value !"
查代码发现,这个检查逻辑是硬编码在AbstractSQLConfig类中的。

为什么在这些类型的请求中限制@combine的使用呢?

Activity

  1. aldag
    changed the title [-]combine的限制[/-] [+]为什么限制在GETS中使用@combine[/+] on Jul 22, 2022
  2. TommyLemon commented on Jul 22, 2022

    @TommyLemon
    TommyLemon
    on Jul 22, 2022
    Member
    More actions

    防止前端传参越权操作,例如把后端设置的条件 AND 连接改为 OR 连接

  3. TommyLemon
    added
    Question 使用问题使用问题使用问题
    on Jul 22, 2022
  4. aldag commented on Jul 22, 2022

    @aldag
    aldag
    on Jul 22, 2022
    Author
    More actions

    防止前端传参越权操作,例如把后端设置的条件 AND 连接改为 OR 连接

    有些业务场景需要OR连接的查询。在AbstractSQLConfig做检查,后端也无法添加@combine,检查点能否前移呢?

  5. TommyLemon commented on Jul 22, 2022

    @TommyLemon
    TommyLemon
    on Jul 22, 2022
    Member
    More actions

    可以的,把 AbstractSQLConfig 里的检查移到 AbstractVerifier,判断 JSONRequest.KEY_COMBINE.equals(rk) 就抛异常
    https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java#L1006
    image

    这样就可以实现前端不能传,但后端能在 Request 表指定 @combine 了

  6. TommyLemon
    added
    help wanted请求帮助请求帮助
    on Aug 8, 2022
  7. TommyLemon commented on Feb 16, 2023

    @TommyLemon
    TommyLemon
    on Feb 16, 2023
    Member
    More actions

    @aldag
    6.0.0 已支持后端在 Request 表中为 GETS/PUT/DELTE 的请求配置 @combine,感谢 @cloudAndMonkey 的贡献
    #493

  8. TommyLemon
    closed this as completedon Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Question 使用问题使用问题使用问题help wanted请求帮助请求帮助

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.