18 from typing
import Any, List, Optional, TypeVar, Type
22 from ..parameter_type
import ParameterType
23 from ..base_parameter
import BaseParameter
24 from ....project
import ProjectType
25 from ....secret
import Secret
28 T = TypeVar(
"T", bound = Secret)
31 class SecretParameter(BaseParameter[str]):
39 dataType: ParameterType,
44 self._secretType = secretType
46 super().__init__(name, description, value, dataType, required, type)
49 def types(self) -> List[type]:
52 def parseValue(self, type_: ProjectType) -> Optional[Any]:
53 if self.value
is None:
56 if "CTX_NODE_ACCESS_TOKEN" in os.environ:
57 return self._secretType.fetchNodeSecret(self.value, os.environ[
"CTX_NODE_ACCESS_TOKEN"])
59 return self._secretType.fetchByName(self.value)