diff options
author | Azul <azul@leap.se> | 2014-05-16 08:42:36 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2014-05-16 08:42:36 +0200 |
commit | 8fbbb8717f0578536b97c2dc0883c632f120e976 (patch) | |
tree | 17aeb2b48ada703ac916a9a65fbf3c75a5dadb86 /users/lib/webfinger | |
parent | 81555ec6244ed76f92e3629880f68104b8705817 (diff) | |
parent | a4f7a410c536d88c91c834cab6ee950c71005ddd (diff) |
Merge remote-tracking branch 'origin/develop'
Conflicts:
app/assets/javascripts/srp
test/nagios/soledad_sync.py
test/nagios/webapp_login.py
Diffstat (limited to 'users/lib/webfinger')
-rw-r--r-- | users/lib/webfinger/host_meta_presenter.rb | 30 | ||||
-rw-r--r-- | users/lib/webfinger/user_presenter.rb | 35 |
2 files changed, 0 insertions, 65 deletions
diff --git a/users/lib/webfinger/host_meta_presenter.rb b/users/lib/webfinger/host_meta_presenter.rb deleted file mode 100644 index 84ab7a9..0000000 --- a/users/lib/webfinger/host_meta_presenter.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'uri' - -class Webfinger::HostMetaPresenter - def initialize(request) - @request = request - end - - def to_json(options = {}) - { - subject: subject, - links: links - }.to_json(options) - end - - def subject - url = URI.parse(@request.url) - url.path = '' - url.to_s - end - - def links - { lrdd: { type: 'application/xrd+xml', template: webfinger_template } } - end - - protected - - def webfinger_template(path = 'webfinger', query_param='q') - "#{subject}/#{path}?#{query_param}={uri}" - end -end diff --git a/users/lib/webfinger/user_presenter.rb b/users/lib/webfinger/user_presenter.rb deleted file mode 100644 index 329f477..0000000 --- a/users/lib/webfinger/user_presenter.rb +++ /dev/null @@ -1,35 +0,0 @@ -class Webfinger::UserPresenter - include Rails.application.routes.url_helpers - attr_accessor :user - - def initialize(user, request) - @user = user - @request = request - end - - def to_json(options = {}) - { - subject: subject, - links: links - }.to_json(options) - end - - def subject - "acct:#{@user.email_address}" - end - - def links - links = {} - links[:public_key] = { type: 'PGP', href: key } if key - return links - end - - protected - - def key - if @user.public_key.present? - Base64.encode64(@user.public_key.to_s) - end - end - -end |