def add_routes(self, mapper):
        ec2_controller = controllers.Ec2Controller()
        # validation
        mapper.connect('/ec2tokens',
                       controller=ec2_controller,
                       action='authenticate',
                       conditions=dict(method=['POST']))

        # crud
        mapper.connect('/users/{user_id}/credentials/OS-EC2',
                       controller=ec2_controller,
                       action='create_credential',
                       conditions=dict(method=['POST']))
        mapper.connect('/users/{user_id}/credentials/OS-EC2',
                       controller=ec2_controller,
                       action='get_credentials',
                       conditions=dict(method=['GET']))
        mapper.connect('/users/{user_id}/credentials/OS-EC2/{credential_id}',
                       controller=ec2_controller,
                       action='get_credential',
                       conditions=dict(method=['GET']))
        mapper.connect('/users/{user_id}/credentials/OS-EC2/{credential_id}',
                       controller=ec2_controller,
                       action='delete_credential',
                       conditions=dict(method=['DELETE']))
Exemple #2
0
    def setUp(self):
        super(V2CredentialEc2Controller, self).setUp()
        self.useFixture(database.Database())
        self.load_backends()
        self.load_fixtures(default_fixtures)
        self.user_id = self.user_foo['id']
        self.project_id = self.tenant_bar['id']
        self.controller = controllers.Ec2Controller()
        self.blob, tmp_ref = unit.new_ec2_credential(
            user_id=self.user_id, project_id=self.project_id)

        self.creds_ref = (
            controllers.Ec2Controller._convert_v3_to_ec2_credential(tmp_ref))
Exemple #3
0
 def setUp(self):
     super(TestCredentialEc2, self).setUp()
     self.useFixture(database.Database())
     self.load_backends()
     self.load_fixtures(default_fixtures)
     self.user_id = self.user_foo['id']
     self.project_id = self.tenant_bar['id']
     self.blob = {'access': uuid.uuid4().hex,
                  'secret': uuid.uuid4().hex}
     self.controller = controllers.Ec2Controller()
     self.creds_ref = {'user_id': self.user_id,
                       'tenant_id': self.project_id,
                       'access': self.blob['access'],
                       'secret': self.blob['secret'],
                       'trust_id': None}
    def setUp(self):
        super(V2CredentialEc2Controller, self).setUp()
        self.useFixture(database.Database())
        self.useFixture(
            ksfixtures.KeyRepository(self.config_fixture, 'credential',
                                     credential_fernet.MAX_ACTIVE_KEYS))
        self.load_backends()
        self.load_fixtures(default_fixtures)
        self.user_id = self.user_foo['id']
        self.project_id = self.tenant_bar['id']
        self.controller = controllers.Ec2Controller()
        self.blob, tmp_ref = unit.new_ec2_credential(
            user_id=self.user_id, project_id=self.project_id)

        self.creds_ref = (
            controllers.Ec2Controller._convert_v3_to_ec2_credential(tmp_ref))