diff --git a/keystone/tests/unit/test_auth.py b/keystone/tests/unit/test_auth.py index e7d5d19ab1..5138db30d2 100644 --- a/keystone/tests/unit/test_auth.py +++ b/keystone/tests/unit/test_auth.py @@ -742,7 +742,7 @@ class AuthWithPasswordCredentials(AuthTest): self.controller.authenticate(self.make_request(), body_dict) -class AuthWithRemoteUser(AuthTest): +class AuthWithRemoteUser(object): def test_unscoped_remote_authn(self): """Verify getting an unscoped token with external authn.""" body_dict = _build_user_auth( @@ -823,6 +823,45 @@ class AuthWithRemoteUser(AuthTest): self.assertNotIn('bind', token['access']['token']) +class FernetAuthWithRemoteUser(AuthWithRemoteUser, AuthTest): + + def config_overrides(self): + super(FernetAuthWithRemoteUser, self).config_overrides() + self.config_fixture.config(group='token', provider='fernet') + self.useFixture(ksfixtures.KeyRepository(self.config_fixture)) + + def test_bind_with_kerberos(self): + self.config_fixture.config(group='token', bind=['kerberos']) + body_dict = _build_user_auth(tenant_name="BAR") + # NOTE(lbragstad): Bind authentication is not supported by the Fernet + # provider. + self.assertRaises(exception.NotImplemented, + self.controller.authenticate, + self.request_with_remote_user, + body_dict) + + +class UUIDAuthWithRemoteUser(AuthWithRemoteUser, AuthTest): + + def config_overrides(self): + super(UUIDAuthWithRemoteUser, self).config_overrides() + self.config_fixture.config(group='token', provider='uuid') + + +class PKIAuthWithRemoteUser(AuthWithRemoteUser, AuthTest): + + def config_overrides(self): + super(PKIAuthWithRemoteUser, self).config_overrides() + self.config_fixture.config(group='token', provider='pki') + + +class PKIZAuthWithRemoteUser(AuthWithRemoteUser, AuthTest): + + def config_overrides(self): + super(PKIZAuthWithRemoteUser, self).config_overrides() + self.config_fixture.config(group='token', provider='pkiz') + + class AuthWithTrust(AuthTest): def setUp(self): super(AuthWithTrust, self).setUp()