WIP: ownership management. Some empty functions.

dev
Philippe PITTOLI 2024-04-27 20:08:34 +02:00
parent a888551bbc
commit 8cafca13be
2 changed files with 63 additions and 2 deletions

61
src/requests/ownership.cr Normal file
View File

@ -0,0 +1,61 @@
class DNSManager::Request
IPC::JSON.message AskShareToken, 20 do
property domain : String
def initialize(@domain)
end
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
user = dnsmanagerd.get_logged_user event
return Response::ErrorUserNotLogged.new unless user
Response::Error.new "Not implemented."
end
end
DNSManager.requests << AskShareToken
IPC::JSON.message AskTransferToken, 21 do
property domain : String
def initialize(@domain)
end
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
user = dnsmanagerd.get_logged_user event
return Response::ErrorUserNotLogged.new unless user
Response::Error.new "Not implemented."
end
end
DNSManager.requests << AskTransferToken
IPC::JSON.message AskUnShareDomain, 22 do
property domain : String
def initialize(@domain)
end
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
user = dnsmanagerd.get_logged_user event
return Response::ErrorUserNotLogged.new unless user
Response::Error.new "Not implemented."
end
end
DNSManager.requests << AskUnShareDomain
IPC::JSON.message GainOwnership, 23 do
property uuid : String
def initialize(@uuid)
end
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
user = dnsmanagerd.get_logged_user event
return Response::ErrorUserNotLogged.new unless user
Response::Error.new "Not implemented."
end
end
DNSManager.requests << GainOwnership
end

View File

@ -14,9 +14,9 @@ class DNSManager::Response
end
DNSManager.responses << InvalidZone
# Domain of a zone cannot change, for security reasons.
IPC::JSON.message DomainChanged, 11 do
def initialize
property domain : DNSManager::Storage::Domain
def initialize(@domain)
end
end
DNSManager.responses << DomainChanged