Skip to content

Commit

Permalink
test: fix kms test
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed May 6, 2024
1 parent 920a61e commit 82392cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ async function getGcpTokenData(tokenAudience: string): Promise<AccessToken> {
`Status code ${response.status} returned from the GCP endpoint. Response body: ${response.body}`
);
}
return JSON.parse(response.body);
return { access_token: response.body };
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type AzureKMSRequestOptions,
fetchAzureKMSToken
} from '../../../src/client-side-encryption/providers/azure';
import { type Document } from '../../mongodb';
import { type Document, MongoNetworkTimeoutError } from '../../mongodb';

const BASE_URL = new URL(`http://127.0.0.1:8080/metadata/identity/oauth2/token`);
class KMSRequestOptions implements AzureKMSRequestOptions {
Expand Down Expand Up @@ -119,7 +119,7 @@ context('Azure KMS Mock Server Tests', function () {
it('returns an error after the request times out', async () => {
const error = await fetchAzureKMSToken(new KMSRequestOptions('slow')).catch(e => e);

expect(error).to.be.instanceof(MongoCryptAzureKMSRequestError);
expect(error).to.be.instanceof(MongoNetworkTimeoutError);
});
});
});

0 comments on commit 82392cf

Please sign in to comment.