Exemplo n.º 1
0
def test_check_token(mock_tokenmanager):
    result = authentication.check_token(username='******',
                                        roles=tuple([1]),
                                        token_nbf_time=3600,
                                        run_as=False,
                                        origin_node_type='master')
    assert result == {'valid': ANY, 'policies': ANY}
Exemplo n.º 2
0
def test_check_token(mock_tokenmanager):
    result = authentication.check_token(username='******', roles=[1], token_nbf_time=3600, run_as=False)
    assert result == {'valid': ANY, 'policies': ANY}
Exemplo n.º 3
0
def test_check_token(mock_tokenmanager):
    result = authentication.check_token('wazuh_user', [1], 3600)
    assert result == {'valid': ANY, 'policies': ANY}
Exemplo n.º 4
0
def test_check_token(mock_tokenmanager):
    result = authentication.check_token('wazuh_user', 3600)
    assert result == {'valid': ANY}

    mock_tokenmanager.return_value.__enter__().is_token_valid.assert_called_once_with(username='******',
                                                                                      token_iat_time=3600)