【问题标题】:Failing to Integrate OpenWhisk Action that Posts to a PostgreSQL Database to API Connect无法将发布到 PostgreSQL 数据库的 OpenWhisk 操作集成到 API Connect
【发布时间】:2017-08-23 19:51:12
【问题描述】:

我正在尝试通过调用 OpenWhisk 操作在 API Connect 中创建 POST API 方法。我使用 James Thomas 的文章 Serverless APIs with OpenWhisk and API Connect 中的 GET 方法作为连接和配置设置的模板,以将 OpenWhisk 操作集成到 API 中。我正在使用的 OpenWhisk 操作已成功将输入数据发布到 Compose PostgreSQL 数据库,因此我需要做的就是正确调用它并通过 API Connect 将输入数据以正确的格式发送到 OpenWhisk 函数。 我当前在 IBM API Developer Console 上的请求和响应输出是:

Request POST https://api.us.apiconnect.ibmcloud.com/spatvis-tutorial/sb/post-trial/student Headers: Content-Type: application/json Accept: application/json X-IBM-Client-Id: ******************************** X-IBM-Client-Secret: ******************************* Response Code: 401 Unauthorized Headers: x-global-transaction-id: 114129529 content-type: application/json {}

OpenWhisk 函数没有被调用,我不知道为什么会出现安全错误。我需要什么样的凭据以及如何设置?使用Three approaches to securing access to Bluemix applications with IBM API Connect 文章中概述的 TLS、基本和自定义 HTTP 安全技术是否有意义?如果是这样,每种技术/方法的优缺点是什么?哪一种最适合用于保护对 OpenWhisk 操作的访问?

【问题讨论】:

    标签: security authorization ibm-cloud apiconnect openwhisk


    【解决方案1】:

    自该博客文章发布以来,OpenWhisk 拥有released native API Gateway integration

    可以通过 Bluemix 上的 wsk cliweb management interface 来管理连接到 HTTP 端点的操作。

    以下是使用 API Gateway 为 POST 请求创建 HTTP 端点的示例。

    $ wsk api create /api/action POST action
    ok: created API /api/action POST for action /_/action
    https://service.us.apiconnect.ibmcloud.com/gws/apigateway/api/<UUID>/api/action
    

    blog post 提供了新功能的演练。

    【讨论】:

      猜你喜欢
      • 2023-02-16
      • 2016-10-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-20
      • 2013-03-16
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      相关资源
      最近更新 更多