# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Auth.py,v 1.8 2006/11/09 19:43:55 mlhuang Exp $
+# $Id: Auth.py,v 1.9 2006/12/15 18:35:38 mlhuang Exp $
#
import crypt
from PLC.Nodes import Node, Nodes
from PLC.Sessions import Session, Sessions
from PLC.Peers import Peer, Peers
-from PLC.GPG import gpg_verify
class Auth(Parameter):
"""
for key in keys:
try:
+ from PLC.GPG import gpg_verify
gpg_verify(method.name, args, auth['signature'], key)
return
except PLCAuthenticationFailure, fault:
from types import StringTypes
+try:
+ set
+except NameError:
+ from sets import Set
+ set = Set
from PLC.Faults import *
from PLC.Parameter import Parameter, Mixed, python_type
from PLC.SliceAttributes import SliceAttribute, SliceAttributes
from PLC.Slices import Slice, Slices
-import xmlrpclib
-from PLC.PyCurl import PyCurlTransport
-from PLC.GPG import gpg_sign
-
class Peer(Row):
"""
Stores the list of peering PLCs in the peers table.
Connect to this peer via XML-RPC.
"""
+ import xmlrpclib
+ from PLC.PyCurl import PyCurlTransport
self.server = xmlrpclib.ServerProxy(self['peer_url'],
PyCurlTransport(self['peer_url'], self['cacert']),
allow_none = 1, **kwds)
"""
def wrapper(*args, **kwds):
+ from PLC.GPG import gpg_sign
signature = gpg_sign(methodname, args,
self.api.config.PLC_ROOT_GPG_KEY,
self.api.config.PLC_ROOT_GPG_KEY_PUB)
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2005 The Trustess of Princeton University
#
-# $Id: methods.py,v 1.3 2006/11/21 20:00:53 mlhuang Exp $
+# $Id: methods.py,v 1.4 2006/11/29 19:43:17 mlhuang Exp $
#
import os, sys
from PLC.Method import *
from PLC.Auth import Auth
+try:
+ set
+except NameError:
+ from sets import Set
+ set = Set
+
def php_cast(value):
"""
Casts Python values to PHP values.