Add get_secret script (#94)

This commit is contained in:
jbirddog 2023-01-05 16:15:20 -05:00 committed by GitHub
parent ee7394c98e
commit 70c121f1a0
1 changed files with 25 additions and 0 deletions

View File

@ -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