Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多项目部署时 inputs 入参会被组件代码篡改 #286

Closed
wss-git opened this issue Nov 3, 2021 · 0 comments
Closed

多项目部署时 inputs 入参会被组件代码篡改 #286

wss-git opened this issue Nov 3, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@wss-git
Copy link
Member

wss-git commented Nov 3, 2021

edition: 1.0.0          #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: app       #  项目名称
access: yunxi

vars:
  region: cn-qingdao
  service:
    name: serverless-devs-custom-nodejs
    description: 'Serverless Devs示例: Express.js framework service'
    logConfig: auto
  triggers:
    - name: httpTrigger
      type: http
      config:
        authType: anonymous
        methods:
          - GET
  customDomains:
    - domainName: auto
      protocol: HTTP
      routeConfigs:
        - path: '/*'

services:
  express:
    component: devsapp/fc
    props:
      region: ${vars.region}
      service: ${vars.service}
      function:
        name: express
        description: express
        runtime: custom
        ossBucket: wss-demo
        codeUri: ./express
        handler: index.handler
        memorySize: 256
        timeout: 30
        environmentVariables:
          ENABLE_TS_REMOTE_DEBUG: "true"
      triggers: ${vars.triggers}
      customDomains: ${vars.customDomains}
  
  koa:
    component: devsapp/fc
    props:
      region: ${vars.region}
      service: ${vars.service}
      function:
        name: koa
        description: koa
        runtime: custom
        ossBucket: wss-demo
        codeUri: ./koa
        handler: index.handler
        memorySize: 256
        timeout: 30
        environmentVariables:
          ENABLE_TS_REMOTE_DEBUG: "true"
      triggers: ${vars.triggers}
      customDomains: ${vars.customDomains}

测试结果:直接操作 inputs 会污染下次执行的入参,但是在组件的入口处深拷贝一下入参就不会有问题。

更详细关联问题:devsapp/fc#371

@wss-git wss-git added the bug Something isn't working label Nov 3, 2021
@heimanba heimanba assigned xsahxl and unassigned anycodes Nov 4, 2021
@heimanba heimanba changed the title 多项目部署时 inputs 入参会被组件代码如果 多项目部署时 inputs 入参会被组件代码篡改 Nov 4, 2021
@xsahxl xsahxl closed this as completed Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants