Beispiel #1
0
 def dehydrate_sslkey(self, sslkey):
     return {
         "id": sslkey.id,
         "display": sslkey.display_html(),
         "user": sslkey.user.id,
         "key": sslkey.key,
         "updated": dehydrate_datetime(sslkey.updated),
         "created": dehydrate_datetime(sslkey.created),
     }
Beispiel #2
0
 def dehydrate_sshkey(self, sshkey):
     keysource = None
     if sshkey.keysource is not None:
         keysource = {
             "protocol": sshkey.keysource.protocol,
             "auth_id": sshkey.keysource.auth_id,
         }
     data = {
         "id": sshkey.id,
         "display": sshkey.display_html(70),
         "user": sshkey.user.id,
         "key": sshkey.key,
         "keysource": keysource,
         "updated": dehydrate_datetime(sshkey.updated),
         "created": dehydrate_datetime(sshkey.created),
     }
     return data