This repository contains two gems:
diaspora_federation
provides the functionality for de-/serialization and de-/encryption of Entities in the protocols used for communication among the various installations of diaspora*.diaspora_federation-rails
is a rails engine that adds the diaspora* federation protocol to a rails app.
Add the gem to your Gemfile
:
gem "diaspora_federation-rails"
Mount the routes in your config/routes.rb
:
mount DiasporaFederation::Engine => "/"
Configure the engine in config/initializers/diaspora_federation.rb
:
DiasporaFederation.configure do |config|
# the pod url
config.server_uri = AppConfig.pod_uri
config.define_callbacks do
on :fetch_person_for_webfinger do |diaspora_id|
person = Person.find_local_by_diaspora_id(diaspora_id)
if person
DiasporaFederation::Discovery::WebFinger.new(
# ...
)
end
end
on :fetch_person_for_hcard do |guid|
# ...
end
end
end
See our contribution guide for more information on how to contribute to the diaspora* federation library.