Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/ambassador/envoy/v3/v3tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def update_tls_cipher(self, key: str, value: List[str]) -> None:

params[key] = value

def update_validation(self, key: str, value: str) -> None:
def update_validation(self, key: str, value: str, match_typed_subject_alt_names: Optional[List[Dict[str, str]]] = None) -> None:
empty_context: EnvoyValidationContext = {}

# This looks weirder than you might expect, because self.get_common().setdefault() is a truly
Expand All @@ -118,6 +118,8 @@ def update_validation(self, key: str, value: str) -> None:

src: EnvoyCoreSource = {"filename": value}
validation[key] = src
if match_subject_alt_names is not None:
validation['match_typed_subject_alt_names'] = match_subject_alt_names

def add_context(self, ctx: IRTLSContext) -> None:
if TYPE_CHECKING:
Expand All @@ -142,6 +144,8 @@ def add_context(self, ctx: IRTLSContext) -> None:
("min_tls_version", self.update_tls_version, "tls_minimum_protocol_version"),
("max_tls_version", self.update_tls_version, "tls_maximum_protocol_version"),
("sni", self.__setitem__, "sni"),
("match_subject_alt_names", self.update_validation, "match_subject_alt_names"),

]:
value = ctx.get(ctxkey, None)

Expand Down