當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。