modos.remote#
Functions related to server storage handling
Classes#
Base class that all auth implementations derive from |
|
Handle modos server endpoints. |
|
Handles storage of JWT tokens for authentication. |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
Functions#
|
|
|
Function to access metadata from one specific or all modos on a remote server |
|
Check if a path is an S3 path |
|
Request public S3 path of a specific modo or all modos matching the query string |
Module Contents#
- class modos.remote.BearerAuth[source]#
Bases:
requests.auth.AuthBaseBase class that all auth implementations derive from
- class modos.remote.EndpointManager[source]#
Handle modos server endpoints. If a modos server url is provided, it is used to detect available service urls. Alternatively, service urls can be provided explicitely if no modos server is available.
- Parameters:
modos – URL to the modos server.
services – Mapping of services to their urls.
Examples
>>> ex = EndpointManager(modos="http://modos.example.org") >>> ex.list() { 's3: 'http://s3.example.org/', 'htsget': 'http://htsget.example.org/' } >>> ex.htsget 'http://htsget.example.org' >>> ex = EndpointManager(services={"s3": "http://s3.example.org"}) >>> ex.s3 'http://s3.example.org'
- modos.remote.list_remote_items(url)[source]#
- Parameters:
url (pydantic.HttpUrl)
- Return type:
list[pydantic.HttpUrl]
- modos.remote.get_metadata_from_remote(url, modo_id=None)[source]#
Function to access metadata from one specific or all modos on a remote server
- modos.remote.get_s3_path(url, query, exact_match=False)[source]#
Request public S3 path of a specific modo or all modos matching the query string :param remote_url: Url to the remote modo server :param query: query string to specify the modo of interest :param exact_match: if True only modos with exactly that id will be returned, otherwise (default) all matching modos
- class modos.remote.JWT[source]#
Handles storage of JWT tokens for authentication.
Examples
>>> token = JWT(access_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzI5MjU2MDB9.DummySignature") >>> token.is_expired True >>> token.to_cache() >>> loaded_jwt = JWT.from_cache() >>> loaded_jwt.access_token == token.access_token True
- _expires_at: datetime.datetime | None = None[source]#
- class modos.remote.Permissions(/, **data)[source]#
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Parameters:
data (Any)
- __pydantic_complete__[source]#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]#
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]#
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- class modos.remote.S3KeySpec(/, **data)[source]#
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Parameters:
data (Any)
- __pydantic_complete__[source]#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]#
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]#
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__[source]#
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- expiration: datetime.datetime[source]#
- permissions: Permissions[source]#
- class modos.remote.S3Key(/, **data)[source]#
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Parameters:
data (Any)
- __pydantic_complete__[source]#
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]#
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]#
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]#
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]#
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]#
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]#
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]#
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.