Skip to content

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Oct 15, 2025

#1736

  • Checked

This is really a small improvement, mongoose does not need options.auth, just auth in in url, so this PR removes it for mongoose

@AlvaroVega
Copy link
Member Author

AlvaroVega commented Oct 16, 2025

Tested with:

iot-mongo2:
  container_name: iot-mongo2
  hostname: iot-mongo2
  restart: "unless-stopped"
  image: mongo:8.0.5   
  ports:
    - "27018:27017"
  command: ["mongod", "--auth"]
  environment:
    MONGO_VERSION: 8.0.5
    MONGO_INITDB_ROOT_USERNAME: root
    MONGO_INITDB_ROOT_PASSWORD: example123
    MONGO_INITDB_DATABASE: admin  
  log_driver: json-file
  log_opt:
    max-size: "250m"
  environment:
    - IOTA_MONGO_HOST=iot-mongo2
    - IOTA_MONGO_PORT=27017
    - IOTA_MONGO_DB=iotajson
    - IOTA_MONGO_USER=pepe
    - IOTA_MONGO_PASSWORD=pepepasswd
$ docker exec -it iot-mongo2 mongosh -u root -p example123 --authenticationDatabase admin
use iotajson

db.createUser({
  user: "pepe",
  pwd: "pepepasswd",
  roles: [
    { role: "readWrite", db: "iotajson" }
})

@AlvaroVega
Copy link
Member Author

AlvaroVega commented Oct 16, 2025

also tested with:

- IOTA_MONGO_AUTH_SOURCE=admin

and

$ docker exec -it iot-mongo2 mongosh -u root -p example123 --authenticationDatabase admin

use iotajson

db.createUser({
  user: "pepe",
  pwd: "pepepasswd",
  roles: [
    { role: "readWrite", db: "iotajson" }
})

@AlvaroVega AlvaroVega marked this pull request as ready for review October 16, 2025 08:29
@AlvaroVega AlvaroVega requested a review from fgalan October 16, 2025 08:29
@AlvaroVega
Copy link
Member Author

@FukayaTakashi what do you think ?

Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Waiting to @FukayaTakashi feedback before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants