Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/config.py
# Copyright (C) 2017-2020 The Software Heritage developers | # Copyright (C) 2017-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import os | import os | ||||
from typing import Any, Dict | from typing import Any, Dict | ||||
from swh.core import config | from swh.core import config | ||||
from swh.deposit import __version__ | from swh.deposit import __version__ | ||||
from swh.model.model import MetadataAuthority, MetadataAuthorityType, MetadataFetcher | |||||
from swh.scheduler import get_scheduler | from swh.scheduler import get_scheduler | ||||
from swh.scheduler.interface import SchedulerInterface | from swh.scheduler.interface import SchedulerInterface | ||||
from swh.storage import get_storage | from swh.storage import get_storage | ||||
from swh.storage.interface import StorageInterface | from swh.storage.interface import StorageInterface | ||||
# IRIs (Internationalized Resource identifier) sword 2.0 specified | # IRIs (Internationalized Resource identifier) sword 2.0 specified | ||||
EDIT_IRI = "edit_iri" | EDIT_IRI = "edit_iri" | ||||
SE_IRI = "se_iri" | SE_IRI = "se_iri" | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | def __init__(self): | ||||
"name": "swh-deposit", | "name": "swh-deposit", | ||||
"version": __version__, | "version": __version__, | ||||
"configuration": {"sword_version": "2"}, | "configuration": {"sword_version": "2"}, | ||||
} | } | ||||
self.storage: StorageInterface = get_storage(**self.config["storage"]) | self.storage: StorageInterface = get_storage(**self.config["storage"]) | ||||
self.storage_metadata: StorageInterface = get_storage( | self.storage_metadata: StorageInterface = get_storage( | ||||
**self.config["storage_metadata"] | **self.config["storage_metadata"] | ||||
) | ) | ||||
def swh_deposit_authority(self): | |||||
return MetadataAuthority( | |||||
moranegg: can you remind me where it is specified that the deposit authority type is a registry? | |||||
Done Inline ActionsNowhere. But it's not a forge/package-manager, and is not a deposit client. Only remaining option is registry. We could add a new authority type, eg. "witness" or "notary", but the difference with registry is probably too subtle. vlorentz: Nowhere. But it's not a forge/package-manager, and is not a deposit client. Only remaining… | |||||
type=MetadataAuthorityType.REGISTRY, | |||||
url=self.config["swh_authority_url"], | |||||
metadata={}, | |||||
) | |||||
def swh_deposit_fetcher(self): | |||||
return MetadataFetcher( | |||||
name=self.tool["name"], | |||||
version=self.tool["version"], | |||||
metadata=self.tool["configuration"], | |||||
) |
can you remind me where it is specified that the deposit authority type is a registry?