Skip to content

Commit

Permalink
only apply during pretest
Browse files Browse the repository at this point in the history
  • Loading branch information
GGonryun committed Dec 5, 2024
1 parent 49c2c30 commit f7be553
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/plugins/ssh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const accessPropagationGuard = (
) => {
let isEphemeralAccessDeniedException = false;
let isLoginException = false;
let isValidError = true;
let isValidError = false;

child.stderr.on("data", (chunk) => {
const chunkString: string = chunk.toString("utf-8");
Expand All @@ -69,16 +69,15 @@ const accessPropagationGuard = (
chunkString.match(message.pattern)
);

const matchPreTestPattern = validAccessPatterns?.find((message) =>
const matchValidAccessPattern = validAccessPatterns?.find((message) =>
chunkString.match(message.pattern)
);

if (matchUnprovisionedPattern) {
isEphemeralAccessDeniedException = true;
isValidError = false;
}

if (matchPreTestPattern && !matchUnprovisionedPattern) {
if (matchValidAccessPattern && !matchUnprovisionedPattern) {
isValidError = true;
}

Expand All @@ -96,7 +95,9 @@ const accessPropagationGuard = (
isAccessPropagated: () => {
return (
!isEphemeralAccessDeniedException &&
(!validAccessPatterns?.length || isValidError)
(!options.isAccessPropagationPreTest ||
!validAccessPatterns?.length ||
isValidError)
);
},
isLoginException: () => isLoginException,
Expand Down

0 comments on commit f7be553

Please sign in to comment.