修改身份:未能验证用户是否可以对type'用户作用。

发布于 2025-01-21 20:09:09 字数 1584 浏览 5 评论 0原文

使用HyperLeDFER面料进行一些测试,我正在完成创建具有错误类型的新身份的任务,然后练习修改身份。但是,当我执行时:

fabric-ca-client register \
--id.name peer2 \
--id.affiliation org1 \
--id.type user \
--id.secret 'IAMPEER2!' \
-u http://Org1Administrator:Org1Rocks@localhost:7054

我得到:

2022/04/13 20:16:05 [INFO] Configuration file location: 
/etc/hyperledger/fabric-ca-server/fabric-ca-client-config.yaml
Error: Response from server: Error Code: 45 - Failed to verify if user
 can act on type 'user': : scode: 403, local code: 42, local msg: 'peer1' is not a registrar, 
remote code: 71, remote msg: Authorization failure

我以前能够在没有问题的情况下注册身份。我不明白为什么它不允许我注册类型用户的身份。我已经检查了Fabric-ca-ca-config.yaml,我认为没有限制:

#############################################################################
#  Registration section used to register a new identity with fabric-ca server
#
#  name - Unique name of the identity
#  type - Type of identity being registered (e.g. 'peer, app, user')
#  affiliation - The identity's affiliation
#  maxenrollments - The maximum number of times the secret can be reused to enroll.
#                   Specially, -1 means unlimited; 0 means to use CA's max enrollment
#                   value.
#  attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
  name:
  type:
  affiliation:
  maxenrollments: 0
  attributes:
   # - name:
   #   value:

有什么想法吗?

Doing some testing with Hyperledfer Fabric, I'm doing the task of creating a new identity with a wrong type, to then practice modifying the identity. However, when I execute:

fabric-ca-client register \
--id.name peer2 \
--id.affiliation org1 \
--id.type user \
--id.secret 'IAMPEER2!' \
-u http://Org1Administrator:Org1Rocks@localhost:7054

I get:

2022/04/13 20:16:05 [INFO] Configuration file location: 
/etc/hyperledger/fabric-ca-server/fabric-ca-client-config.yaml
Error: Response from server: Error Code: 45 - Failed to verify if user
 can act on type 'user': : scode: 403, local code: 42, local msg: 'peer1' is not a registrar, 
remote code: 71, remote msg: Authorization failure

I was able to register identity previously with no problems. I don't see why it's not allowing me to register an identity of type user. I've checked fabric-ca-client-config.yaml and I see no restrains to do so:

#############################################################################
#  Registration section used to register a new identity with fabric-ca server
#
#  name - Unique name of the identity
#  type - Type of identity being registered (e.g. 'peer, app, user')
#  affiliation - The identity's affiliation
#  maxenrollments - The maximum number of times the secret can be reused to enroll.
#                   Specially, -1 means unlimited; 0 means to use CA's max enrollment
#                   value.
#  attributes - List of name/value pairs of attribute for identity
#############################################################################
id:
  name:
  type:
  affiliation:
  maxenrollments: 0
  attributes:
   # - name:
   #   value:

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶葆Ⅱㄣ 2025-01-28 20:09:09

因此,要检查的关键元素是:

'PEER1'不是I登记官

我在Fabric-Ca-server容器中运行,最后一个注册的用户是类型:Peer,不是管理员

解决此问题的解决方案是再次与Admin用户一起注册。

这通常是设置CA服务器时注册的第一个用户。这使我认为上次注册的用户充当当前用户,在该用户下执行后续命令。我不知道这种行为。

So the key element to check was:

'peer1' is not a registrar

I was running within the fabric-ca-server container, and the last enrolled user was of type: peer, not admin.

The solution to this problem was to enroll again with an Admin user.

That's usually the first user registered when setting up the CA server. This led me to think that the last enrolled user acts as current user under which subsequent commands are executed. I was not aware of this behavior.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文