在我的超级边缘REST服务器上获取401错误

时间:2018-06-13 22:41:45

标签: rest terminal hyperledger-fabric hyperledger-composer

我目前在我的REST服务器上以管理员身份运行,但似乎我未经授权添加,删除或查询信息(我不能使用任何功能)。我更新了composer playground中的acl文件的权限,但似乎没有做任何事情。我附上了其余服务器和终端屏幕的图片,并在此处发布了权限文件的代码:

My terminal browser

Inside the ReST server using a POST function

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Access control rules for tutorial-network
 */
rule NetworkAdminUser {
    description: "Grant business network administrators full access to user resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "**"
    action: ALLOW
}

rule NetworkAdminSystem {
    description: "Grant business network administrators full access to system resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "org.hyperledger.composer.system.**"
    action: ALLOW
}

1 个答案:

答案 0 :(得分:1)

这不是ACL错误。

由于您使用的API密钥-y iplockchain,浏览器中的资源管理器GUI被锁定。您可以通过重新启动没有该选项的REST服务器来测试它。

您还可以使用curl命令(启用选项)使用以下命令进行测试:

curl -X GET --header 'x-api-key: iplockchain' 'http://localhost:3000/api/models.participantModel.certificateHolder'