schrodinger.application.livedesign.credentials module¶
File backed credentials for LiveDesign
The file is a YAML with the following structure:
version: 0.1
credentials:
- host: https://livedesign.example.com
refresh_token: <token>
- host: https://livedesign2.example.com
refresh_token: <token>
This module can also be run as a CLI to store credentials:
$SCHRODINGER/run python3 -m schrodinger.application.livedesign.credentials \
--host https://livedesign.example.com --username alice
- class schrodinger.application.livedesign.credentials.Credential(*, host: str, refresh_token: str)¶
Bases:
BaseModelA LiveDesign refresh-token credential scoped to a single host
- host: str¶
- refresh_token: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class schrodinger.application.livedesign.credentials.CredentialsConfig(*, version: str = '0.1', credentials: list[Credential])¶
Bases:
BaseModel- version: str¶
- credentials: list[Credential]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class schrodinger.application.livedesign.credentials.CredentialsStore(path: pathlib.Path | None = None)¶
Bases:
objectRead, write, and update LiveDesign credentials.
- __init__(path: pathlib.Path | None = None)¶
- Parameters:
path – Override the default credential file path
- get(ld_host: str) Credential | None¶
Look up the stored credential for a host.
- Parameters:
ld_host – LiveDesign host URL.
- add(credential: Credential)¶
Add a credential, overwriting any existing entry for the same host.
- Parameters:
credential – Credential to store (matched by host).
- schrodinger.application.livedesign.credentials.get_parser() ArgumentParser¶
- schrodinger.application.livedesign.credentials.main(args: list[str] | None = None)¶
CLI entry point: authenticate and store a refresh token.