当前位置: 首页>>代码示例>>Python>>正文


Python Authoriser.isValidRole方法代码示例

本文整理汇总了Python中indy_common.auth.Authoriser.isValidRole方法的典型用法代码示例。如果您正苦于以下问题:Python Authoriser.isValidRole方法的具体用法?Python Authoriser.isValidRole怎么用?Python Authoriser.isValidRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在indy_common.auth.Authoriser的用法示例。


在下文中一共展示了Authoriser.isValidRole方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from indy_common.auth import Authoriser [as 别名]
# 或者: from indy_common.auth.Authoriser import isValidRole [as 别名]
    def __init__(self,
                 identifier: Identifier,
                 trust_anchor: Identifier=None,
                 verkey=None,
                 role=None,
                 last_synced=None,
                 seq_no=None):
        """

        :param identifier:
        :param trust_anchor:
        :param verkey:
        :param role: If role is explicitly passed as `null` then in the request
         to ledger, `role` key would be sent as None which would stop the
         Identity's ability to do any privileged actions. If role is not passed,
          `role` key will not be included in the request to the ledger
        :param last_synced:
        :param seq_no:
        """

        self.identity = DidIdentity(identifier, verkey=verkey)
        self.trustAnchor = trust_anchor

        # if role and role not in (TRUST_ANCHOR, STEWARD):
        if not Authoriser.isValidRole(self.correctRole(role)):
            raise AttributeError("Invalid role {}".format(role))
        self._role = role

        # timestamp for when the ledger was last checked for key replacement or
        # revocation
        self.last_synced = last_synced

        # sequence number of the latest key management transaction for this
        # identifier
        self.seqNo = seq_no
开发者ID:chriswinc,项目名称:indy-node,代码行数:37,代码来源:identity.py

示例2: _doStaticValidationNym

# 需要导入模块: from indy_common.auth import Authoriser [as 别名]
# 或者: from indy_common.auth.Authoriser import isValidRole [as 别名]
 def _doStaticValidationNym(self, identifier, reqId, operation):
     role = operation.get(ROLE)
     nym = operation.get(TARGET_NYM)
     if not nym:
         raise InvalidClientRequest(identifier, reqId,
                                    "{} needs to be present".
                                    format(TARGET_NYM))
     if not Authoriser.isValidRole(role):
         raise InvalidClientRequest(identifier, reqId,
                                    "{} not a valid role".
                                    format(role))
开发者ID:chriswinc,项目名称:indy-node,代码行数:13,代码来源:domain_req_handler.py

示例3: role

# 需要导入模块: from indy_common.auth import Authoriser [as 别名]
# 或者: from indy_common.auth.Authoriser import isValidRole [as 别名]
 def role(self, role):
     if not Authoriser.isValidRole(self.correctRole(role)):
         raise AttributeError("Invalid role {}".format(role))
     self._role = role
开发者ID:chriswinc,项目名称:indy-node,代码行数:6,代码来源:identity.py


注:本文中的indy_common.auth.Authoriser.isValidRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。