[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pulp-list] user model added



Added only the model + base API.

Also included certificate.py for parsing certs. the API includes ability to do:

    def test_user_with_certificate(self):
        # read in the test cert and extract the UID for the subject
        # so we can compare after the user is created that it matches
test_cert = os.path.abspath(os.path.dirname(__file__)) + "/data/test_cert.pem"
        idcert = Certificate()
        idcert.read(test_cert)
        subject = idcert.subject()
        cert_uid = subject['UID']

        # Read the cert into a string off disk and create a
        # user with said certificate.  We should get back a user with an
        # id that matches the UID in the cert.
        certfile = open(test_cert)
        certstring = certfile.read()
        user = self.uapi.create('cert-test', certificate=certstring)

        # Check that they match
        self.assertEquals(user['id'], cert_uid)

I'm not even entirely sure this is what we want todo but it should get the ball rolling,
Mike

--
Mike McCune
mmccune AT redhat.com
Red Hat Engineering       | Portland, OR
Systems Management        | 650.254.4248


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]