From e82b92effa62d27ec0fa8cbbc26eacaec680aa07 Mon Sep 17 00:00:00 2001 From: Christian Boettcher <c.boettcher@fz-juelich.de> Date: Tue, 14 Dec 2021 14:17:09 +0100 Subject: [PATCH] return get secrets_values to make DLS secrets backend more lightweight --- apiserver/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apiserver/main.py b/apiserver/main.py index ff7e1e4..5b81c44 100644 --- a/apiserver/main.py +++ b/apiserver/main.py @@ -187,6 +187,15 @@ async def get_dataset_secret(location_data_type: LocationDataType, log.debug("Authenticed User: '%s' listed the secret %s of /%s/%s", user.username, key, location_data_type.value, dataset_id) return adapter.get_secret(location_data_type, dataset_id, key, user) +# differs from .../secrets by also returning the values in a dict +@app.get("/{location_data_type}/{dataset_id}/secrets_values") +@secrets_required +async def list_dataset_secrets(location_data_type: LocationDataType, dataset_id: UUID4, user: User = Depends(my_user)): + """list the secrets and valuesof a specific dataset""" + log.debug("Authenticed User: '%s' listed the secrets (key and value) of /%s/%s", user.username, location_data_type.value, dataset_id) + return adapter.get_secret_values(location_data_type, dataset_id, user) + + @app.post("/{location_data_type}/{dataset_id}/secrets") @secrets_required async def add_update_dataset_secret(location_data_type: LocationDataType, -- GitLab