keystone.tests.unit.token package

Submodules

keystone.tests.unit.token.test_fernet_provider module

class keystone.tests.unit.token.test_fernet_provider.TestFernetKeyRotation(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

assertRepositoryState(expected_size)[source]

Validate the state of the key repository.

assertUniqueRepositoryState()[source]

Ensure that the current key repo state has not been seen before.

property key_repository_signature

Create a “thumbprint” of the current key repository.

Because key files are renamed, this produces a hash of the contents of the key files, ignoring their filenames.

The resulting signature can be used, for example, to ensure that you have a unique set of keys after you perform a key rotation (taking a static set of keys, and simply shuffling them, would fail such a test).

property key_repository_size

The number of keys in the key repository.

property keys

Key files converted to numbers.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_non_numeric_files()[source]
test_rotation()[source]
test_rotation_disk_write_fail()[source]
test_rotation_empty_file()[source]
class keystone.tests.unit.token.test_fernet_provider.TestFernetTokenProvider(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_invalid_token_raises_token_not_found()[source]
class keystone.tests.unit.token.test_fernet_provider.TestLoadKeys(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

assertValidFernetKeys(keys)[source]
test_empty_files()[source]
test_non_numeric_files()[source]
class keystone.tests.unit.token.test_fernet_provider.TestPayloads(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

assertTimestampsEqual(expected, actual)[source]
test_app_cred_scoped_payload_with_16_char_non_uuid_ids()[source]
test_app_cred_scoped_payload_with_non_uuid_ids()[source]
test_convert_or_decode_binary_type()[source]
test_convert_or_decode_text_type()[source]
test_convert_or_decode_uuid_bytes()[source]
test_domain_scoped_payload()[source]
test_domain_scoped_payload_with_16_char_non_uuid_user_id()[source]
test_domain_scoped_payload_with_default_domain()[source]
test_domain_scoped_payload_with_non_uuid_user_id()[source]
test_federated_domain_scoped_payload()[source]
test_federated_payload_with_16_char_non_uuid_ids()[source]
test_federated_payload_with_non_uuid_ids()[source]
test_federated_project_scoped_payload()[source]
test_oauth_scoped_payload()[source]
test_project_scoped_payload()[source]
test_project_scoped_payload_with_16_char_non_uuid_ids()[source]
test_project_scoped_payload_with_binary_encoded_ids()[source]
test_project_scoped_payload_with_non_uuid_ids()[source]
test_strings_can_be_converted_to_bytes()[source]
test_system_scoped_payload()[source]
test_time_string_to_float_conversions()[source]
test_trust_scoped_payload()[source]
test_trust_scoped_payload_with_16_char_non_uuid_ids()[source]
test_trust_scoped_payload_with_non_uuid_ids()[source]
test_unscoped_payload()[source]
test_unscoped_payload_with_16_char_non_uuid_user_id()[source]
test_unscoped_payload_with_non_uuid_user_id()[source]
test_uuid_hex_to_byte_conversions()[source]
class keystone.tests.unit.token.test_fernet_provider.TestTokenFormatter(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

test_create_validate_federated_scoped_token_non_uuid_user_id()[source]
test_create_validate_federated_unscoped_token_non_uuid_user_id()[source]
test_restore_padding()[source]
class keystone.tests.unit.token.test_fernet_provider.TestValidate(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

config_overrides()[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_validate_v3_token_federated_info()[source]
test_validate_v3_token_federated_info_empty_group()[source]
test_validate_v3_token_simple()[source]
test_validate_v3_token_trust()[source]
test_validate_v3_token_validation_error_exc()[source]
class keystone.tests.unit.token.test_fernet_provider.TestValidateWithoutCache(*args, **kwargs)[source]

Bases: keystone.tests.unit.token.test_fernet_provider.TestValidate

config_overrides()[source]

keystone.tests.unit.token.test_jws_provider module

class keystone.tests.unit.token.test_jws_provider.TestJWSProvider(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_empty_public_key_repo_raises_system_exception()[source]
test_invalid_token_raises_token_not_found()[source]
test_non_existent_private_key_raises_system_exception()[source]
test_non_existent_public_key_repo_raises_system_exception()[source]
test_unable_to_verify_token_with_missing_public_key()[source]
test_verify_token_with_multiple_public_keys_present()[source]

keystone.tests.unit.token.test_token_serialization module

class keystone.tests.unit.token.test_token_serialization.TestTokenSerialization(*args, **kwargs)[source]

Bases: keystone.tests.unit.base_classes.TestCaseWithBootstrap

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_error_handling_in_deserialize(handler_mock)[source]
test_serialize_and_deserialize_token_model()[source]

Module contents