nmdc-runtime 2.10.0__py3-none-any.whl → 2.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nmdc-runtime might be problematic. Click here for more details.
- nmdc_runtime/Dockerfile +167 -0
- nmdc_runtime/api/analytics.py +22 -2
- nmdc_runtime/api/core/idgen.py +36 -6
- nmdc_runtime/api/db/mongo.py +0 -12
- nmdc_runtime/api/endpoints/find.py +65 -225
- nmdc_runtime/api/endpoints/lib/linked_instances.py +180 -0
- nmdc_runtime/api/endpoints/nmdcschema.py +65 -144
- nmdc_runtime/api/endpoints/objects.py +4 -11
- nmdc_runtime/api/endpoints/operations.py +0 -27
- nmdc_runtime/api/endpoints/queries.py +22 -0
- nmdc_runtime/api/endpoints/sites.py +0 -24
- nmdc_runtime/api/endpoints/util.py +57 -35
- nmdc_runtime/api/entrypoint.sh +7 -0
- nmdc_runtime/api/main.py +84 -60
- nmdc_runtime/api/models/util.py +12 -5
- nmdc_runtime/api/openapi.py +116 -180
- nmdc_runtime/api/swagger_ui/assets/custom-elements.js +522 -0
- nmdc_runtime/api/swagger_ui/assets/script.js +247 -0
- nmdc_runtime/api/swagger_ui/assets/style.css +155 -0
- nmdc_runtime/api/swagger_ui/swagger_ui.py +34 -0
- nmdc_runtime/minter/adapters/repository.py +21 -0
- nmdc_runtime/minter/domain/model.py +20 -0
- nmdc_runtime/site/changesheets/data/OmicsProcessing-to-catted-Biosamples.tsv +1561 -0
- nmdc_runtime/site/changesheets/scripts/missing_neon_soils_ecosystem_data.py +311 -0
- nmdc_runtime/site/changesheets/scripts/neon_soils_add_ncbi_ids.py +210 -0
- nmdc_runtime/site/dagster.yaml +53 -0
- nmdc_runtime/site/entrypoint-daemon.sh +26 -0
- nmdc_runtime/site/entrypoint-dagit-readonly.sh +26 -0
- nmdc_runtime/site/entrypoint-dagit.sh +26 -0
- nmdc_runtime/site/export/ncbi_xml.py +632 -11
- nmdc_runtime/site/export/ncbi_xml_utils.py +114 -0
- nmdc_runtime/site/graphs.py +7 -0
- nmdc_runtime/site/ops.py +92 -34
- nmdc_runtime/site/repository.py +2 -0
- nmdc_runtime/site/resources.py +16 -3
- nmdc_runtime/site/translation/submission_portal_translator.py +82 -14
- nmdc_runtime/site/workspace.yaml +13 -0
- nmdc_runtime/static/NMDC_logo.svg +1073 -0
- nmdc_runtime/static/ORCID-iD_icon_vector.svg +4 -0
- nmdc_runtime/static/README.md +5 -0
- nmdc_runtime/static/favicon.ico +0 -0
- nmdc_runtime/util.py +87 -1
- nmdc_runtime-2.11.0.dist-info/METADATA +46 -0
- {nmdc_runtime-2.10.0.dist-info → nmdc_runtime-2.11.0.dist-info}/RECORD +47 -57
- {nmdc_runtime-2.10.0.dist-info → nmdc_runtime-2.11.0.dist-info}/WHEEL +1 -2
- nmdc_runtime/api/endpoints/ids.py +0 -192
- nmdc_runtime/client/__init__.py +0 -0
- nmdc_runtime/containers.py +0 -14
- nmdc_runtime/core/__init__.py +0 -0
- nmdc_runtime/core/db/Database.py +0 -13
- nmdc_runtime/core/db/__init__.py +0 -0
- nmdc_runtime/core/exceptions/__init__.py +0 -23
- nmdc_runtime/core/exceptions/base.py +0 -47
- nmdc_runtime/core/exceptions/token.py +0 -13
- nmdc_runtime/domain/__init__.py +0 -0
- nmdc_runtime/domain/users/__init__.py +0 -0
- nmdc_runtime/domain/users/queriesInterface.py +0 -18
- nmdc_runtime/domain/users/userSchema.py +0 -37
- nmdc_runtime/domain/users/userService.py +0 -14
- nmdc_runtime/infrastructure/__init__.py +0 -0
- nmdc_runtime/infrastructure/database/__init__.py +0 -0
- nmdc_runtime/infrastructure/database/db.py +0 -3
- nmdc_runtime/infrastructure/database/models/__init__.py +0 -0
- nmdc_runtime/infrastructure/database/models/user.py +0 -1
- nmdc_runtime/lib/__init__.py +0 -1
- nmdc_runtime/lib/extract_nmdc_data.py +0 -33
- nmdc_runtime/lib/load_nmdc_data.py +0 -121
- nmdc_runtime/lib/nmdc_dataframes.py +0 -825
- nmdc_runtime/lib/nmdc_etl_class.py +0 -396
- nmdc_runtime/lib/transform_nmdc_data.py +0 -1117
- nmdc_runtime/site/drsobjects/__init__.py +0 -0
- nmdc_runtime/site/drsobjects/ingest.py +0 -93
- nmdc_runtime/site/drsobjects/registration.py +0 -131
- nmdc_runtime-2.10.0.dist-info/METADATA +0 -265
- nmdc_runtime-2.10.0.dist-info/top_level.txt +0 -1
- {nmdc_runtime-2.10.0.dist-info → nmdc_runtime-2.11.0.dist-info}/entry_points.txt +0 -0
- {nmdc_runtime-2.10.0.dist-info → nmdc_runtime-2.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 16c0 8.837-7.163 16-16 16-8.838 0-16-7.163-16-16C0 7.162 7.162 0 16 0c8.837 0 16 7.162 16 16Z" fill="#A6CE39"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.813 9.637h-5.45v13.9h5.474c4.555 0 7.35-3.378 7.35-6.95 0-1.635-.562-3.372-1.77-4.704-1.215-1.336-3.065-2.246-5.605-2.246ZM18.6 21.3h-2.813v-9.425H18.5c1.823 0 3.12.552 3.96 1.4.842.849 1.252 2.021 1.252 3.312 0 .784-.239 1.967-.993 2.948-.745.969-2.01 1.765-4.119 1.765Zm5.311-4.026c-.251 1.74-1.494 4.276-5.311 4.276h-3.063H18.6c3.817 0 5.06-2.536 5.311-4.276Zm1.812-2.405c-.657-2.601-2.85-4.982-6.91-4.982h-5.2 5.2c4.06 0 6.253 2.38 6.91 4.982Zm.215 1.718ZM8.363 9.675v13.887h2.425V9.675H8.363Zm2.175 13.637H8.612h1.925ZM9.575 8.65c.84 0 1.513-.689 1.513-1.513 0-.823-.673-1.512-1.513-1.512-.838 0-1.512.674-1.512 1.513 0 .823.672 1.512 1.512 1.512Z" fill="#fff"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Static
|
|
2
|
+
|
|
3
|
+
This document contains information about the origins of the other files in this directory.
|
|
4
|
+
|
|
5
|
+
- `ORCID-iD_icon_vector.svg`: On September 27, 2025, we downloaded this SVG file from ORCID's [Brand Library](https://orcid.filecamp.com/s/o/3CCuLloCl73Knntn/VU19wHSMUnX9TD4R), which we found a link to on the [Brand Guidelines](https://info.orcid.org/brand-guidelines/) page of ORCID's website.
|
|
Binary file
|
nmdc_runtime/util.py
CHANGED
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import mimetypes
|
|
3
3
|
import os
|
|
4
4
|
import pkgutil
|
|
5
|
+
from collections import defaultdict
|
|
5
6
|
from collections.abc import Iterable
|
|
6
7
|
from copy import deepcopy
|
|
7
8
|
from datetime import datetime, timezone
|
|
@@ -13,11 +14,16 @@ from typing import Callable, List, Optional, Set, Dict
|
|
|
13
14
|
|
|
14
15
|
import fastjsonschema
|
|
15
16
|
import requests
|
|
17
|
+
from bson.son import SON
|
|
16
18
|
from frozendict import frozendict
|
|
19
|
+
from linkml_runtime import SchemaView
|
|
17
20
|
from nmdc_schema.get_nmdc_view import ViewGetter
|
|
18
21
|
from pymongo.database import Database as MongoDatabase
|
|
19
22
|
from pymongo.errors import OperationFailure
|
|
20
|
-
from refscan.lib.helpers import
|
|
23
|
+
from refscan.lib.helpers import (
|
|
24
|
+
identify_references,
|
|
25
|
+
get_collection_name_to_class_names_map,
|
|
26
|
+
)
|
|
21
27
|
from refscan.lib.ReferenceList import ReferenceList
|
|
22
28
|
from toolz import merge
|
|
23
29
|
|
|
@@ -308,6 +314,32 @@ def nmdc_schema_view():
|
|
|
308
314
|
return ViewGetter().get_view()
|
|
309
315
|
|
|
310
316
|
|
|
317
|
+
@lru_cache
|
|
318
|
+
def get_class_name_to_collection_names_map(
|
|
319
|
+
schema_view: SchemaView,
|
|
320
|
+
) -> Dict[str, List[str]]:
|
|
321
|
+
"""
|
|
322
|
+
Returns a mapping of class names to the names of the collections that can store instances of those classes/types,
|
|
323
|
+
according to the specified `SchemaView`.
|
|
324
|
+
|
|
325
|
+
Example output:
|
|
326
|
+
```
|
|
327
|
+
{
|
|
328
|
+
"Study": ["study_set"],
|
|
329
|
+
"Biosample": ["biosample_set"],
|
|
330
|
+
...
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
"""
|
|
334
|
+
class_name_to_collection_names = defaultdict(list)
|
|
335
|
+
for collection_name, class_names in get_collection_name_to_class_names_map(
|
|
336
|
+
schema_view
|
|
337
|
+
).items():
|
|
338
|
+
for class_name in class_names:
|
|
339
|
+
class_name_to_collection_names[class_name].append(collection_name)
|
|
340
|
+
return class_name_to_collection_names
|
|
341
|
+
|
|
342
|
+
|
|
311
343
|
@lru_cache
|
|
312
344
|
def nmdc_database_collection_instance_class_names():
|
|
313
345
|
names = []
|
|
@@ -362,6 +394,12 @@ def all_docs_have_unique_id(coll) -> bool:
|
|
|
362
394
|
|
|
363
395
|
|
|
364
396
|
def specialize_activity_set_docs(docs):
|
|
397
|
+
"""
|
|
398
|
+
TODO: Document this function.
|
|
399
|
+
|
|
400
|
+
TODO: Check whether this function is still necessary, given that the `Database` class
|
|
401
|
+
in `nmdc-schema` does not have a slot named `activity_set`.
|
|
402
|
+
"""
|
|
365
403
|
validation_errors = {}
|
|
366
404
|
type_collections = get_type_collections()
|
|
367
405
|
if "activity_set" in docs:
|
|
@@ -445,6 +483,49 @@ def populated_schema_collection_names_with_id_field(mdb: MongoDatabase) -> List[
|
|
|
445
483
|
return [n for n in collection_names if mdb[n].find_one({"id": {"$exists": True}})]
|
|
446
484
|
|
|
447
485
|
|
|
486
|
+
def does_collection_have_unique_index_on_id_field(
|
|
487
|
+
collection_name: str, db: MongoDatabase
|
|
488
|
+
) -> bool:
|
|
489
|
+
"""Check whether the specified MongoDB collection has a unique index on its `id` field (not `_id`).
|
|
490
|
+
|
|
491
|
+
Note: If the specified MongoDB collection either does not exist or is a _view_ instead of a collection,
|
|
492
|
+
this function will return `False`.
|
|
493
|
+
|
|
494
|
+
References:
|
|
495
|
+
- https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.list_indexes
|
|
496
|
+
- https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.index_information
|
|
497
|
+
"""
|
|
498
|
+
# Check whether the specified collection actually exists in the database; and, if it does,
|
|
499
|
+
# whether it is really a _collection_ (as opposed to being a _view_). If it doesn't exist,
|
|
500
|
+
# or it is a view, return `False` right away.
|
|
501
|
+
collection_infos_cursor = db.list_collections(filter={"name": collection_name})
|
|
502
|
+
collection_infos = list(collection_infos_cursor)
|
|
503
|
+
if len(collection_infos) == 0:
|
|
504
|
+
return False
|
|
505
|
+
collection_info = collection_infos[0]
|
|
506
|
+
if collection_info["type"] != "collection":
|
|
507
|
+
return False
|
|
508
|
+
|
|
509
|
+
# Now that we know we're dealing with a collection, get information about each of its indexes.
|
|
510
|
+
collection = db.get_collection(collection_name)
|
|
511
|
+
for index_information in collection.list_indexes():
|
|
512
|
+
# Get the "field_name-direction" pairs that make up this index.
|
|
513
|
+
field_name_and_direction_pairs: SON = index_information["key"]
|
|
514
|
+
|
|
515
|
+
# If this index involves a number of fields other than one, skip it.
|
|
516
|
+
# We're only interested in indexes that involve the `id` field by itself.
|
|
517
|
+
if len(field_name_and_direction_pairs.keys()) != 1:
|
|
518
|
+
continue
|
|
519
|
+
|
|
520
|
+
# Check whether the field this index involves is the `id` field,
|
|
521
|
+
# and whether this index is `unique`.
|
|
522
|
+
field_name = list(field_name_and_direction_pairs.keys())[0]
|
|
523
|
+
if field_name == "id" and index_information.get("unique", False):
|
|
524
|
+
return True
|
|
525
|
+
|
|
526
|
+
return False
|
|
527
|
+
|
|
528
|
+
|
|
448
529
|
def ensure_unique_id_indexes(mdb: MongoDatabase):
|
|
449
530
|
"""Ensure that any collections with an "id" field have an index on "id"."""
|
|
450
531
|
|
|
@@ -459,6 +540,11 @@ def ensure_unique_id_indexes(mdb: MongoDatabase):
|
|
|
459
540
|
if collection_name.startswith("system."): # reserved by mongodb
|
|
460
541
|
continue
|
|
461
542
|
|
|
543
|
+
# If the collection already has a unique index on `id`, there's no need
|
|
544
|
+
# to check anything else about the collection.
|
|
545
|
+
if does_collection_have_unique_index_on_id_field(collection_name, mdb):
|
|
546
|
+
continue
|
|
547
|
+
|
|
462
548
|
if (
|
|
463
549
|
collection_name in schema_collection_names_with_id_field()
|
|
464
550
|
or all_docs_have_unique_id(mdb[collection_name])
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nmdc-runtime
|
|
3
|
+
Version: 2.11.0
|
|
4
|
+
Summary: A runtime system for NMDC data management and orchestration
|
|
5
|
+
Project-URL: Changelog, https://github.com/microbiomedata/nmdc-runtime/releases
|
|
6
|
+
Project-URL: Documentation, https://docs.microbiomedata.org/runtime
|
|
7
|
+
Project-URL: Issues, https://github.com/microbiomedata/nmdc-runtime/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/microbiomedata/nmdc-runtime
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: base32-lib
|
|
12
|
+
Requires-Dist: boto3
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Requires-Dist: dagit
|
|
15
|
+
Requires-Dist: dagster
|
|
16
|
+
Requires-Dist: dagster-graphql
|
|
17
|
+
Requires-Dist: dagster-postgres
|
|
18
|
+
Requires-Dist: fastapi>=0.115.0
|
|
19
|
+
Requires-Dist: fastjsonschema
|
|
20
|
+
Requires-Dist: frozendict
|
|
21
|
+
Requires-Dist: git-root
|
|
22
|
+
Requires-Dist: jq
|
|
23
|
+
Requires-Dist: jsonasobj2
|
|
24
|
+
Requires-Dist: linkml
|
|
25
|
+
Requires-Dist: linkml-runtime
|
|
26
|
+
Requires-Dist: lxml
|
|
27
|
+
Requires-Dist: nmdc-schema==11.11.1
|
|
28
|
+
Requires-Dist: ontology-loader==0.2.2
|
|
29
|
+
Requires-Dist: pandas
|
|
30
|
+
Requires-Dist: passlib[bcrypt]
|
|
31
|
+
Requires-Dist: pydantic[email]>=1.10.0
|
|
32
|
+
Requires-Dist: pyinstrument
|
|
33
|
+
Requires-Dist: pymongo
|
|
34
|
+
Requires-Dist: python-dotenv
|
|
35
|
+
Requires-Dist: python-jose[cryptography]
|
|
36
|
+
Requires-Dist: python-multipart>=0.0.18
|
|
37
|
+
Requires-Dist: pyyaml
|
|
38
|
+
Requires-Dist: refscan==0.3.2
|
|
39
|
+
Requires-Dist: requests
|
|
40
|
+
Requires-Dist: requests-cache
|
|
41
|
+
Requires-Dist: scalar-fastapi<2.0.0,>=1.4.1
|
|
42
|
+
Requires-Dist: tenacity
|
|
43
|
+
Requires-Dist: toolz
|
|
44
|
+
Requires-Dist: tqdm
|
|
45
|
+
Requires-Dist: unidecode
|
|
46
|
+
Requires-Dist: uvicorn[standard]
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
nmdc_runtime/Dockerfile,sha256=3CyLW_4PRP-8cpwJHAiP4u_n736de-TJmi0dcVXbP1s,9257
|
|
1
2
|
nmdc_runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
3
|
nmdc_runtime/config.py,sha256=fVxcqdXv13Fa9CSRPnFIsfmvmlos8o4SFUZcmsXfX_8,2020
|
|
3
|
-
nmdc_runtime/containers.py,sha256=8m_S1wiFu8VOWvY7tyqzf-02X9gXY83YGc8FgjWzLGA,418
|
|
4
4
|
nmdc_runtime/main.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
nmdc_runtime/mongo_util.py,sha256=L6UxK_6f0wQw2NTKCUVKCp-QLhBudQczDLUdF5odbP8,2943
|
|
6
|
-
nmdc_runtime/util.py,sha256=
|
|
6
|
+
nmdc_runtime/util.py,sha256=jHrpk79XHWgarOEzSP9nAsenu5zTV2PrkdIslDeQf8I,21071
|
|
7
7
|
nmdc_runtime/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
nmdc_runtime/api/analytics.py,sha256=
|
|
9
|
-
nmdc_runtime/api/
|
|
8
|
+
nmdc_runtime/api/analytics.py,sha256=Vp-BYQZ_sqR282FLLkGUoxlieSqyXxU0DmMvjDzMVsI,3723
|
|
9
|
+
nmdc_runtime/api/entrypoint.sh,sha256=y3lZU2xPnZ3cAVK7tn0Nw-qVGElryt9fzj1IaZ5kkGw,209
|
|
10
|
+
nmdc_runtime/api/main.py,sha256=WnpM-abWDLbxj5mT116UO_45xiO7ec0LQ2ZhGdZhE78,16649
|
|
10
11
|
nmdc_runtime/api/middleware.py,sha256=GUVN26Ym9H87gaxrBs0NAMpOoA7qQfv-7UnIJOkcQkI,1703
|
|
11
|
-
nmdc_runtime/api/openapi.py,sha256=
|
|
12
|
+
nmdc_runtime/api/openapi.py,sha256=8E522L6zvhtfM_-eyTNE_Z7EwVvLQh54QUhvvSO5bj0,10159
|
|
12
13
|
nmdc_runtime/api/boot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
14
|
nmdc_runtime/api/boot/capabilities.py,sha256=9Cp_yULUeEXN7Nz-WC5XJXTaB7fhOWOCGp8mx050qgg,291
|
|
14
15
|
nmdc_runtime/api/boot/object_types.py,sha256=JL6OZw34lKkbKJJXDIiswfLmn1tkOng4ZKF6ypqWKhs,4382
|
|
@@ -16,32 +17,32 @@ nmdc_runtime/api/boot/triggers.py,sha256=fLM588CBYft_no1ENN13XSO6Cj4DB90ZKJl-1Ug
|
|
|
16
17
|
nmdc_runtime/api/boot/workflows.py,sha256=UpOAMjVKagat-PCKPx7HuriLTnCbhj0EVgpk7UuLpQQ,3826
|
|
17
18
|
nmdc_runtime/api/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
19
|
nmdc_runtime/api/core/auth.py,sha256=c38EjN3Ckd3uuR70qqTiAKF3EedZCihoVvTKBmBSRMQ,7453
|
|
19
|
-
nmdc_runtime/api/core/idgen.py,sha256=
|
|
20
|
+
nmdc_runtime/api/core/idgen.py,sha256=ru9nAczRAEp1Koq8yXLCMdkN39dNvfTrIwWwVI2SeWo,8101
|
|
20
21
|
nmdc_runtime/api/core/metadata.py,sha256=AMX-EWfyOU_xobIlDf98PTQLuNCbZuyCPCIELKAoMIk,27943
|
|
21
22
|
nmdc_runtime/api/core/util.py,sha256=OGE9kCui-wEfkfdUeUOBNeqmHJ5fNpJepBo0ivYkMnE,3232
|
|
22
23
|
nmdc_runtime/api/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
nmdc_runtime/api/db/mongo.py,sha256=
|
|
24
|
+
nmdc_runtime/api/db/mongo.py,sha256=9TfgCTvAmaKp6C7a9AkUTqkYTMYYzyM4na2Ying2ip0,19988
|
|
24
25
|
nmdc_runtime/api/db/s3.py,sha256=tRFEjjVXHMiUdZtRiq1ImvLza2s86TkgubDw3kchDOA,1046
|
|
25
26
|
nmdc_runtime/api/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
27
|
nmdc_runtime/api/endpoints/capabilities.py,sha256=AkSh8wcsVSOkkjH0kzcM2TcO2o8AuKyXGt1km_VgwVs,717
|
|
27
|
-
nmdc_runtime/api/endpoints/find.py,sha256=
|
|
28
|
-
nmdc_runtime/api/endpoints/ids.py,sha256=fuWNP9x_oVPh-VrrrkFT_wtPo-rBTDRr7dOqr1dxAt4,6713
|
|
28
|
+
nmdc_runtime/api/endpoints/find.py,sha256=AimO1vgq2DlO17yrPa1QCkEzZDbxyIBFxd09cTGbcOE,27063
|
|
29
29
|
nmdc_runtime/api/endpoints/jobs.py,sha256=waQk3A7gGIqcr2GNNX988Bxbvx5bxq-kGKmWXeNBrpY,5010
|
|
30
30
|
nmdc_runtime/api/endpoints/metadata.py,sha256=Msj7k5DxXUzXCZWcvy91T7AIFj1chhn_53Dsc44_qmc,9886
|
|
31
|
-
nmdc_runtime/api/endpoints/nmdcschema.py,sha256
|
|
31
|
+
nmdc_runtime/api/endpoints/nmdcschema.py,sha256=-bP9vL_CglQXwSC_5mO8zf4AOlehM_8mmn0ksEFZkOk,20515
|
|
32
32
|
nmdc_runtime/api/endpoints/object_types.py,sha256=dTbl3A9j9lyk186arA7cszTEKOY7vXWJO_aKYfFAV8s,1179
|
|
33
|
-
nmdc_runtime/api/endpoints/objects.py,sha256=
|
|
34
|
-
nmdc_runtime/api/endpoints/operations.py,sha256=
|
|
35
|
-
nmdc_runtime/api/endpoints/queries.py,sha256=
|
|
33
|
+
nmdc_runtime/api/endpoints/objects.py,sha256=J9cJENV8hfHjGAszft2j15OqAxDmrKhtsfJmEYHdpdE,10380
|
|
34
|
+
nmdc_runtime/api/endpoints/operations.py,sha256=iWDGoxa2w5k9tHaW0V_o6IjZZipUJqyY3OiCiYCBluA,2542
|
|
35
|
+
nmdc_runtime/api/endpoints/queries.py,sha256=2e3XiIH1dNULF42g3JHw-s0heRIjpe2rsBuIb4XhIb0,29716
|
|
36
36
|
nmdc_runtime/api/endpoints/runs.py,sha256=PWoEKCFQhWgpWklmRUjTc0UZCvDAa1i59gnPhAcZirA,3326
|
|
37
37
|
nmdc_runtime/api/endpoints/search.py,sha256=_h30mu8_Xndjggg3IllMDn5h8k92BX0ubxqRO85R0Ss,1187
|
|
38
|
-
nmdc_runtime/api/endpoints/sites.py,sha256=
|
|
38
|
+
nmdc_runtime/api/endpoints/sites.py,sha256=Cju6x1Trb25cZMc7BjumupVbpJleDf8Y3bVeuuxR4NE,6565
|
|
39
39
|
nmdc_runtime/api/endpoints/triggers.py,sha256=1DG2oEOV7zu5bT2qoeHrLNajY6K6sEGi7O7po3Bcmbk,673
|
|
40
40
|
nmdc_runtime/api/endpoints/users.py,sha256=syu_Tz05k-OAsDMhe125ofqeiCkmDMjdbRlfvRZ5_rI,7816
|
|
41
|
-
nmdc_runtime/api/endpoints/util.py,sha256=
|
|
41
|
+
nmdc_runtime/api/endpoints/util.py,sha256=gNRIFNxBBDxY-qMBnr8F8qjhkNYxJTy_IN0JQkU5wp4,28393
|
|
42
42
|
nmdc_runtime/api/endpoints/workflows.py,sha256=HWTnt-yrHp2DcrQT8BS_-SRQWNibkKNPVOpwqjS9QCA,14383
|
|
43
43
|
nmdc_runtime/api/endpoints/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
nmdc_runtime/api/endpoints/lib/helpers.py,sha256=E6pH0NtzKiSGBgIfoeukH5qeHKtxjLtCvw4F8LOacTQ,13874
|
|
45
|
+
nmdc_runtime/api/endpoints/lib/linked_instances.py,sha256=eGBStkzI4bNHqFi1wILQ0JtfolC3h1dFWd8zGDeXdXY,7226
|
|
45
46
|
nmdc_runtime/api/endpoints/lib/path_segments.py,sha256=4nIy_KrYvTc80Np3ELnT94VCk2QfR-2055fMlcbBSPw,5724
|
|
46
47
|
nmdc_runtime/api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
48
|
nmdc_runtime/api/models/capability.py,sha256=4__rqgLS4MCMjbaCM3e_ncR9KW001Klm34p2t_bp65k,262
|
|
@@ -59,60 +60,46 @@ nmdc_runtime/api/models/run.py,sha256=OhWBc6lQeEM-GSgUpvJCE2xbZQzv8kdPsEkWlL0xol
|
|
|
59
60
|
nmdc_runtime/api/models/site.py,sha256=KLLgln2KJrinUDp6ixxci1JFmcLAL4O4vEtFTZKc82U,2310
|
|
60
61
|
nmdc_runtime/api/models/trigger.py,sha256=TviQMk9-2HMZgCiaXYAF0WFnjD295jxnJLJCWsmtem4,201
|
|
61
62
|
nmdc_runtime/api/models/user.py,sha256=R_K7f2Zaajo8-gCwKwu4Ytfg063v31Yb5xQSIH_iYxw,4083
|
|
62
|
-
nmdc_runtime/api/models/util.py,sha256=
|
|
63
|
+
nmdc_runtime/api/models/util.py,sha256=koEyCBqizwHr-fzjoD_OJCN0c1n5apd3bVYdU-YWRvM,11659
|
|
63
64
|
nmdc_runtime/api/models/workflow.py,sha256=etPFP_L9DcRoIAFwvMYzLLT2WlwRG6T68-7tzNzXnQ0,326
|
|
64
65
|
nmdc_runtime/api/models/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
66
|
nmdc_runtime/api/models/lib/helpers.py,sha256=k6AihKIiQ0kg2kk_qY_VNWTb96LGkazuztARhgjHr8M,2410
|
|
66
|
-
nmdc_runtime/
|
|
67
|
-
nmdc_runtime/
|
|
68
|
-
nmdc_runtime/
|
|
69
|
-
nmdc_runtime/
|
|
70
|
-
nmdc_runtime/core/exceptions/__init__.py,sha256=s486odD0uhUuk9K7M5_NISOgRrUE5RNnDJSypA2Qe_I,520
|
|
71
|
-
nmdc_runtime/core/exceptions/base.py,sha256=G5azYv0FJvbjrpQtK90BkM-KK2f534szdwrHj9N-SNo,1343
|
|
72
|
-
nmdc_runtime/core/exceptions/token.py,sha256=7iTdfRQjfijDExd6-KJBjN7t0BGI_Kc1F6Lc-d0AsE8,293
|
|
73
|
-
nmdc_runtime/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
nmdc_runtime/domain/users/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
|
-
nmdc_runtime/domain/users/queriesInterface.py,sha256=0DjOehnsA5oKADmRKh8NTool2zoQZaejFigXHuUGoOg,476
|
|
76
|
-
nmdc_runtime/domain/users/userSchema.py,sha256=eVpsB5aSbT89XjPh2_m7ao8XyyinEC94hpZQIouV4uk,758
|
|
77
|
-
nmdc_runtime/domain/users/userService.py,sha256=b-HD7N-wWQyAux_iZsXMBFrz5_j9ygRc3qsJlm-vQGI,428
|
|
78
|
-
nmdc_runtime/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
-
nmdc_runtime/infrastructure/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
|
-
nmdc_runtime/infrastructure/database/db.py,sha256=djdqVxXvvJWtJUj4yariINcOuYOkQ_OiAYI_jGqOtM8,32
|
|
81
|
-
nmdc_runtime/infrastructure/database/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
nmdc_runtime/infrastructure/database/models/user.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
83
|
-
nmdc_runtime/lib/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
84
|
-
nmdc_runtime/lib/extract_nmdc_data.py,sha256=zodxHn1OILRYAZUcKoej5uFfzB0esA1UZVubNlzv0sg,987
|
|
85
|
-
nmdc_runtime/lib/load_nmdc_data.py,sha256=KO2cIqkY3cBCVcFIwsGokZNOKntOejZVG8ecq43NjFM,3934
|
|
86
|
-
nmdc_runtime/lib/nmdc_dataframes.py,sha256=AMtL8IoVuvT2SIac_yx49UK_EP6fiProImjjeugaOOU,28721
|
|
87
|
-
nmdc_runtime/lib/nmdc_etl_class.py,sha256=EfLm6TfXEg-wurCJe-jTJg85j9TkMdCQe1hRtc8ancg,13379
|
|
88
|
-
nmdc_runtime/lib/transform_nmdc_data.py,sha256=hij4lR3IMQRJQdL-rsP_I-m_WyFPsBMchV2MNFUkh0M,39906
|
|
67
|
+
nmdc_runtime/api/swagger_ui/swagger_ui.py,sha256=lGl4sF7MXsWbX7fiauDPKUOVSVag_WeH7ja5J_KBHg0,1887
|
|
68
|
+
nmdc_runtime/api/swagger_ui/assets/custom-elements.js,sha256=0bxUleZpdRbjFB0t0Tmg3-ReGKfnK6r3bUGjr7zW5UQ,23972
|
|
69
|
+
nmdc_runtime/api/swagger_ui/assets/script.js,sha256=tB7q6OxCLQOOd_-PMt1DjFnQgn3ticM8yemrpetZkQA,13536
|
|
70
|
+
nmdc_runtime/api/swagger_ui/assets/style.css,sha256=BucritiMpu_UJdgSdDBImFpQHMQ2SaZzUd179gZ2Zx0,4565
|
|
89
71
|
nmdc_runtime/minter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
72
|
nmdc_runtime/minter/bootstrap.py,sha256=5Ej6pJVBRryRIi0ZwEloY78Zky7iE2okF6tPwRI2axM,822
|
|
91
73
|
nmdc_runtime/minter/config.py,sha256=-E1kQXTDraabrN4CENuVCHcNJafjVdiHWeUrucxBzMQ,2741
|
|
92
74
|
nmdc_runtime/minter/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
|
-
nmdc_runtime/minter/adapters/repository.py,sha256=
|
|
75
|
+
nmdc_runtime/minter/adapters/repository.py,sha256=CVVRdGclIDBgbqaOSmSl7OkOSE43kt6zJpE-etXIkOs,9267
|
|
94
76
|
nmdc_runtime/minter/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
|
-
nmdc_runtime/minter/domain/model.py,sha256=
|
|
77
|
+
nmdc_runtime/minter/domain/model.py,sha256=k1n3O3GYfhmFdjU_oHadVTeUIxORQf-VPW4Xy6S5SCQ,3599
|
|
96
78
|
nmdc_runtime/minter/entrypoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
79
|
nmdc_runtime/minter/entrypoints/fastapi_app.py,sha256=I_lgExs6g1MRpMQdpedrnYdA1L7r_TBi4RiiD8ogrkM,4015
|
|
98
80
|
nmdc_runtime/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
99
|
-
nmdc_runtime/site/
|
|
100
|
-
nmdc_runtime/site/
|
|
101
|
-
nmdc_runtime/site/
|
|
102
|
-
nmdc_runtime/site/
|
|
81
|
+
nmdc_runtime/site/dagster.yaml,sha256=VCFx2naLjaNzP8AYr5uvzxRIf4fC0mHm7cctcYsVrNA,1204
|
|
82
|
+
nmdc_runtime/site/entrypoint-daemon.sh,sha256=kTc9dQqzR0eQ9TBZcOeeYRXBOKRe05A1INRFes-z3hw,513
|
|
83
|
+
nmdc_runtime/site/entrypoint-dagit-readonly.sh,sha256=ZY-K3l6apK8jA4mjcxePsjWb4_rh-WKz3CHmvvK_zj0,549
|
|
84
|
+
nmdc_runtime/site/entrypoint-dagit.sh,sha256=TWEIAyKyCEMHX5XnbGLO0xdhYNgeXsxgs1GFnr2Avms,537
|
|
85
|
+
nmdc_runtime/site/graphs.py,sha256=KeC6SKFNUW6SGubruFRrZsfBRN6tUfc3tp6tEst8bMU,17910
|
|
86
|
+
nmdc_runtime/site/ops.py,sha256=RainLCYEvgglHqgwJWdHu4C15W3DxKOx428vxZSIK_Q,62974
|
|
87
|
+
nmdc_runtime/site/repository.py,sha256=Kcdt293K1irWcmw7R9L-5sTEBhdoaIdgdM0mgFNrMMc,44117
|
|
88
|
+
nmdc_runtime/site/resources.py,sha256=474u5BvwKubW-oMlQNTXQ9nJTh8dU-Sr_L9k7VhYt_s,20756
|
|
103
89
|
nmdc_runtime/site/util.py,sha256=4h0X_fhjf3HdX6XDR8GvHgkrpxQY4OnZVtaOeXJVxJQ,1935
|
|
90
|
+
nmdc_runtime/site/workspace.yaml,sha256=RCw5i-v0T9MWuEZE-y1vEIJz6x2bpm1fyxheLxLEVLk,431
|
|
104
91
|
nmdc_runtime/site/backup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
92
|
nmdc_runtime/site/backup/nmdcdb_mongodump.py,sha256=My2ORKVIk_Z9wzfnIuamDe3_hv4viid9ToSJDC5J4mY,2689
|
|
106
93
|
nmdc_runtime/site/backup/nmdcdb_mongoexport.py,sha256=y1x3B4-qxF5_itXOKYaix99OvDhW_PYxhLoLc4Y5E1M,4028
|
|
107
94
|
nmdc_runtime/site/backup/nmdcdb_mongoimport.py,sha256=k6w5yscMNYoMBVkaAA9soWS0Dj2CB0FRBSFlifRO3Ro,1739
|
|
108
95
|
nmdc_runtime/site/changesheets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
96
|
nmdc_runtime/site/changesheets/base.py,sha256=lZT6WCsEBl-FsTr7Ki8_ploT93uMiVyIWWKM36aOrRk,3171
|
|
110
|
-
nmdc_runtime/site/
|
|
111
|
-
nmdc_runtime/site/
|
|
112
|
-
nmdc_runtime/site/
|
|
97
|
+
nmdc_runtime/site/changesheets/data/OmicsProcessing-to-catted-Biosamples.tsv,sha256=lfAaAhnEOBbXoGmGhVoxbbJRnUOLDtWrF6ycAOtsJFg,128790
|
|
98
|
+
nmdc_runtime/site/changesheets/scripts/missing_neon_soils_ecosystem_data.py,sha256=w7025ohUmoWxYHAl4zTFaV_Ig-CWkeeiZGlEs2J57mc,11628
|
|
99
|
+
nmdc_runtime/site/changesheets/scripts/neon_soils_add_ncbi_ids.py,sha256=OfaVAlhtd7DbH3Y5jHMGnDgOobWel4FnL3tP5BGJqaA,7969
|
|
113
100
|
nmdc_runtime/site/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
|
-
nmdc_runtime/site/export/ncbi_xml.py,sha256=
|
|
115
|
-
nmdc_runtime/site/export/ncbi_xml_utils.py,sha256=
|
|
101
|
+
nmdc_runtime/site/export/ncbi_xml.py,sha256=kDRIv_0eeXfXlpTmK6PbvQYHd1bS69fa3RfE5XpLeIM,54933
|
|
102
|
+
nmdc_runtime/site/export/ncbi_xml_utils.py,sha256=HkE3Iufoqe-9rc6gOVVaqxpz7j98O5idL027w624UwA,15423
|
|
116
103
|
nmdc_runtime/site/export/study_metadata.py,sha256=yR5pXL6JG8d7cAtqcF-60Hp7bLD3dJ0Rut4AtYc0tXA,4844
|
|
117
104
|
nmdc_runtime/site/normalization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
105
|
nmdc_runtime/site/normalization/gold.py,sha256=iISDD4qs4d6uLhv631WYNeQVOzY5DO201ZpPtxHdkVk,1311
|
|
@@ -124,15 +111,18 @@ nmdc_runtime/site/translation/neon_benthic_translator.py,sha256=CMoC56ymA0DKPkzq
|
|
|
124
111
|
nmdc_runtime/site/translation/neon_soil_translator.py,sha256=MMntFXwK62PdPNGpurTq5L3-pct7xAmUymRE2QqMPso,38572
|
|
125
112
|
nmdc_runtime/site/translation/neon_surface_water_translator.py,sha256=_-KDZzC30dQ1y57lXEKWXE6ZfGozNHxGFvbGaj4f0Lg,30536
|
|
126
113
|
nmdc_runtime/site/translation/neon_utils.py,sha256=d00o7duKKugpLHmsEifNbp4WjeC4GOqcgw0b5qlCg4I,5549
|
|
127
|
-
nmdc_runtime/site/translation/submission_portal_translator.py,sha256=
|
|
114
|
+
nmdc_runtime/site/translation/submission_portal_translator.py,sha256=351ZfV-SleRAlKEufntP68xYl_oE4b-SeFnHgMpoB1g,45284
|
|
128
115
|
nmdc_runtime/site/translation/translator.py,sha256=kVmDIVfxQ0ry6obAc_SyvlEcPwPCupYeKenRylZWWbI,3643
|
|
129
116
|
nmdc_runtime/site/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
130
117
|
nmdc_runtime/site/validation/emsl.py,sha256=OG20mv_3E2rkQqTQtYO0_SVRqFb-Z_zKCiAVbty6Wl0,671
|
|
131
118
|
nmdc_runtime/site/validation/gold.py,sha256=Z5ZzYdjERbrJ2Tu06d0TDTBSfwaFdL1Z23Rl-YkZ2Ow,803
|
|
132
119
|
nmdc_runtime/site/validation/util.py,sha256=Fz3c7dOEKOiYXssitYb50uUI1yRx3wJzFBl0s95Za7s,3632
|
|
133
|
-
nmdc_runtime
|
|
134
|
-
nmdc_runtime-
|
|
135
|
-
nmdc_runtime
|
|
136
|
-
nmdc_runtime
|
|
137
|
-
nmdc_runtime-2.
|
|
138
|
-
nmdc_runtime-2.
|
|
120
|
+
nmdc_runtime/static/NMDC_logo.svg,sha256=-13FrhQMWOg7FMprd3p6dwSOEf8xWkrHJB_P-nxGvLw,40570
|
|
121
|
+
nmdc_runtime/static/ORCID-iD_icon_vector.svg,sha256=JOKAW7lAn7Giws6aS_jBQGYG4DoPUBQ5S5mgmCSwmcA,973
|
|
122
|
+
nmdc_runtime/static/README.md,sha256=g0fitEFvZfBcSWzgjOxzDdfouBlq95xFKpAag0VPzL4,397
|
|
123
|
+
nmdc_runtime/static/favicon.ico,sha256=FsOefOmgCU9fp2f1FxKimZ8zHg7mBYj_Cv70S5VIcuI,15086
|
|
124
|
+
nmdc_runtime-2.11.0.dist-info/METADATA,sha256=_lp2sVUd9rtPOgYgMSkF6TOgmIDSV9pT-mhr8hGtjTg,1470
|
|
125
|
+
nmdc_runtime-2.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
126
|
+
nmdc_runtime-2.11.0.dist-info/entry_points.txt,sha256=JxdvOnvxHK_8046cwlvE30s_fV0-k-eTpQtkKYA69nQ,224
|
|
127
|
+
nmdc_runtime-2.11.0.dist-info/licenses/LICENSE,sha256=VWiv65r7gHGjgtr3jMJYVmQny5GRpQ6H-W9sScb1x70,2408
|
|
128
|
+
nmdc_runtime-2.11.0.dist-info/RECORD,,
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
`router` here is deprecated in favor of `nmdc_runtime.minter.entrypoints.fastapi_app.router`
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import re
|
|
6
|
-
from typing import List, Dict, Any
|
|
7
|
-
|
|
8
|
-
from fastapi import APIRouter, Depends, HTTPException
|
|
9
|
-
from pydantic import ValidationError
|
|
10
|
-
from pymongo.database import Database as MongoDatabase
|
|
11
|
-
from starlette import status
|
|
12
|
-
from toolz import dissoc
|
|
13
|
-
|
|
14
|
-
from nmdc_runtime.api.core.idgen import (
|
|
15
|
-
generate_ids,
|
|
16
|
-
decode_id,
|
|
17
|
-
collection_name,
|
|
18
|
-
)
|
|
19
|
-
from nmdc_runtime.api.core.util import raise404_if_none, pick
|
|
20
|
-
from nmdc_runtime.api.db.mongo import get_mongo_db
|
|
21
|
-
from nmdc_runtime.api.models.id import (
|
|
22
|
-
MintRequest,
|
|
23
|
-
pattern_shoulder,
|
|
24
|
-
AssignedBaseName,
|
|
25
|
-
pattern_assigned_base_name,
|
|
26
|
-
IdBindingRequest,
|
|
27
|
-
pattern_base_object_name,
|
|
28
|
-
IdThreeParts,
|
|
29
|
-
pattern_naa,
|
|
30
|
-
)
|
|
31
|
-
from nmdc_runtime.api.models.site import get_current_client_site, Site
|
|
32
|
-
|
|
33
|
-
router = APIRouter()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@router.post("/ids/mint", response_model=List[str])
|
|
37
|
-
def mint_ids(
|
|
38
|
-
mint_req: MintRequest,
|
|
39
|
-
mdb: MongoDatabase = Depends(get_mongo_db),
|
|
40
|
-
site: Site = Depends(get_current_client_site),
|
|
41
|
-
):
|
|
42
|
-
"""Generate one or more identifiers.
|
|
43
|
-
|
|
44
|
-
Leaving `populator` blank will set it to the site ID of the request client.
|
|
45
|
-
"""
|
|
46
|
-
ids = generate_ids(
|
|
47
|
-
mdb,
|
|
48
|
-
owner=site.id,
|
|
49
|
-
populator=(mint_req.populator or site.id),
|
|
50
|
-
number=mint_req.number,
|
|
51
|
-
naa=mint_req.naa,
|
|
52
|
-
shoulder=mint_req.shoulder,
|
|
53
|
-
)
|
|
54
|
-
return ids
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@router.post("/ids/bindings", response_model=List[Dict[str, Any]])
|
|
58
|
-
def set_id_bindings(
|
|
59
|
-
binding_requests: List[IdBindingRequest],
|
|
60
|
-
mdb: MongoDatabase = Depends(get_mongo_db),
|
|
61
|
-
site: Site = Depends(get_current_client_site),
|
|
62
|
-
):
|
|
63
|
-
bons = [r.i for r in binding_requests]
|
|
64
|
-
ids: List[IdThreeParts] = []
|
|
65
|
-
for bon in bons:
|
|
66
|
-
m = re.match(pattern_base_object_name, bon)
|
|
67
|
-
ids.append(
|
|
68
|
-
IdThreeParts(
|
|
69
|
-
naa=m.group("naa"),
|
|
70
|
-
shoulder=m.group("shoulder"),
|
|
71
|
-
blade=m.group("blade"),
|
|
72
|
-
)
|
|
73
|
-
)
|
|
74
|
-
# Ensure that user owns all supplied identifiers.
|
|
75
|
-
for id_, r in zip(ids, binding_requests):
|
|
76
|
-
collection = mdb.get_collection(collection_name(id_.naa, id_.shoulder))
|
|
77
|
-
doc = collection.find_one({"_id": decode_id(str(id_.blade))}, ["__ao"])
|
|
78
|
-
if doc is None:
|
|
79
|
-
raise HTTPException(
|
|
80
|
-
status_code=status.HTTP_404_NOT_FOUND,
|
|
81
|
-
detail=f"id {r.i} not found",
|
|
82
|
-
)
|
|
83
|
-
elif doc.get("__ao") != site.id:
|
|
84
|
-
raise HTTPException(
|
|
85
|
-
status_code=status.HTTP_403_FORBIDDEN,
|
|
86
|
-
detail=(
|
|
87
|
-
f"authenticated site client does not manage {r.i} "
|
|
88
|
-
f"(client represents site {site.id}).",
|
|
89
|
-
),
|
|
90
|
-
)
|
|
91
|
-
# Ensure no attempts to set reserved attributes.
|
|
92
|
-
if any(r.a.startswith("__a") for r in binding_requests):
|
|
93
|
-
raise HTTPException(
|
|
94
|
-
status_code=status.HTTP_403_FORBIDDEN,
|
|
95
|
-
detail="Cannot set attribute names beginning with '__a'.",
|
|
96
|
-
)
|
|
97
|
-
# Process binding requests
|
|
98
|
-
docs = []
|
|
99
|
-
for id_, r in zip(ids, binding_requests):
|
|
100
|
-
collection = mdb.get_collection(collection_name(id_.naa, id_.shoulder))
|
|
101
|
-
|
|
102
|
-
filter_ = {"_id": decode_id(id_.blade)}
|
|
103
|
-
if r.o == "purge":
|
|
104
|
-
docs.append(collection.find_one_and_delete(filter_))
|
|
105
|
-
elif r.o == "rm":
|
|
106
|
-
docs.append(collection.find_one_and_update(filter_, {"$unset": {r.a: ""}}))
|
|
107
|
-
elif r.o == "set":
|
|
108
|
-
docs.append(collection.find_one_and_update(filter_, {"$set": {r.a: r.v}}))
|
|
109
|
-
elif r.o == "addToSet":
|
|
110
|
-
docs.append(
|
|
111
|
-
collection.find_one_and_update(filter_, {"$addToSet": {r.a: r.v}})
|
|
112
|
-
)
|
|
113
|
-
else:
|
|
114
|
-
# Note: IdBindingRequest root_validator methods should preclude this.
|
|
115
|
-
raise HTTPException(
|
|
116
|
-
status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid operation 'o'."
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
return [dissoc(d, "_id") for d in docs]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
@router.get("/ids/bindings/{rest:path}", response_model=Dict[str, Any])
|
|
123
|
-
def get_id_bindings(
|
|
124
|
-
rest: str,
|
|
125
|
-
mdb: MongoDatabase = Depends(get_mongo_db),
|
|
126
|
-
):
|
|
127
|
-
cleaned = rest.replace("-", "")
|
|
128
|
-
parts = cleaned.split(":")
|
|
129
|
-
if len(parts) != 2:
|
|
130
|
-
raise HTTPException(
|
|
131
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
|
132
|
-
detail=(
|
|
133
|
-
"Invalid ID - needs both name assigning authority (NAA) part"
|
|
134
|
-
"(e.g. 'nmdc') and name part (e.g. 'fk4ra92'), separated by a colon (':')."
|
|
135
|
-
),
|
|
136
|
-
)
|
|
137
|
-
naa = parts[0]
|
|
138
|
-
suffix_parts = parts[1].split("/")
|
|
139
|
-
if len(suffix_parts) == 2 and suffix_parts[-1] != "": # one '/', or ends with '/'
|
|
140
|
-
assigned_base_name, attribute = suffix_parts
|
|
141
|
-
else:
|
|
142
|
-
assigned_base_name = suffix_parts[0]
|
|
143
|
-
attribute = None
|
|
144
|
-
|
|
145
|
-
if re.match(pattern_naa, naa) is None:
|
|
146
|
-
raise HTTPException(
|
|
147
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
|
148
|
-
detail=f"Invalid ID - invalid name assigning authority (NAA) '{naa}'.",
|
|
149
|
-
)
|
|
150
|
-
print(assigned_base_name)
|
|
151
|
-
if re.match(pattern_shoulder, assigned_base_name) is None:
|
|
152
|
-
raise HTTPException(
|
|
153
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
|
154
|
-
detail=(
|
|
155
|
-
"Invalid ID - invalid shoulder. "
|
|
156
|
-
"Every name part begins with a 'shoulder', a "
|
|
157
|
-
"sequence of letters followed by a number, "
|
|
158
|
-
"for example 'fk4'. "
|
|
159
|
-
"Did you forget to include the shoulder?",
|
|
160
|
-
),
|
|
161
|
-
)
|
|
162
|
-
try:
|
|
163
|
-
m = re.match(pattern_assigned_base_name, AssignedBaseName(assigned_base_name))
|
|
164
|
-
shoulder, blade = m.group("shoulder"), m.group("blade")
|
|
165
|
-
id_decoded = decode_id(blade)
|
|
166
|
-
except (AttributeError, ValidationError):
|
|
167
|
-
raise HTTPException(
|
|
168
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
|
169
|
-
detail="Invalid ID - characters used outside of base32.",
|
|
170
|
-
)
|
|
171
|
-
except ValueError:
|
|
172
|
-
raise HTTPException(
|
|
173
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
|
174
|
-
detail="Invalid ID - failed checksum. Did you copy it incorrectly?",
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
collection = mdb.get_collection(collection_name(naa, shoulder))
|
|
178
|
-
d = raise404_if_none(collection.find_one({"_id": id_decoded}))
|
|
179
|
-
d = dissoc(d, "_id")
|
|
180
|
-
if attribute is not None:
|
|
181
|
-
if attribute not in d:
|
|
182
|
-
raise HTTPException(
|
|
183
|
-
status_code=status.HTTP_404_NOT_FOUND,
|
|
184
|
-
detail=(
|
|
185
|
-
f"attribute '{attribute}' not found in "
|
|
186
|
-
f"{naa}:{assigned_base_name}."
|
|
187
|
-
),
|
|
188
|
-
)
|
|
189
|
-
rv = pick(["where", attribute], d)
|
|
190
|
-
else:
|
|
191
|
-
rv = d
|
|
192
|
-
return rv
|
nmdc_runtime/client/__init__.py
DELETED
|
File without changes
|
nmdc_runtime/containers.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"""Containers module."""
|
|
2
|
-
|
|
3
|
-
from dependency_injector import containers, providers
|
|
4
|
-
|
|
5
|
-
from nmdc_runtime.domain.users.userService import UserService
|
|
6
|
-
from nmdc_runtime.infrastructure.database.impl.mongo.models.user import (
|
|
7
|
-
UserQueries,
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Container(containers.DeclarativeContainer):
|
|
12
|
-
user_queries = providers.Singleton(UserQueries)
|
|
13
|
-
|
|
14
|
-
user_service = providers.Factory(UserService, user_queries=user_queries)
|
nmdc_runtime/core/__init__.py
DELETED
|
File without changes
|
nmdc_runtime/core/db/Database.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from contextlib import contextmanager
|
|
2
|
-
|
|
3
|
-
from motor import motor_asyncio
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Database:
|
|
7
|
-
def __init__(self, db_url: str) -> None:
|
|
8
|
-
self._client = motor_asyncio.AsyncIOMotorClient(db_url)
|
|
9
|
-
self._db = self._client["database"]
|
|
10
|
-
|
|
11
|
-
@contextmanager
|
|
12
|
-
def session(self):
|
|
13
|
-
return self._db
|
nmdc_runtime/core/db/__init__.py
DELETED
|
File without changes
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from .base import (
|
|
2
|
-
CustomException,
|
|
3
|
-
BadRequestException,
|
|
4
|
-
NotFoundException,
|
|
5
|
-
ForbiddenException,
|
|
6
|
-
UnprocessableEntity,
|
|
7
|
-
DuplicateValueException,
|
|
8
|
-
UnauthorizedException,
|
|
9
|
-
)
|
|
10
|
-
from .token import DecodeTokenException, ExpiredTokenException
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__all__ = [
|
|
14
|
-
"CustomException",
|
|
15
|
-
"BadRequestException",
|
|
16
|
-
"NotFoundException",
|
|
17
|
-
"ForbiddenException",
|
|
18
|
-
"UnprocessableEntity",
|
|
19
|
-
"DuplicateValueException",
|
|
20
|
-
"UnauthorizedException",
|
|
21
|
-
"DecodeTokenException",
|
|
22
|
-
"ExpiredTokenException",
|
|
23
|
-
]
|