Test
This commit is contained in:
parent
1326bcf8e5
commit
867484aab4
36
src/authd.cr
36
src/authd.cr
@ -363,18 +363,6 @@ class AuthD::Request
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class IPC::Context
|
|
||||||
def send(fd, response : AuthD::Response)
|
|
||||||
send fd, response.type.to_u8, response.to_json
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class IPC::Client
|
|
||||||
def send(request : AuthD::Request)
|
|
||||||
send @server_fd, request.type.to_u8, request.to_json
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module AuthD
|
module AuthD
|
||||||
class Client < IPC::Client
|
class Client < IPC::Client
|
||||||
property key : String
|
property key : String
|
||||||
@ -574,3 +562,27 @@ module AuthD
|
|||||||
send Request::SearchUser.new user_login
|
send Request::SearchUser.new user_login
|
||||||
response = Response.from_ipc read
|
response = Response.from_ipc read
|
||||||
|
|
||||||
|
case response
|
||||||
|
when Response::MatchingUsers
|
||||||
|
response.users
|
||||||
|
when Response::Error
|
||||||
|
raise Exception.new response.reason
|
||||||
|
else
|
||||||
|
Exception.new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class IPC::Context
|
||||||
|
def send(fd, response : AuthD::Response)
|
||||||
|
send fd, response.type.to_u8, response.to_json
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class IPC::Client
|
||||||
|
def send(request : AuthD::Request)
|
||||||
|
send @server_fd, }equest.type.to_u8, request.to_json
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user