Skip to content

Commit

Permalink
chore: default dnsName and serverCaMode
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Sep 27, 2024
1 parent faedae5 commit a536813
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cloud-sql-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class CloudSQLInstance {
public port = 3307;
public privateKey?: string;
public serverCaCert?: SslCert;
public serverCaMode?: string | null | undefined;
public dnsName?: string | null | undefined;
public serverCaMode = '';
public dnsName = '';

constructor({
ipType,
Expand Down
8 changes: 4 additions & 4 deletions src/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ interface SocketOptions {
instanceInfo: InstanceConnectionInfo;
privateKey: string;
serverCaCert: SslCert;
serverCaMode?: string | null | undefined;
dnsName?: string | null | undefined;
serverCaMode: string;
dnsName: string;
}

export function validateCertificate(
instanceInfo: InstanceConnectionInfo,
serverCaMode?: string | null | undefined,
dnsName?: string | null | undefined
serverCaMode: string,
dnsName: string
) {
return (hostname: string, cert: tls.PeerCertificate): Error | undefined => {
if (serverCaMode == 'GOOGLE_MANAGED_CAS_CA') {

Check failure on line 39 in src/socket.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected '===' and instead saw '=='
Expand Down
8 changes: 4 additions & 4 deletions src/sqladmin-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import {AuthTypes} from './auth-types';
export interface InstanceMetadata {
ipAddresses: IpAddresses;
serverCaCert: SslCert;
serverCaMode?: string | null | undefined;
dnsName?: string | null | undefined;
serverCaMode: string;
dnsName: string;
}

interface RequestBody {
Expand Down Expand Up @@ -218,8 +218,8 @@ export class SQLAdminFetcher {
cert: serverCaCert.cert,
expirationTime: serverCaCert.expirationTime,
},
serverCaMode: res.data.serverCaMode,
dnsName: res.data.dnsName,
serverCaMode: res.data.serverCaMode || '',
dnsName: res.data.dnsName || '',
};
}

Expand Down

0 comments on commit a536813

Please sign in to comment.