Esempio n. 1
0
 def entity(self) -> Entity:
     """A representation of the authenticated requesting user.
     """
     creds = self._get_auth_declarations(self.auth)
     return authenticate_entity(**creds)
Esempio n. 2
0
def test_authenticate_identity_default():
    result = authenticate_entity()
    assert result.entity_type is EntityType.anon
    assert result.entity_id is None
Esempio n. 3
0
def test_authenticate_identity_no_entity_type():
    result = authenticate_entity(entity_id='foo')
    assert result.entity_type is EntityType.anon
    assert result.entity_id is None
Esempio n. 4
0
def test_authenticate_identity_type_and_entity_provided():
    result = authenticate_entity(entity_type=EntityType.user, entity_id='foo')
    assert result.entity_type is EntityType.user
    assert result.entity_id is 'foo'