# IN THE WORK.
#----------------------------------------------------------------------
-from sfa.trust.credential import Credential, append_sub
+from sfa.trust.credential import Credential, append_sub, DEFAULT_CREDENTIAL_LIFETIME
from sfa.util.sfalogging import logger
+from sfa.util.sfatime import SFATIME_FORMAT
from StringIO import StringIO
from xml.dom.minidom import Document, parseString
filename=self.get_filename()
if filename: result += "Filename %s\n"%filename
if self.expiration:
- result += "\texpiration: %s \n" % self.expiration.isoformat()
+ result += "\texpiration: %s \n" % self.expiration.strftime(SFATIME_FORMAT)
result += "\tHead: %s\n" % self.get_head()
for tail in self.get_tails():
# sounds like this should be __repr__ instead ??
# Produce the ABAC assertion. Something like [ABAC cred: Me.role<-You] or similar
- def get_summary_tostring(self):
+ def pretty_cred(self):
result = "[ABAC cred: " + str(self.get_head())
for tail in self.get_tails():
result += "<-%s" % str(tail)
if self.expiration.tzinfo is not None and self.expiration.tzinfo.utcoffset(self.expiration) is not None:
# TZ aware. Make sure it is UTC
self.expiration = self.expiration.astimezone(tz.tzutc())
- append_sub(doc, cred, "expires", self.expiration.strftime('%Y-%m-%dT%H:%M:%SZ')) # RFC3339
+ append_sub(doc, cred, "expires", self.expiration.strftime(SFATIME_FORMAT)) # RFC3339
abac = doc.createElement("abac")
rt0 = doc.createElement("rt0")