base¶
alchemiscale.base.api
— reusable components for API services¶
- class alchemiscale.base.api.QueryGUFEHandler(return_gufe: bool)¶
Bases:
object
Helper class to provide a single-dispatch like handling of the query operations since they can return list or dict.
- alchemiscale.base.api.minimize_scope_space(scopes: List[Scope]) List[Scope] ¶
Remove redundant Scopes from a list of Scopes.
- alchemiscale.base.api.validate_scopes(scope: Scope, token: TokenData) None ¶
Verify that token data has specified Scope encoded directly or is accessible via scope hierarchy.
- alchemiscale.base.api.validate_scopes_query(query_scope: Scope, token: TokenData, as_str: bool = False) list[alchemiscale.models.Scope] | list[str] ¶
Create the intersection of queried scopes and token, where query scopes may include ‘all’ / wildcard (None). No scopes outside of those included in token will be included in scopes returned.
If as_str is True, returns a list of str rather than list of Scopes.