autograder.api.users.auth

Authenticate as a user.

 1"""
 2Authenticate as a user.
 3"""
 4
 5import typing
 6
 7import autograder.api.common
 8import autograder.api.config
 9import autograder.model.config
10import autograder.model.user
11
12API_ENDPOINT: str = 'users/auth'
13API_WRITE: bool = False
14API_PARAMS: typing.List[autograder.api.config.APIParam] = [
15    autograder.api.config.PARAM_SERVER,
16    autograder.api.config.PARAM_USER_EMAIL,
17    autograder.api.config.PARAM_USER_PASS,
18]
19
20def send(config: autograder.model.config.Config, **kwargs: typing.Any) -> bool:
21    """ Send a request to the autograder. """
22
23    results = autograder.api.common.make_api_request(API_ENDPOINT, config, API_PARAMS, write = API_WRITE, **kwargs)
24    return bool(results.get('success', False))
API_ENDPOINT: str = 'users/auth'
API_WRITE: bool = False
def send(config: autograder.model.config.Config, **kwargs: Any) -> bool:
21def send(config: autograder.model.config.Config, **kwargs: typing.Any) -> bool:
22    """ Send a request to the autograder. """
23
24    results = autograder.api.common.make_api_request(API_ENDPOINT, config, API_PARAMS, write = API_WRITE, **kwargs)
25    return bool(results.get('success', False))

Send a request to the autograder.