Skip to content

Commit

Permalink
chore: add valid CAS CAS test
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Sep 30, 2024
1 parent c1bfd67 commit 3c3beca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,22 @@ t.test('validateCertificate mismatch CAS CA', async t => {
'should return an invalid altname error'
);
});

t.test('validateCertificate valid CAS CA', async t => {
const cert = {
subjectaltname: 'DNS:abcde.12345.us-central1.sql.goog',
} as tls.PeerCertificate;
t.match(
validateCertificate(
{
projectId: 'my-project',
regionId: 'region-id',
instanceId: 'my-instance',
},
'GOOGLE_MANAGED_CAS_CA',
'abcde.12345.us-central1.sql.goog'
)('hostname', cert),
undefined,
'DNS name matches SAN in cert'
);
});

0 comments on commit 3c3beca

Please sign in to comment.