Bughunting 2. Reconsider datamodel of mongodb and user/pass storage
This commit is contained in:
+14
-6
@@ -1,13 +1,21 @@
|
||||
import uuid
|
||||
import pymongo
|
||||
import getpass
|
||||
|
||||
myclient = pymongo.MongoClient("mongodb://admin:pass@localhost:27017/")
|
||||
config = {
|
||||
"username": "admin",
|
||||
"password": "pass",
|
||||
"server": "localhost:27017",
|
||||
}
|
||||
connector = "mongodb://{}:{}@{}".format(config["username"],config["password"], config["server"])
|
||||
client = pymongo.MongoClient(connector)
|
||||
db = client["groclist"]
|
||||
|
||||
|
||||
username = input("Username :")
|
||||
#password = getpass.getpass("Password: ")
|
||||
|
||||
mydb = myclient["groclist_db"]
|
||||
mycol = mydb["groclist_users"]
|
||||
userid = db.user_cred.find_one({"username": username})
|
||||
email = db.user_info.find_one({"uuid": userid{"uuid": 1} ,"name": 1, "email": 1})
|
||||
|
||||
email = mycol.find_one({"username": username}, {"_id": 0, "name": 1, "email": 1})
|
||||
|
||||
print (email)
|
||||
print (userid, email)
|
||||
|
||||
Reference in New Issue
Block a user