Add get_secret script (#94)
This commit is contained in:
parent
ee7394c98e
commit
70c121f1a0
|
@ -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
|
Loading…
Reference in New Issue