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


Python Credential.dump_string方法代码示例

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


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

示例1: log_invalid_cred

# 需要导入模块: from sfa.trust.credential import Credential [as 别名]
# 或者: from sfa.trust.credential.Credential import dump_string [as 别名]
 def log_invalid_cred(cred):
     if not isinstance (cred, StringTypes):
         logger.info("cannot validate credential %s - expecting a string"%cred)
         error="checkCredentials: expected a string, received %s"%(type(cred))
     else:
         cred_obj=Credential(string=cred)
         logger.info("failed to validate credential - dump=%s"%\
                     cred_obj.dump_string(dump_parents=True))
         error = sys.exc_info()[:2]
     return error
开发者ID:kongseokhwan,项目名称:sfa,代码行数:12,代码来源:auth.py

示例2: checkCredentials

# 需要导入模块: from sfa.trust.credential import Credential [as 别名]
# 或者: from sfa.trust.credential.Credential import dump_string [as 别名]
 def checkCredentials(self, creds, operation, hrn = None):
     valid = []
     if not isinstance(creds, list):
         creds = [creds]
     logger.debug("Auth.checkCredentials with %d creds"%len(creds))
     for cred in creds:
         try:
             self.check(cred, operation, hrn)
             valid.append(cred)
         except:
             cred_obj=Credential(string=cred)
             logger.debug("failed to validate credential - dump=%s"%cred_obj.dump_string(dump_parents=True))
             error = sys.exc_info()[:2]
             continue
         
     if not len(valid):
         raise InsufficientRights('Access denied: %s -- %s' % (error[0],error[1]))
     
     return valid
开发者ID:tubav,项目名称:sfa,代码行数:21,代码来源:auth.py

示例3: log_invalid_cred

# 需要导入模块: from sfa.trust.credential import Credential [as 别名]
# 或者: from sfa.trust.credential.Credential import dump_string [as 别名]
 def log_invalid_cred(cred):
     cred_obj=Credential(string=cred)
     logger.debug("failed to validate credential - dump=%s"%cred_obj.dump_string(dump_parents=True))
     error = sys.exc_info()[:2]
     return error
开发者ID:aquila,项目名称:sfa,代码行数:7,代码来源:auth.py


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