mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
* add external process spawner and update test cases * pass no_report to handlers * provide service api endpoints * do not spawn process for single architecture run * pass no report to handlers * make _call method of handlers public and also simplify process spawn * move update under add * implement actions from web page * clear logging & improve l&f
20 lines
637 B
Python
20 lines
637 B
Python
import pytest
|
|
|
|
from ahriman.core.auth.auth import Auth
|
|
from ahriman.core.configuration import Configuration
|
|
from ahriman.models.user import User
|
|
from ahriman.web.middlewares.auth_handler import AuthorizationPolicy
|
|
|
|
|
|
@pytest.fixture
|
|
def authorization_policy(configuration: Configuration, user: User) -> AuthorizationPolicy:
|
|
"""
|
|
fixture for authorization policy
|
|
:return: authorization policy fixture
|
|
"""
|
|
configuration.set_option("auth", "target", "configuration")
|
|
validator = Auth.load(configuration)
|
|
policy = AuthorizationPolicy(validator)
|
|
policy.validator._users = {user.username: user}
|
|
return policy
|