diff --git a/src/requests/ownership.cr b/src/requests/ownership.cr new file mode 100644 index 0000000..224ad1d --- /dev/null +++ b/src/requests/ownership.cr @@ -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 diff --git a/src/responses/zone.cr b/src/responses/zone.cr index 0caaec5..9dae82e 100644 --- a/src/responses/zone.cr +++ b/src/responses/zone.cr @@ -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