No description
Find a file
Benjamin Neff 4468b8b8e1
Some checks failed
CI / Ruby: 2.7, Rails: 5.2 (push) Has been cancelled
CI / Ruby: 2.7, Rails: 6.0 (push) Has been cancelled
CI / Ruby: 3.0, Rails: 6.0 (push) Has been cancelled
CI / Ruby: 3.1, Rails: 6.0 (push) Has been cancelled
CI / Ruby: 3.2, Rails: 6.0 (push) Has been cancelled
CI / Ruby: 2.7, Rails: 6.1 (push) Has been cancelled
CI / Ruby: 3.0, Rails: 6.1 (push) Has been cancelled
CI / Ruby: 3.1, Rails: 6.1 (push) Has been cancelled
CI / Ruby: 3.2, Rails: 6.1 (push) Has been cancelled
CI / Ruby: 2.7, Rails: 7.0 (push) Has been cancelled
CI / Ruby: 3.0, Rails: 7.0 (push) Has been cancelled
CI / Ruby: 3.1, Rails: 7.0 (push) Has been cancelled
CI / Ruby: 3.2, Rails: 7.0 (push) Has been cancelled
CI / Ruby: 2.7, Rails: none (push) Has been cancelled
CI / Ruby: 3.0, Rails: none (push) Has been cancelled
CI / Ruby: 3.1, Rails: none (push) Has been cancelled
CI / Ruby: 3.2, Rails: none (push) Has been cancelled
Merge pull request #130 from denschub/prontohub
[CI] Run Pronto on GitHub Actions.
2023-06-16 01:29:48 +02:00
.github/workflows [CI] Run Pronto on GitHub Actions. 2023-06-15 16:25:24 +02:00
app/controllers/diaspora_federation Disable forgery protection for ReceiveController 2022-07-23 02:15:53 +02:00
bin Add rails 7 support 2022-07-18 02:25:23 +02:00
config Remove legacy Webfinger handling 2021-11-27 03:56:52 +01:00
docs Merge branch '0.2.x' into develop 2021-10-24 21:14:25 +02:00
lib Fix entering OTP code when releasing gem 2023-06-12 01:33:05 +02:00
spec Bump rspec 2023-06-11 17:25:45 +02:00
test Allow to test for multiple rails versions in CI 2023-06-11 18:41:20 +02:00
.codeclimate.yml Bump rubocop 2021-11-26 02:59:31 +01:00
.editorconfig add .editorconfig 2015-06-19 01:05:06 +02:00
.gitignore Add rails 6 support 2019-10-21 03:35:18 +02:00
.rspec WIP: move test dependencies to gemspec 2015-06-24 03:09:14 +02:00
.rubocop.yml Bump rubocop and rubocop-rails 2023-06-11 16:47:34 +02:00
.ruby-gemset initial commit 2015-06-10 03:13:44 +02:00
.ruby-version Add ruby 3.2 to CI 2023-06-11 18:43:27 +02:00
.yardopts add changelog to gems and documentation 2016-07-14 20:02:46 +02:00
Changelog.md Release version 1.1.0 2023-06-12 01:26:44 +02:00
CONTRIBUTING.md Fix type in CONTRIBUTING.md 2017-08-27 02:45:23 +02:00
COPYRIGHT Add AGPL-3.0 license text 2017-02-12 20:56:37 +01:00
diaspora_federation-json_schema.gemspec Bump pronto-rubocop, rubocop and rubocop-rails 2022-07-18 02:29:21 +02:00
diaspora_federation-rails.gemspec Add rails 7 support 2022-07-18 02:25:23 +02:00
diaspora_federation-test.gemspec Bump fabrication 2022-07-18 02:29:21 +02:00
diaspora_federation.gemspec Add faraday 2 support 2022-07-18 02:29:21 +02:00
Gemfile Allow to test for multiple rails versions in CI 2023-06-11 18:41:20 +02:00
Gemfile.lock Release version 1.1.0 2023-06-12 01:26:44 +02:00
LICENSE Add AGPL-3.0 license text 2017-02-12 20:56:37 +01:00
Rakefile Bump rubocop and rubocop-rails 2023-06-11 16:47:34 +02:00
README.md Fix server_uri in README 2018-08-25 01:05:50 +02:00

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 = URI("http://localhost:3000")

  # ... other settings

  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(
          # ... copy person attributes to WebFinger object
        )
      end
    end

    on :fetch_person_for_hcard do |guid|
      # ... fetch hcard information
    end

    # ... other callbacks
  end
end

The available config settings can be found here and the callbacks are listed here in the gem documentation.

Contributing

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

License

GNU Affero General Public License.