18 from typing
import Any, List, Optional, TypeVar, Type
24 from ..parameter_type
import ParameterType
25 from ..base_list_parameter
import BaseListParameter
26 from ....secret
import Secret
29 T = TypeVar(
"T", bound = Secret)
32 class ListSecretParameter(BaseListParameter[List[str]]):
39 value: Optional[List[str]],
40 dataType: ParameterType,
45 self._secretType = secretType
47 super().__init__(name, description, value, dataType, required, type)
50 def listTypes(self) -> List[type]:
53 def parseValue(self, type_: ProjectType) -> Optional[Any]:
54 if self.value
is None:
57 if "CTX_NODE_ACCESS_TOKEN" in os.environ:
58 nodeAccessToken = os.environ[
"CTX_NODE_ACCESS_TOKEN"]
59 return [self._secretType.fetchNodeSecret(secret, nodeAccessToken)
for secret
in self.value]
61 return [self._secretType.fetchByName(secret)
for secret
in self.value]