Skip to content

Support Client Certificates for Authentication #147

@Magnitus-

Description

@Magnitus-

I noticed that mongodb supports certificate authentication for clients. It would be nice to support this in lectern.

This would give a convenient (for those who are comfortable managing tls certificate chains anyways), secure, standard, portable way of managing mongodb client credentials.

Detailed Description

The native mongodb node client supports authenticating with tls certificates:
https://docs.mongodb.com/manual/tutorial/configure-ssl-clients/
http://mongodb.github.io/node-mongodb-native/3.1/tutorials/connect/ssl/

From what I can tell in the code, certificate authentication doesn't appear to be supported in lectern:
https://github.com/overture-stack/lectern/blob/develop/src/config/appConfig.ts#L59

Possible Implementation

Given that mongoose (which I believe you are using) is just an odm abstraction layer on top of the native mongodb client, it stands to reason that it should be supportable.

I'm looking at the doc here and it says you can pass extra options directly to the mongodb native driver: https://mongoosejs.com/docs/connections.html#connection-string-options

You'd want to:

I don't know all the nooks and crannies in your codebase, but I believe that's about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-featureRequest is a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions