Skip to content
29 changes: 28 additions & 1 deletion components/renku_data_services/data_connectors/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ components:
$ref: "#/components/schemas/ETag"
keywords:
$ref: "#/components/schemas/KeywordsList"
doi:
$ref: "#/components/schemas/DOI"
publisher_name:
type: string
description: The publisher of the dataset.
publisher_url:
type: string
description: The URL for the publisher of the dataset.
required:
- id
- name
Expand Down Expand Up @@ -766,7 +774,22 @@ components:
type:
type: string
description: data type of option value. RClone has more options but they map to the ones listed here.
enum: ["int", "bool", "string", "stringArray", "Time", "Duration", "MultiEncoder", "SizeSuffix", "SpaceSepList", "CommaSepList", "Tristate", "Encoding", "Bits"]
enum:
[
"int",
"bool",
"string",
"stringArray",
"Time",
"Duration",
"MultiEncoder",
"SizeSuffix",
"SpaceSepList",
"CommaSepList",
"Tristate",
"Encoding",
"Bits",
]
required:
- name
- help
Expand Down Expand Up @@ -870,6 +893,10 @@ components:
type: string
description: Entity Tag
example: "9EE498F9D565D0C41E511377425F32F3"
DOI:
type: string
description: "A DOI."
example: "10.16904/envidat.33"
DataConnectorsGetQuery:
description: Query params for data connectors get request
allOf:
Expand Down
11 changes: 10 additions & 1 deletion components/renku_data_services/data_connectors/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2025-06-19T07:18:06+00:00
# timestamp: 2025-12-03T09:49:11+00:00

from __future__ import annotations

Expand Down Expand Up @@ -364,6 +364,15 @@ class DataConnector(BaseAPISpec):
examples=[["project", "keywords"]],
min_length=0,
)
doi: Optional[str] = Field(
None, description="A DOI.", examples=["10.16904/envidat.33"]
)
publisher_name: Optional[str] = Field(
None, description="The publisher of the dataset."
)
publisher_url: Optional[str] = Field(
None, description="The URL for the publisher of the dataset."
)


class DataConnectorPost(BaseAPISpec):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def post(self) -> BlueprintFactoryResponse:
async def _post(
_: Request, user: base_models.APIUser, body: apispec.DataConnectorPost, validator: RCloneValidator
) -> JSONResponse:
data_connector = validate_unsaved_data_connector(body, validator=validator)
data_connector = await validate_unsaved_data_connector(body, validator=validator)
result = await self.data_connector_repo.insert_namespaced_data_connector(
user=user, data_connector=data_connector
)
Expand All @@ -124,7 +124,7 @@ async def _post_global(
) -> JSONResponse:
data_connector = await prevalidate_unsaved_global_data_connector(body, validator=validator)
result, inserted = await self.data_connector_repo.insert_global_data_connector(
user=user, data_connector=data_connector, validator=validator
user=user, prevalidated_dc=data_connector, validator=validator
)
return validated_json(
apispec.DataConnector,
Expand Down Expand Up @@ -503,6 +503,9 @@ def _dump_data_connector(
description=data_connector.description,
etag=data_connector.etag,
keywords=data_connector.keywords or [],
doi=data_connector.doi,
publisher_name=data_connector.publisher_name,
publisher_url=data_connector.publisher_url,
)
return dict(
id=str(data_connector.id),
Expand Down
7 changes: 7 additions & 0 deletions components/renku_data_services/data_connectors/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Constants for data connectors."""

from typing import Final

from renku_data_services.storage.constants import ENVIDAT_V1_PROVIDER

ALLOWED_GLOBAL_DATA_CONNECTOR_PROVIDERS: Final[list[str]] = ["doi", ENVIDAT_V1_PROVIDER]
Loading
Loading