Skip to content

Commit

Permalink
fix: correct type definition for the global BackendConfiguration type…
Browse files Browse the repository at this point in the history
… - there is no `checkCertificate` field

This field never existed in the released version of our Backend implementation, it is a remnant of a previous approach I was taking, I somehow forgot to remove the tests and type definition
  • Loading branch information
JakeChampion committed Apr 11, 2024
1 parent 2f66118 commit 62fd0ea
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
22 changes: 0 additions & 22 deletions integration-tests/js-compute/fixtures/app/src/dynamic-backend.js
Expand Up @@ -1287,28 +1287,6 @@ routes.set("/backend/timeout", async () => {
});
}

// checkCertificate property
{
routes.set("/backend/constructor/parameter-checkCertificate-property-valid-boolean", async () => {
const types = [{}, [], Symbol(), 1, "2"];
for (const type of types) {
let error = assertDoesNotThrow(() => {
new Backend({ name: 'checkCertificate-property-valid-boolean' + String(type), target: 'a', checkCertificate: type })
})
if (error) { return error }
}
let error = assertDoesNotThrow(() => {
new Backend({ name: 'checkCertificate-property-valid-boolean-true', target: 'a', checkCertificate: true })
})
if (error) { return error }
error = assertDoesNotThrow(() => {
new Backend({ name: 'checkCertificate-property-valid-boolean-false', target: 'a', checkCertificate: false })
})
if (error) { return error }
return pass('ok')
});
}

// caCertificate property
{
routes.set("/backend/constructor/parameter-caCertificate-property-empty-string", async () => {
Expand Down
11 changes: 0 additions & 11 deletions integration-tests/js-compute/fixtures/app/tests.json
Expand Up @@ -2736,17 +2736,6 @@
"body": "ok"
}
},
"GET /backend/constructor/parameter-checkCertificate-property-valid-boolean": {
"environments": ["viceroy"],
"downstream_request": {
"method": "GET",
"pathname": "/backend/constructor/parameter-checkCertificate-property-valid-boolean"
},
"downstream_response": {
"status": 200,
"body": "ok"
}
},
"GET /backend/constructor/parameter-caCertificate-property-empty-string": {
"environments": ["viceroy"],
"downstream_request": {
Expand Down
1 change: 0 additions & 1 deletion test-d/.test-d.ts
Expand Up @@ -97,7 +97,6 @@ import { expectError, expectType } from 'tsd';
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', tlsMinVersion: 1.2,}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', tlsMaxVersion: 1.2,}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', certificateHostname: 'example.com',}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', checkCertificate: false,}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', caCertificate: '',}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', ciphers: 'DEFAULT',}))
expectType<Backend>(new Backend({name: 'eu', target: 'www.example.com', sniHostname: 'example.com',}))
Expand Down
5 changes: 0 additions & 5 deletions types/globals.d.ts
Expand Up @@ -90,11 +90,6 @@ declare interface BackendConfiguration {
* Define the hostname that the server certificate should declare.
*/
certificateHostname?: string,
/**
* Whether or not to validate the server certificate.
* Highly recommended to enable this if `useSSL` is set to `true`.
*/
checkCertificate?: boolean,
/**
* The CA certificate to use when checking the validity of the backend.
*/
Expand Down

0 comments on commit 62fd0ea

Please sign in to comment.