blob: 5b2dc7d73c150d5c9a1d74a43c5dcc7122465365 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
require 'nickserver/request_handlers/base'
require 'nickserver/hkp/source'
require 'nickserver/error_response'
module Nickserver
module RequestHandlers
class FingerprintHandler < Base
def handle
return unless fingerprint
if fingerprint.length == 40 && !fingerprint[/\H/]
source.get_key_by_fingerprint(fingerprint)
else
ErrorResponse.new('Fingerprint invalid: ' + fingerprint)
end
end
protected
def fingerprint
request.fingerprint
end
def source
Nickserver::Hkp::Source.new
end
end
end
end
|