diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_secret.py b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_secret.py new file mode 100644 index 000000000..1715b6a14 --- /dev/null +++ b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_secret.py @@ -0,0 +1,25 @@ +"""Get_secret.""" +from typing import Any + +from spiffworkflow_backend.models.script_attributes_context import ( + ScriptAttributesContext, +) +from spiffworkflow_backend.scripts.script import Script +from spiffworkflow_backend.services.secret_service import SecretService + + +class GetSecret(Script): + """GetSecret.""" + + def get_description(self) -> str: + """Get_description.""" + return """Returns the value for a previously configured secret.""" + + def run( + self, + script_attributes_context: ScriptAttributesContext, + *args: Any, + **kwargs: Any + ) -> Any: + """Run.""" + return SecretService.get_secret(args[0]).value