Mixed(Parameter(str, "Unique identifier for new GID (uuid)"),
Parameter(None, "Unique identifier (uuid) not specified")),
Parameter(str, "public-key string"),
- Parameter(str, "Request hash"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(str, "String represeneation of a GID object")
- def call(self, cred, hrn, uuid, request_hash, pubkey_str):
- self.api.auth.authenticateCred(cred, [cred, hrn, uuid], request_hash)
+ def call(self, cred, hrn, uuid, pubkey_str, request_hash=None):
+ # request hash is optional
+ self.api.auth.authenticateCred(cred, [cred, hrn, uuid, pubkey_str], request_hash)
self.api.auth.check(cred, "getcredential")
self.api.auth.verify_object_belongs_to_me(hrn)
self.api.auth.verify_object_permission(hrn)
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to instantiate"),
Parameter(str, "Resource specification"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, hrn, requested_rspec, request_hash, caller_cred=None):
+ def call(self, cred, hrn, requested_rspec, request_hash=None, caller_cred=None):
if caller_cred==None:
caller_cred=cred
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to delete"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, hrn, request_hash, caller_cred=None):
+ def call(self, cred, hrn, request_hash=None, caller_cred=None):
if caller_cred==None:
caller_cred=cred
Mixed(Parameter(str, "Human readable name (hrn)"),
Parameter(None, "hrn not specified")),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [Parameter(dict, "Aggregate interface information")]
Mixed(Parameter(str, "credential"),
Parameter(None, "No credential")),
Parameter(str, "Human readable name (hrn)"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(str, "String representation of a credential object")
- def call(self, cred, type, hrn, request_hash):
+ def call(self, cred, type, hrn, request_hash=None):
if not cred:
return self.get_self_credential(type, hrn, request_hash)
- # authenticate the cred
self.api.auth.authenticateCred(cred, [cred, type, hrn], request_hash)
self.api.auth.check(cred, 'getcredential')
self.api.auth.verify_object_belongs_to_me(hrn)
accepts = [
Parameter(str, "Certificate string"),
- Parameter(str, "Human readable name (hrn)"),
- Parameter(str, "Request hash")
+ Parameter(str, "Human readable name (hrn)"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [Parameter(dict, "Aggregate interface information")]
- def call(self, cert, hrn, type, requestHash):
+ def call(self, cert, hrn, type, request_hash=None):
self.api.auth.verify_object_belongs_to_me(hrn)
certificate = Certificate(string=cert)
raise ConnectionKeyGIDMismatch(gid.get_subject())
# authenticate the gid
- self.api.auth.authenticateGid(gidStr, [cert, hrn, type], requestHash)
+ self.api.auth.authenticateGid(gidStr, [cert, hrn, type], request_hash)
return gidStr
Mixed(Parameter(str, "Human readable name (hrn)"),
Parameter(None, "hrn not specified")),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [Parameter(dict, "Registry interface information")]
interfaces = [interface for interface in registries.interfaces if interface['hrn'] in hrn_list]
return interfaces
- return registries.interfaces
Parameter(str, "Credential string"),
Mixed(Parameter(str, "Human readable name (hrn)"),
Parameter(None, "hrn not specified")),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(str, "String representatin of an rspec")
accepts = [
Parameter(str, "certificate"),
Parameter(str, "Human readable name (hrn)"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(str, "String representation of a credential object")
- def call(self, cert, type, hrn, request_hash):
+ def call(self, cert, type, hrn, request_hash=None):
"""
get_self_credential a degenerate version of get_credential used by a client
to get his initial credential when de doesnt have one. This is the same as
raise PermissionError(gid.get_hrn() + " has no rights to " + record.get_name())
# authenticate the gid
- gid = record.get_gid_object()
- gid_str = gid.save_to_string(save_parents=True)
- self.api.auth.authenticateGid(gid_str, [cert, type, hrn], request_hash)
+ if request_hash:
+ gid = record.get_gid_object()
+ gid_str = gid.save_to_string(save_parents=True)
+ self.api.auth.authenticateGid(gid_str, [cert, type, hrn], request_hash)
# authenticate the certificate
certificate = Certificate(string=cert)
accepts = [
Parameter(str, "Credential string"),
- Parameter(str, "Request hash")
+ Parameter(str, "Request hash"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [Parameter(str, "Human readable slice name (hrn)")]
- def call(self, cred, request_hash):
+ def call(self, cred, request_hash=None):
self.api.auth.authenticateCred(cred, [cred], request_hash)
self.api.auth.check(cred, 'listslices')
slices = Slices(self.api)
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to retrive a ticket for (hrn)"),
- Parameter(str, "Resource specification (rspec)")
+ Parameter(str, "Resource specification (rspec)"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(str, "String represeneation of a ticket object")
- def call(self, cred, hrn, rspec):
+ def call(self, cred, hrn, rspec, request_hash=None):
+ self.api.auth.authenticateCred(cred, [cred, hrn, rspec], request_hash)
self.api.auth.check(cred, "getticket")
self.api.auth.verify_object_belongs_to_me(hrn)
self.api.auth.verify_object_permission(name)
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name (hrn)"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [GeniRecord]
- def call(self, cred, hrn, request_hash, caller_cred=None):
+ def call(self, cred, hrn, request_hash=None, caller_cred=None):
self.api.auth.authenticateCred(cred, [cred, hrn], request_hash)
self.api.auth.check(cred, 'list')
if caller_cred==None:
accepts = [
Parameter(str, "Credential string"),
Parameter(dict, "Record dictionary containing record fields"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "String representation of gid object")
- def call(self, cred, record_dict, request_hash, caller_cred=None):
+ def call(self, cred, record_dict, request_hash=None, caller_cred=None):
# This cred will be an authority cred, not a user, so we cant use it to
# authenticate the caller's request_hash. Let just get the caller's gid
# from the cred and authenticate using that
accepts = [
Parameter(str, "Credential string"),
- Parameter(dict, "Record dictionary containing record fields")
- Parameter(str, "Request hash")
+ Parameter(dict, "Record dictionary containing record fields"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, record_dict, request_hash, caller_cred=None):
+ def call(self, cred, record_dict, request_hash=None, caller_cred=None):
self.api.auth.authenticateCred(cred, [cred], request_hash)
self.api.auth.check(cred, "register")
if caller_cred==None:
Parameter(str, "Credential string"),
Parameter(str, "Record type"),
Parameter(str, "Human readable name (hrn) of record to be removed"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, type, hrn, request_hash, caller_cred=None):
+ def call(self, cred, type, hrn, request_hash=None, caller_cred=None):
if caller_cred==None:
caller_cred=cred
accepts = [
Parameter(str, "Credential string"),
- Parameter(dict, "Record dictionary")
- Parameter(str, "Request hash"),
+ Parameter(dict, "Record dictionary"),
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, record, request_hash, caller_cred=None):
+ def call(self, cred, record, request_hash=None, caller_cred=None):
if caller_cred==None:
caller_cred=cred
#log the call
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to instantiate"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, hrn, request_hash):
+ def call(self, cred, hrn, request_hash=None):
# This cred will be an authority cred, not a user, so we cant use it to
# authenticate the caller's request_hash. Let just get the caller's gid
# from the cred and authenticate using that
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name (hrn)"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [GeniRecord]
- def call(self, cred, hrn, request_hash, caller_cred=None):
+ def call(self, cred, hrn, request_hash=None, caller_cred=None):
self.api.auth.authenticateCred(cred, [cred, hrn], request_hash)
self.api.auth.check(cred, 'resolve')
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to instantiate"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = [Parameter(int, "1 if successful")]
- def call(self, cred, hrn, request_hash):
+ def call(self, cred, hrn, request_hash=None):
# This cred will be an slice cred, not a user, so we cant use it to
# authenticate the caller's request_hash. Let just get the caller's gid
# from the cred and authenticate using that
accepts = [
Parameter(str, "Credential string"),
Parameter(str, "Human readable name of slice to instantiate"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, hrn, request_hash):
+ def call(self, cred, hrn, request_hash=None):
# This cred will be an slice cred, not a user, so we cant use it to
# authenticate the caller's request_hash. Let just get the caller's gid
# from the cred and authenticate using that
accepts = [
Parameter(str, "Credential string"),
Parameter(dict, "Record dictionary to be updated"),
- Parameter(str, "Request hash")
+ Mixed(Parameter(str, "Request hash"),
+ Parameter(None, "Request hash not specified"))
]
returns = Parameter(int, "1 if successful")
- def call(self, cred, record_dict, request_hash, caller_cred=None):
+ def call(self, cred, record_dict, request_hash=None, caller_cred=None):
if caller_cred==None:
caller_cred=cred
if object_gid:
object_gid.verify_chain(self.trusted_cert_list)
- def authenticateGid(self, gidStr, argList, requestHash):
+ def authenticateGid(self, gidStr, argList, requestHash=None):
gid = GID(string = gidStr)
self.validateGid(gid)
- self.verifyGidRequestHash(gid, requestHash, argList)
+ # request_hash is optional
+ if requestHash:
+ self.verifyGidRequestHash(gid, requestHash, argList)
return gid
- def authenticateCred(self, credStr, argList, requestHash):
+ def authenticateCred(self, credStr, argList, requestHash=None):
cred = Credential(string = credStr)
self.validateCred(cred)
- self.verifyCredRequestHash(cred, requestHash, argList)
+ # request hash is optional
+ if requestHash:
+ self.verifyCredRequestHash(cred, requestHash, argList)
return cred
def authenticateCert(self, certStr, requestHash):