FerretDB / FerretDB

A truly Open Source MongoDB alternative

Home Page:https://www.ferretdb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement localhost exception

chilagrow opened this issue · comments

What should be done?

When new authentication is enabled, admin.system.users collection does not exist, and the client is connected from the localhost, bypass credentials checking instead of what #4075 did (falling back to old backend authentication).

It is similar to https://www.mongodb.com/docs/manual/core/localhost-exception/

For testing, we probably should add a fixed user to MongoDB and FerretDB in the envtool and use MongoDB URI with those credentials in tests for the initial connection.

We probably should also clean up the way we create and drop users in tests, including test setup. We also should remove or simplify if IsMongo / if !IsMongo branches.

Where?

See issue number in the codebase add by #4075.

Definition of Done

  • handler updated;
  • all backends updated;
  • unit tests added/updated;
  • integration/compatibility tests added/updated;
  • spot refactorings done;
  • user documentation updated;
  • something else?