Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(elasticloadbalancingv2): ALB auth return internal server error #24510

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable @typescript-eslint/no-require-imports */
import { execSync } from 'child_process';

const url = process.env.TEST_URL;
const setupBrowser = async () => {
execSync('HOME=/tmp npm install puppeteer-core @sparticuz/chromium --omit=dev --no-package-lock --no-save --prefix /tmp');
const puppeteer = require('/tmp/node_modules/puppeteer-core');
const chromium = require('/tmp/node_modules/@sparticuz/chromium');
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(),
headless: chromium.headless,
});
return browser;
};

export const handler: AWSLambda.Handler = async (_event) => {
const browser = await setupBrowser();
const page = await browser.newPage();
await page.goto(url, {
waitUntil: ['load', 'networkidle0'],
timeout: 30000,
});
await page.type("div.visible-lg input[name='username']", process.env.TEST_USERNAME);
await page.type("div.visible-lg input[name='password']", process.env.TEST_PASSWORD);
await page.click("div.visible-lg input[type='submit']");
const body = await page.waitForSelector('body');
const textContent = await body.evaluate((el: any) => el.textContent);
return textContent;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const handler: AWSLambda.Handler;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable @typescript-eslint/no-require-imports */
import { execSync } from 'child_process';

const url = process.env.TEST_URL;
const setupBrowser = async () => {
execSync('HOME=/tmp npm install puppeteer-core @sparticuz/chromium --omit=dev --no-package-lock --no-save --prefix /tmp');
const puppeteer = require('/tmp/node_modules/puppeteer-core');
const chromium = require('/tmp/node_modules/@sparticuz/chromium');
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(),
headless: chromium.headless,
});
return browser;
};

export const handler: AWSLambda.Handler = async (_event) => {
const browser = await setupBrowser();
const page = await browser.newPage();
await page.goto(url, {
waitUntil: ['load', 'networkidle0'],
timeout: 30000,
});
await page.type("div.visible-lg input[name='username']", process.env.TEST_USERNAME);
await page.type("div.visible-lg input[name='password']", process.env.TEST_PASSWORD);
await page.click("div.visible-lg input[type='submit']");
const body = await page.waitForSelector('body');
const textContent = await body.evaluate((el: any) => el.textContent);
return textContent;
};

Large diffs are not rendered by default.

Loading