AuthDbSv

class clink.service.AuthDbSv(mongo_sv)[source]

Ensure that database is compative with both AccSv and OAuthSv

Parameters:mongo_sv (MongoSv) –
acc_doc()[source]

Return account collection

Return type:pymongo.collection.Collection
grp_doc()[source]

Return group collection

Return type:pymongo.collection.Collection
rpwd_doc()[source]

Return refresh token collection

Return type:pymongo.collection.Collection
acctmp_doc()[source]

Return temporary account collection

Return type:pymongo.collection.Collection

Example

authdb_sv.py
from clink.service import AuthDbSv, MongoSv, MongoConf


mongo_conf = MongoConf('mongodb://localhost', 'book-db')
mongo_sv = MongoSv(mongo_conf)

authdb_sv = AuthDbSv(mongo_sv)
print(authdb_sv.acc_doc())
print(authdb_sv.grp_doc())
print(authdb_sv.rpwd_doc())
print(authdb_sv.acctmp_doc())

Testing

$ python authdb_sv.py
Collection(Database(MongoClient(host=['localhost:27017'],...
Collection(Database(MongoClient(host=['localhost:27017'],...
Collection(Database(MongoClient(host=['localhost:27017'],...
Collection(Database(MongoClient(host=['localhost:27017'],...