• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uc-cdis / indexd / 28181841506

25 Jun 2026 03:36PM UTC coverage: 87.405% (+0.003%) from 87.402%
28181841506

push

github

web-flow
Merge pull request #441 from uc-cdis/feat/drs-1.5

Feat/drs 1.5

3220 of 3684 relevant lines covered (87.4%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.86
indexd/default_settings.py
1
from .index.drivers.alchemy import SQLAlchemyIndexDriver
1✔
2
from .alias.drivers.alchemy import SQLAlchemyAliasDriver
1✔
3
from .auth.drivers.alchemy import SQLAlchemyAuthDriver
1✔
4
from .index.drivers.single_table_alchemy import SingleTableSQLAlchemyIndexDriver
1✔
5
import json
1✔
6
from os import environ
1✔
7
import json
1✔
8

9

10
CONFIG = {}
1✔
11

12
CONFIG["JSONIFY_PRETTYPRINT_REGULAR"] = False
1✔
13
AUTO_MIGRATE = True
1✔
14
# Key to lock the database during migrations
15
CONFIG["DB_MIGRATION_POSTGRES_LOCK_KEY"] = 100
1✔
16

17
USE_SINGLE_TABLE = False
1✔
18

19
# - DEFAULT_PREFIX: prefix to be prepended.
20
# - PREPEND_PREFIX: the prefix is preprended to the generated GUID when a
21
#   new record is created WITHOUT a provided GUID.
22
# - ADD_PREFIX_ALIAS: aliases are created for new records - "<PREFIX><GUID>".
23
# Do NOT set both ADD_PREFIX_ALIAS and PREPEND_PREFIX to True, or aliases
24
# will be created as "<PREFIX><PREFIX><GUID>".
25
if USE_SINGLE_TABLE is True:
1✔
26
    CONFIG["INDEX"] = {
×
27
        "driver": SingleTableSQLAlchemyIndexDriver(
28
            "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
29
            echo=True,
30
            index_config={
31
                "DEFAULT_PREFIX": "testprefix/",
32
                "PREPEND_PREFIX": True,
33
                "ADD_PREFIX_ALIAS": False,
34
            },
35
        )
36
    }
37
else:
38
    CONFIG["INDEX"] = {
1✔
39
        "driver": SQLAlchemyIndexDriver(
40
            "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
41
            echo=True,
42
            index_config={
43
                "DEFAULT_PREFIX": "testprefix/",
44
                "PREPEND_PREFIX": True,
45
                "ADD_PREFIX_ALIAS": False,
46
            },
47
        )
48
    }
49

50
CONFIG["ALIAS"] = {
1✔
51
    "driver": SQLAlchemyAliasDriver(
52
        "postgresql://postgres:postgres@localhost:5432/indexd_tests",  # pragma: allowlist secret
53
        echo=True,
54
    )
55
}
56

57

58
CONFIG["DIST"] = [
1✔
59
    {
60
        "name": "Other IndexD",
61
        "host": "https://indexd.example.io/index/",
62
        "hints": [".*ROCKS.*"],
63
        "type": "indexd",
64
    },
65
    {"name": "DX DOI", "host": "https://doi.org/", "hints": ["10\..*"], "type": "doi"},
66
    {
67
        "name": "DOS System",
68
        "host": "https://example.com/api/ga4gh/dos/v1/",
69
        "hints": [],
70
        "type": "dos",
71
    },
72
]
73

74
# Maximum number of objects in a single bulk DRS request.
75
# Used in GET /service-info response and enforced by bulk endpoints.
76
CONFIG["MAX_BULK_REQUEST_LENGTH"] = 100
1✔
77

78
CONFIG["DRS_SERVICE_INFO"] = {
1✔
79
    "name": "DRS System",
80
    "type": {
81
        "group": "org.ga4gh",
82
        "artifact": "drs",
83
        "version": "1.5.0",
84
    },
85
    "version": "1.5.0",
86
    "id": "com.example",
87
    "organization": {
88
        "name": "CTDS",
89
        "url": "http://example.com/",
90
    },
91
}
92

93
cloud_provider_map = environ.get("CLOUD_PROVIDER_MAP", None)
1✔
94
if cloud_provider_map:
1✔
95
    CONFIG["CLOUD_PROVIDER_MAP"] = json.loads(cloud_provider_map)
×
96
else:
97
    CONFIG["CLOUD_PROVIDER_MAP"] = {
1✔
98
        "s3": "aws",
99
        "gs": "gcp",
100
        "az": "azure",
101
    }
102

103
AUTH = SQLAlchemyAuthDriver(
1✔
104
    "postgresql://postgres:postgres@localhost:5432/indexd_tests"  # pragma: allowlist secret
105
)
106

107
settings = {"config": CONFIG, "auth": AUTH, "use_single_table": USE_SINGLE_TABLE}
1✔
108

109
CONFIG["DRS_AUTHORIZATION_METADATA"] = {
1✔
110
    "/gen3/programs/a/projects/b": {
111
        "supported_types": ["BearerAuth", "PassportAuth"],
112
        "passport_auth_issuers": ["https://ras/foo/bar"],
113
        "bearer_auth_issuers": ["https://gen3.datacommons.io"],
114
    }
115
}
116

117
CONFIG["DEFAULT_BEARER_ISSUER"] = "https://gen3.datacommons.io"
1✔
118
CONFIG["DEFAULT_PASSPORT_ISSUER"] = "test_passport_default"
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc