Skip to content
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
35 changes: 35 additions & 0 deletions apps/cli/src/linter/specs/upstream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,41 @@ describe('Upstream Linter', () => {
} as ADCSDK.Configuration,
expect: true,
},
{
name: 'should accept https_verify_certificate on active health check',
input: {
services: [
{
name: 'HealthCheck_HTTPS_VerifyCert',
upstream: {
nodes: [
{
host: '1.1.1.1',
port: 443,
weight: 100,
},
],
checks: {
active: {
type: 'https',
http_path: '/',
https_verify_certificate: true,
healthy: {
interval: 2,
successes: 1,
},
unhealthy: {
interval: 1,
timeouts: 3,
},
},
},
},
},
],
} as ADCSDK.Configuration,
expect: true,
},
{
name: 'should only allow upstream mtls in client_cert and client_key',
input: {
Expand Down
2 changes: 1 addition & 1 deletion libs/backend-apisix-standalone/src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const UpstreamSchema = z.strictObject({
host: z.string().min(1).optional(),
port: z.coerce.number().int().min(1).max(65535).optional(),
http_path: z.string().default('/').optional(),
https_verify_cert: z.boolean().default(true).optional(),
https_verify_certificate: z.boolean().default(true).optional(),
http_request_headers: z.array(z.string()).min(1).optional(),
healthy: z
.strictObject({
Expand Down
2 changes: 1 addition & 1 deletion libs/sdk/src/core/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const upstreamSchema = (extend?: ZodRawShape) =>
host: hostSchema.optional(),
port: portSchema.optional(),
http_path: z.string().default('/').optional(),
https_verify_cert: z.boolean().default(true).optional(),
https_verify_certificate: z.boolean().default(true).optional(),
http_request_headers: z.array(z.string()).min(1).optional(),
healthy: z
.strictObject({
Expand Down
4 changes: 2 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"default": "/",
"type": "string"
},
"https_verify_cert": {
"https_verify_certificate": {
"default": true,
"type": "boolean"
},
Expand Down Expand Up @@ -556,7 +556,7 @@
"default": "/",
"type": "string"
},
"https_verify_cert": {
"https_verify_certificate": {
"default": true,
"type": "boolean"
},
Expand Down
Loading