A library that provides functionalities needed for the diaspora* federation protocol.
Ruby Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app/controllers/diaspora_federation Replace legacy webfinger with new route from .well-known May 28, 2017
bin Fix bin/bundle May 20, 2017
config Switch PercentLiteralDelimiters to new default Jun 30, 2017
docs Add full_name to profile Apr 8, 2018
lib json schema: fix misplaced "required" property Jul 15, 2018
spec Bump rails Jun 17, 2018
test Bump dependency gems and update gemfiles Jun 17, 2018
.codeclimate.yml add .codeclimate.yml Jun 25, 2015
.editorconfig add .editorconfig Jun 18, 2015
.envrc add .envrc for direnv Jun 22, 2015
.gitignore Fix typo in rspec-persistence.txt Apr 4, 2017
.rspec WIP: move test dependencies to gemspec Jun 24, 2015
.rubocop.yml Bump rubocop Jun 17, 2018
.ruby-gemset initial commit Jun 10, 2015
.ruby-version Add ruby 2.4 Jan 19, 2017
.travis.yml Bump ruby versions on travis and add ruby 2.5 Jan 19, 2018
.yardopts add changelog to gems and documentation Jul 14, 2016
CONTRIBUTING.md Fix type in CONTRIBUTING.md Aug 27, 2017
COPYRIGHT Add AGPL-3.0 license text Feb 12, 2017
Changelog.md Update changelog for 0.2.4 Feb 18, 2018
Gemfile Bump rubocop Jun 17, 2018
Gemfile.lock Bump dependency gems and update gemfiles Jun 17, 2018
Guardfile add guard-rubocop Jan 15, 2016
LICENSE Add AGPL-3.0 license text Feb 12, 2017
README.md Revert "Add dependency status from libraries.io" May 16, 2018
Rakefile Bump rubocop Mar 5, 2018
diaspora_federation-json_schema.gemspec Bump rubocop Mar 5, 2018
diaspora_federation-rails.gemspec Bump rubocop Mar 5, 2018
diaspora_federation-test.gemspec Bump rubocop Mar 5, 2018
diaspora_federation.gemspec Bump faraday Jun 17, 2018

README.md

diaspora* federation library

A library that provides functionalities needed for the diaspora* federation protocol

master: Build Status master | develop: Build Status develop

Code Climate Test Coverage Inline docs Gem Version

Gem Documentation | Protocol Documentation | Bugtracker

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.

Usage

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

Contributing

See our contribution guide for more information on how to contribute to the diaspora* federation library.

License

GNU Affero General Public License.