Exemplo 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)
Exemplo n.º 2
0
def test_authenticate_identity_default():
    result = authenticate_entity()
    assert result.entity_type is EntityType.anon
    assert result.entity_id is None
Exemplo 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
Exemplo 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'