From 4346e3ebe6d4075404eadd2c78ff080a924bb46e Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 5 Aug 2010 00:19:25 +0000 Subject: [PATCH] removing create_gid --- sfa/methods/__init__.py | 1 - sfa/methods/create_gid.py | 56 --------------------------------------- 2 files changed, 57 deletions(-) delete mode 100644 sfa/methods/create_gid.py diff --git a/sfa/methods/__init__.py b/sfa/methods/__init__.py index 394f87c9..4e88e141 100644 --- a/sfa/methods/__init__.py +++ b/sfa/methods/__init__.py @@ -1,6 +1,5 @@ ## Please use make index to update this file all = """ -create_gid create_slice delete_slice get_aggregates diff --git a/sfa/methods/create_gid.py b/sfa/methods/create_gid.py deleted file mode 100644 index c9272045..00000000 --- a/sfa/methods/create_gid.py +++ /dev/null @@ -1,56 +0,0 @@ -### $Id$ -### $URL$ - -from sfa.trust.certificate import Keypair - -from sfa.util.faults import * -from sfa.util.namespace import * -from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed -from sfa.trust.gid import create_uuid -from sfa.trust.auth import Auth - -class create_gid(Method): - """ - Create a new GID. For MAs and SAs that are physically located on the - registry, this allows a owner/operator/PI to create a new GID and have it - signed by his respective authority. - - @param cred credential of caller - @param name hrn for new GID - @param uuid unique identifier for new GID - @param pkey_string public-key string (TODO: why is this a string and not a keypair object?) - - @return the string representation of a GID object - """ - - interfaces = ['registry'] - - accepts = [ - Parameter(str, "Credential string"), - Parameter(str, "Human readable name (hrn or urn)"), - Mixed(Parameter(str, "Unique identifier for new GID (uuid)"), - Parameter(None, "Unique identifier (uuid) not specified")), - Parameter(str, "public-key string") - ] - - returns = Parameter(str, "String represeneation of a GID object") - - def call(self, cred, xrn, uuid, pubkey_str): - - # convert urn to hrn - hrn, type = hrn_to_urn(xrn) - - # validate the credential - self.api.auth.check(cred, "getcredential") - self.api.auth.verify_object_belongs_to_me(hrn) - self.api.auth.verify_object_permission(hrn) - - if uuid == None: - uuid = create_uuid() - - pkey = Keypair() - pkey.load_pubkey_from_string(pubkey_str) - gid = self.api.auth.hierarchy.create_gid(xrn, uuid, pkey) - - return gid.save_to_string(save_parents=True) -- 2.43.0