1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 """These tests assume we are running (in a docker container) with
6 arvados_pam configured and a test API server running.
11 # From services/api/test/fixtures/api_client_authorizations.yml
12 # because that file is not available during integration tests:
13 ACTIVE_TOKEN = '3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi'
14 SPECTATOR_TOKEN = 'zw2f4gwx8hw8cjre7yp6v1zylhrhn3m5gvjq73rtpwhmknrybu'
16 class IntegrationTest(unittest.TestCase):
21 self.assertTrue(self.p.authenticate('active', ACTIVE_TOKEN, service='login'))
23 def test_deny_bad_token(self):
24 self.assertFalse(self.p.authenticate('active', 'thisisaverybadtoken', service='login'))
26 def test_deny_empty_token(self):
27 self.assertFalse(self.p.authenticate('active', '', service='login'))
29 def test_deny_permission(self):
30 self.assertFalse(self.p.authenticate('spectator', SPECTATOR_TOKEN, service='login'))