API Reference¶
Adapter¶
Auth¶
Methods
- defgen_jwt
- defgen_pubkey
- defget_access_token
- defget_access_token_response
- defis_authorization
- class researchmap.adapter.Auth(client_id, client_secret, scope, *, iat: int = 30, exp: int = 30, sub=0, trial: bool = False)¶
Researchmap authentication interface.
- Parameters
- Keyword Arguments
- gen_jwt(*, exp: Optional[int] = None, iat: Optional[int] = None, sub: Optional[int] = None) bytes¶
Generate JWT.
- get_access_token(*, access_token_response: Optional[Union[list, dict]] = None) str¶
Get access token.
- Keyword Arguments
access_token_response – Access token response.
- Returns
Access token.
- Return type
- Raises
TypeError – The type of the argument is not correct.
HTTPException – An unknown HTTP related error occurred, usually when it isn’t 200 or the known incorrect credentials passing status code.
InvalidToken – Invalid token.
- get_access_token_response(*, _jwt: Optional[str] = None, **kwargs) Optional[Union[list, dict]]¶
Get access token.
- is_authorization(*, _jwt: Optional[str] = None, client_public: Optional[str] = None) bool¶
Check authorization.
- property time_exp: datetime.datetime¶
Get expire at time [aware].
- Returns
Expire at time of UTC.
- Return type
- property time_iat: datetime.datetime¶
Get issued at time [aware].
- Returns
Issued at time of UTC.
- Return type
- property time_now: datetime.datetime¶
Get current time [aware].
- Returns
Current time of UTC.
- Return type
- property token: str¶
Get token.
- Returns
Token.
- Return type
- Raises
InvalidToken – Invalid token.
json.JSONDecodeError – JSON decode error.
requests.exceptions.HTTPError – HTTP error.
RequestsAdapter¶
Methods