Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongoc/connection options #1156

Merged
merged 3 commits into from
Jun 22, 2022
Merged

Mongoc/connection options #1156

merged 3 commits into from
Jun 22, 2022

Conversation

kzangeli
Copy link
Collaborator

@kzangeli kzangeli commented Jun 22, 2022

Proposed changes

Secure connection to mongodb server, via the new mongoc driver.
Partly fixing issue #903

Note that this is not for the API endpoints that are implemented using the old legacy driver.
The idea is to merge away from the legacy driver asap and no time to be lost ...

Current support of the new mongoc driver

All generic features now use "mongoc" - the new Mongo C driver:

  • Creation of database indices (only if started with '-experimental')
  • Persisting Contexts
  • Tenants
  • Subscription Cache

The following API endpoints use "mongoc" - the new Mongo C driver:

  • PATCH /entities/{entityId}
  • PUT /entities/{entityId}
  • POST /jsonldContexts
  • GET /jsonldContexts
  • GET /jsonldContexts/{contextId}
  • DELETE /jsonldContexts/{contextId}

The following API endpoints use "mongoc" if Orion-LD is started with the -experimental CLI parameter:

  • POST /entities
  • GET /entities
  • GET /entities/{entityId}
  • POST /subscriptions
  • PATCH /subscriptions/{subscriptionId}
  • DELETE /subscriptions/{subscriptionId}

The following API endpoints use no database access at all, just the subscription cache:

  • GET /subscriptions
  • GET /subscriptions/{subscriptionId}

So, without using the old Mongo C++ Legacy driver, it is now possible to:

  • Create entities
  • Update entities (PATCH+PUT)
  • Query entities
  • Retrieve individual entity
  • Create subscriptions
  • Retrieve subscription (it uses the subscription cache, no DB request is performed)
  • List subscriptions (it uses the subscription cache, no DB request is performed)
  • Modify subscriptions
  • Delete subscriptions
  • Create JSONLD Contexts
  • Retrieve individual JSONLD Context
  • List JSONLD Contexts

Back to the pull request:

There are 5 new CLI parameters for the mongocb connection URI:

[option '-dbAuthMech' <database authentication mechanism (either SCRAM-SHA-1 or SCRAM-SHA-256)>]
[option '-dbAuthDb' <database used for authentication>]
[option '-dbSSL' (enable SSL connection to DB)]
[option '-dbCertFile' (path to TLS certificate file)]
[option '-dbURI' <complete URI for database connection>]

For further info, please see the issue #903 , especially about -dbURI and -dbpwd.

Ah, almost forgot, the whole thing is quite untested ... Volunteers?

What types of changes does your code introduce to the project: Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

It will take months to migrate the entire set of API endpoints to mongoc - 3-4 months full-time ...

@github-actions
Copy link

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@kzangeli kzangeli merged commit eec2755 into develop Jun 22, 2022
@kzangeli kzangeli deleted the mongoc/connection-options branch June 22, 2022 16:17
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant