Skip to content

Commit

Permalink
Merge pull request #400 from LD4P/update-global-cert
Browse files Browse the repository at this point in the history
Use new certificate for DocumentDB server
  • Loading branch information
justinlittman authored Aug 20, 2024
2 parents e8c66e1 + 5f4af4a commit a566852
Show file tree
Hide file tree
Showing 4 changed files with 3,037 additions and 723 deletions.
9 changes: 7 additions & 2 deletions __tests__/docdb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ describe("connect to aws docdb", () => {
it("returns an aws client", () => {
process.env.MONGODB_IS_AWS = "true"
const connect = require("mongo.js").default // eslint-disable-line global-require
const ca = [fs.readFileSync("rds-combined-ca-bundle.pem")]
const ca = [fs.readFileSync("global-bundle.pem")]
monk.mockReturnValue("fakeConnection")
const mockReq = {}
const mockNext = jest.fn()
connect(mockReq, null, mockNext)
expect(monk).toHaveBeenCalledWith(
"mongodb://sinopia:sekret@localhost:27017/sinopia_repository?ssl=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false",
{ sslValidate: true, sslCA: ca, useNewUrlParser: true }
{
sslValidate: true,
sslCA: ca,
useNewUrlParser: true,
useUnifiedTopology: true,
}
)
expect(mockNext).toHaveBeenCalled()
expect(mockReq.db).toBe("fakeConnection")
Expand Down
Loading

0 comments on commit a566852

Please sign in to comment.