首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >:Set变量不工作

:Set变量不工作
EN

Stack Overflow用户
提问于 2022-11-07 19:58:43
回答 1查看 42关注 0票数 1

我是的新手。我想要实现的是将在API调用方和IBM之间的相互TLS连接中使用的客户端证书作为Client-Cert header的值传递给后端服务器。

我认为集变量可以用于此目的,但是转发到后端服务器的请求不包含Client-Cert HTTP头。

有人能帮我吗?

代码语言:javascript
复制
swagger: '2.0'
info:
  version: 1.0.0
  title: test
  x-ibm-name: test
basePath: /test
x-ibm-configuration:
  properties:
    target-url:
      value: https://httpdump.io/tqvg_
      description: URL of the proxy policy
      encoded: false
  cors:
    enabled: true
  gateway: datapower-api-gateway
  type: rest
  phase: realized
  enforced: true
  testable: true
  assembly:
    execute:
      - set-variable:
          version: 2.0.0
          title: client-cert
          actions:
            - value: ':$(application.certificate.Base64):'
              type: string
              add: Client-Cert
            - value: My-Value
              add: My-Header
              type: string
          description: >-
            Set the client certificate used in the mutual TLS connection to the
            Client-Cert HTTP header in the format defined in "Client-Cert HTTP
            Header Field".
      - invoke:
          version: 2.2.0
          title: invoke
          backend-type: detect
          header-control:
            type: blocklist
            values: []
          parameter-control:
            type: blocklist
            values: []
          http-version: HTTP/1.1
          timeout: 60
          verb: POST
          chunked-uploads: true
          persistent-connection: true
          cache-response: protocol
          cache-ttl: 900
          stop-on-error: []
          websocket-upgrade: false
          target-url: $(target-url)
          graphql-send-type: detect
    finally: []
  activity-log:
    enabled: true
    success-content: activity
    error-content: payload
paths:
  /:
    get:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
    put:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
    post:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
    delete:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
    head:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
    patch:
      responses:
        '200':
          description: success
          schema:
            type: string
      consumes: []
      produces: []
schemes:
  - https
EN

回答 1

Stack Overflow用户

发布于 2022-11-27 03:12:49

您的变量名应该是message.head ers.Client-Cert,如果您想要添加一个标头。否则,您只是在创建一个永远不会被读取的内部变量。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74352261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档