Skip to content

Commit

Permalink
fix(api7): mismatched fields in upstream mtls
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Nov 7, 2024
1 parent 9fb8200 commit 63c28d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/cli/src/linter/exporter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Export jsonschema file by:
*
* $ ts-node apps/cli/src/linter/exporter.ts
* $ nx export-schema cli
*
*/
import { writeFileSync } from 'fs';
Expand Down
9 changes: 5 additions & 4 deletions apps/cli/src/linter/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,16 @@ const upstreamSchema = z
timeout: timeoutSchema.optional(),
tls: z
.object({
cert: z.string(),
key: z.string(),
client_cert: z.string(),
client_key: z.string(),
client_cert_id: z.string(),
verify: z.boolean(),
})
.refine(
(data) =>
(data.cert && data.key && !data.client_cert_id) ||
(data.client_cert_id && !data.cert && !data.key),
(data.client_cert && data.client_key && !data.client_cert_id) ||
(data.client_cert_id && !data.client_cert && !data.client_key),
'The client_cert and client_key certificate pair or client_cert_id SSL reference ID must be set',
)
.optional(),
keepalive_pool: z
Expand Down
12 changes: 10 additions & 2 deletions libs/backend-api7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@

| Features | Supported |
| ------------- | --------- |
| Dump to ADC ||
| Sync from ADC ||
| Dump to ADC ||
| Sync from ADC ||

## Supported Versions

| Versions | Supported |
| -------- | --------- |
| 3.2.14.6 ||
| 3.2.15.2 ||
| 3.2.16.2 ||
6 changes: 6 additions & 0 deletions libs/backend-api7/src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export interface Upstream {
retries?: number;
retry_timeout?: number;
timeout?: UpstreamTimeout;
tls?: {
client_cert: string;
client_key: string;
client_cert_id: string;
verify: boolean;
};
keepalive_pool?: {
size: number;
idle_timeout: number;
Expand Down

0 comments on commit 63c28d5

Please sign in to comment.