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

Allow any hostname for chromium proxy bypass #74693

Merged
merged 3 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions x-pack/plugins/reporting/server/config/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,34 @@ describe('Reporting Config Schema', () => {
).toMatchObject({ hostname: 'Frodo' });
});

it('allows setting a wildcard for chrome proxy bypass', () => {
expect(
ConfigSchema.validate({
capture: {
browser: {
chromium: {
proxy: {
enabled: true,
server: 'http://example.com:8080',
bypass: ['*.example.com', '*bar.example.com', 'bats.example.com'],
},
},
},
},
}).capture.browser.chromium.proxy
).toMatchInlineSnapshot(`
Object {
"bypass": Array [
"*.example.com",
"*bar.example.com",
"bats.example.com",
],
"enabled": true,
"server": "http://example.com:8080",
}
`);
});

it(`logs the proper validation messages`, () => {
// kibanaServer
const throwValidationErr = () => ConfigSchema.validate({ kibanaServer: { hostname: '0' } });
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/reporting/server/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CaptureSchema = schema.object({
bypass: schema.conditional(
schema.siblingRef('enabled'),
true,
schema.arrayOf(schema.string({ hostname: true })),
schema.arrayOf(schema.string()),
schema.maybe(schema.never())
),
}),
Expand Down