【问题标题】:Hyper Ledger Composer , call REST API server side or client sideHyperledger Composer ,调用 REST API 服务器端或客户端
【发布时间】:2018-03-21 10:03:54
【问题描述】:

我正在开发 Hyper Ledger Composer 并将 REST API 集成到 nodejs Web 应用程序中“使用 js 客户端调用 API” 我想知道如何保持某些界面私有并防止显示和发布到它。 我应该简单地调用api服务器端还是有一种优雅的方式?

【问题讨论】:

  • 您的 Node JS 应用程序是 REST 客户端。您的应用程序用户将使用业务网络卡(本地或在云中,例如使用云对象数据存储,例如 Redis 存储(例如))来访问业务网络。您是在谈论:保护用户 -> 应用程序和应用程序 -> REST 服务器之间的“接口”吗?您的问题需要上下文,并且不清楚。传输层安全连接的 TLS 安全性显然是满足您的要求的方法。
  • @PaulO'Mahony,非常感谢您的回复,实际上我应该使用 HLC REST API:REST API -> Web 客户端“在这种情况下如何避免访问某些接口”或 REST API -> 服务器端 nodejs -> web 客户端,再次感谢你,我还是很困惑

标签: hyperledger-composer


【解决方案1】:

要保护对 REST APIS 的访问,您可以实施身份验证策略 - 请参阅此处 https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.htmlhttps://hyperledger.github.io/composer/integrating/enabling-multiuser.html(后者要求启用身份验证)。

此处显示了有关使用此类策略的教程(例如,使用 Google OAUTH2 作为身份验证提供程序)-> https://hyperledger.github.io/composer/next/tutorials/google_oauth2_rest

【讨论】:

    【解决方案2】:

    还有另一种方法可以使用 NodeJs sdk 开发自己的 rest api。 您可以使用 Cards 连接到网络,并使用 BusinessNetworkConnection 类和工厂对象执行任何操作。

    阅读 [https://hyperledger.github.io/composer/v0.16/applications/node][1]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多