2 # an attempt to document what a driver class should provide,
3 # and implement reasonable defaults
8 def __init__ (self): pass
10 # redefine this if you want to check again records
11 # when running GetCredential
12 # This is to reflect the 'enabled' user field in planetlab testbeds
13 # expected retcod boolean
14 def is_enabled (self, record) :
17 # the following is used in Resolve (registry) when run in full mode
18 # after looking up the sfa db, we wish to be able to display
19 # testbed-specific info as well
20 # this at minima should fill in the 'researcher' field for slice records
21 # as this information is then used to compute rights
22 # roadmap: there is an intention to redesign the SFA database so as to clear up
23 # this constraint, based on the principle that SFA should not rely on the
24 # testbed database to perform such a core operation (i.e. getting rights right)
25 def augment_records_with_testbed_info (self, sfa_records):
28 # incoming record, as provided by the client to the Register API call
29 # expected retcod 'pointer'
30 # 'pointer' is typically an int db id, that makes sense in the testbed environment
31 # -1 if this feature is not relevant
32 def register (self, sfa_record, hrn, pub_key) :
35 # incoming record is the existing sfa_record
36 # expected retcod boolean, error message logged if result is False
37 def remove (self, sfa_record):
40 # incoming are the sfa_record:
41 # (*) old_sfa_record is what we have in the db for that hrn
42 # (*) new_sfa_record is what was passed in the Update call
43 # expected retcod boolean, error message logged if result is False
45 # this is confusing because a user may have several ssh keys in
46 # the planetlab database, but we need to pick one to generate its cert
47 # so as much as in principle we should be able to use new_sfa_record['keys']
48 # the manager code actually picks one (the first one), and it seems safer
49 # to pass it along rather than depending on the driver code to do the same
52 # when changing the ssh key through this method the gid gets changed too
53 # should anything be passed back to the caller in this case ?
54 def update (self, old_sfa_record, new_sfa_record, hrn, new_key):