Next version of DODB, some API changes.
This commit is contained in:
parent
d790caa4e1
commit
7e6c733075
@ -31,8 +31,8 @@ dependencies:
|
|||||||
git: https://git.baguette.netlib.re/Baguette/baguette-crystal-base
|
git: https://git.baguette.netlib.re/Baguette/baguette-crystal-base
|
||||||
branch: master
|
branch: master
|
||||||
dodb:
|
dodb:
|
||||||
git: https://git.baguette.netlib.re/Baguette/dodb.cr
|
|
||||||
branch: master
|
branch: master
|
||||||
|
git: https://git.baguette.netlib.re/Baguette/dodb.cr
|
||||||
cbor:
|
cbor:
|
||||||
git: https://git.baguette.netlib.re/Baguette/crystal-cbor
|
git: https://git.baguette.netlib.re/Baguette/crystal-cbor
|
||||||
branch: master
|
branch: master
|
||||||
|
@ -23,10 +23,10 @@ class AuthD::Service < IPC
|
|||||||
property configuration : Baguette::Configuration::Auth
|
property configuration : Baguette::Configuration::Auth
|
||||||
|
|
||||||
# DB and its indexes.
|
# DB and its indexes.
|
||||||
property users : DODB::DataBase(User)
|
property users : DODB::Storage::Cached(User)
|
||||||
property users_per_uid : DODB::Index(User)
|
property users_per_uid : DODB::Trigger(User)
|
||||||
property users_per_login : DODB::Index(User)
|
property users_per_login : DODB::Trigger(User)
|
||||||
property users_per_email : DODB::Index(User)
|
property users_per_email : DODB::Trigger(User)
|
||||||
|
|
||||||
property logged_users : Hash(Int32, AuthD::User::Public)
|
property logged_users : Hash(Int32, AuthD::User::Public)
|
||||||
|
|
||||||
@ -36,14 +36,14 @@ class AuthD::Service < IPC
|
|||||||
def initialize(@configuration)
|
def initialize(@configuration)
|
||||||
super()
|
super()
|
||||||
|
|
||||||
@users = DODB::DataBase(User).new @configuration.storage
|
@users = DODB::Storage::Cached(User).new @configuration.storage
|
||||||
@users_per_uid = @users.new_index "uid", &.uid.to_s
|
@users_per_uid = @users.new_index "uid", &.uid.to_s
|
||||||
@users_per_login = @users.new_index "login", &.login
|
@users_per_login = @users.new_index "login", &.login
|
||||||
@users_per_email = @users.new_index "email" do |user|
|
@users_per_email = @users.new_index "email" do |user|
|
||||||
if mail = user.contact.email
|
if mail = user.contact.email
|
||||||
Base64.encode(mail).chomp
|
Base64.encode(mail).chomp
|
||||||
else
|
else
|
||||||
""
|
DODB.no_index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user