修改身份:无法验证用户是否可以对类型 'user' 进行操作
Modifying an Identity: Failed to verify if user can act on type 'user'
使用 Hyperledfer Fabric 进行一些测试,我正在执行创建类型错误的新身份的任务,然后练习修改身份。但是,当我执行时:
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-client-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:
有什么想法吗?
所以要检查的关键要素是:
'peer1' is not a registrar
我 运行 在 fabric-ca-server 容器中,最后注册的用户是 type: peer
,而不是 admin。
The solution to this problem was to enroll again with an Admin user.
这通常是设置 CA 服务器时注册的第一个用户。这让我想到 last enrolled user 充当 current 用户,在该用户下执行后续命令。我不知道这种行为。
使用 Hyperledfer Fabric 进行一些测试,我正在执行创建类型错误的新身份的任务,然后练习修改身份。但是,当我执行时:
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-client-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:
有什么想法吗?
所以要检查的关键要素是:
'peer1' is not a registrar
我 运行 在 fabric-ca-server 容器中,最后注册的用户是 type: peer
,而不是 admin。
The solution to this problem was to enroll again with an Admin user.
这通常是设置 CA 服务器时注册的第一个用户。这让我想到 last enrolled user 充当 current 用户,在该用户下执行后续命令。我不知道这种行为。