cleanup: remove double ## everywhere on documentation
This commit is contained in:
parent
3a7c2035ad
commit
d7c248b94e
15 changed files with 0 additions and 35 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# Base-Controller for all DiasporaFederation-Controller
|
# Base-Controller for all DiasporaFederation-Controller
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
require_dependency "diaspora_federation/application_controller"
|
require_dependency "diaspora_federation/application_controller"
|
||||||
|
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# this controller generates the hcard
|
# this controller generates the hcard
|
||||||
class HCardController < ApplicationController
|
class HCardController < ApplicationController
|
||||||
##
|
|
||||||
# returns the hcard of the user
|
# returns the hcard of the user
|
||||||
#
|
#
|
||||||
# GET /hcard/users/:guid
|
# GET /hcard/users/:guid
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
require_dependency "diaspora_federation/application_controller"
|
require_dependency "diaspora_federation/application_controller"
|
||||||
|
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# this controller processes receiving messages
|
# this controller processes receiving messages
|
||||||
class ReceiveController < ApplicationController
|
class ReceiveController < ApplicationController
|
||||||
before_action :check_for_xml
|
before_action :check_for_xml
|
||||||
|
|
||||||
##
|
|
||||||
# receives public messages
|
# receives public messages
|
||||||
#
|
#
|
||||||
# POST /receive/public
|
# POST /receive/public
|
||||||
|
|
@ -16,7 +14,6 @@ module DiasporaFederation
|
||||||
render nothing: true, status: :ok
|
render nothing: true, status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# receives private messages for a user
|
# receives private messages for a user
|
||||||
#
|
#
|
||||||
# POST /receive/users/:guid
|
# POST /receive/users/:guid
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
require_dependency "diaspora_federation/application_controller"
|
require_dependency "diaspora_federation/application_controller"
|
||||||
|
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# this controller handles all webfinger-specific requests
|
# this controller handles all webfinger-specific requests
|
||||||
class WebfingerController < ApplicationController
|
class WebfingerController < ApplicationController
|
||||||
##
|
|
||||||
# returns the host-meta xml
|
# returns the host-meta xml
|
||||||
#
|
#
|
||||||
# example:
|
# example:
|
||||||
|
|
@ -18,7 +16,6 @@ module DiasporaFederation
|
||||||
render body: WebfingerController.host_meta_xml, content_type: "application/xrd+xml"
|
render body: WebfingerController.host_meta_xml, content_type: "application/xrd+xml"
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# @deprecated this is the pre RFC 7033 webfinger
|
# @deprecated this is the pre RFC 7033 webfinger
|
||||||
#
|
#
|
||||||
# example:
|
# example:
|
||||||
|
|
@ -46,7 +43,6 @@ module DiasporaFederation
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
##
|
|
||||||
# creates the host-meta xml with the configured server_uri and caches it
|
# creates the host-meta xml with the configured server_uri and caches it
|
||||||
# @return [String] XML string
|
# @return [String] XML string
|
||||||
def self.host_meta_xml
|
def self.host_meta_xml
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,11 @@ require "diaspora_federation/logging"
|
||||||
|
|
||||||
require "diaspora_federation/web_finger"
|
require "diaspora_federation/web_finger"
|
||||||
|
|
||||||
##
|
|
||||||
# diaspora* federation library
|
# diaspora* federation library
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
extend Logging
|
extend Logging
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
##
|
|
||||||
# the pod url
|
# the pod url
|
||||||
#
|
#
|
||||||
# @example with uri
|
# @example with uri
|
||||||
|
|
@ -17,7 +15,6 @@ module DiasporaFederation
|
||||||
# config.server_uri = AppConfig.pod_uri
|
# config.server_uri = AppConfig.pod_uri
|
||||||
attr_accessor :server_uri
|
attr_accessor :server_uri
|
||||||
|
|
||||||
##
|
|
||||||
# the class to use as +Person+
|
# the class to use as +Person+
|
||||||
#
|
#
|
||||||
# @example
|
# @example
|
||||||
|
|
@ -95,7 +92,6 @@ module DiasporaFederation
|
||||||
const_get(@person_class)
|
const_get(@person_class)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# configure the federation library
|
# configure the federation library
|
||||||
#
|
#
|
||||||
# DiasporaFederation.configure do |config|
|
# DiasporaFederation.configure do |config|
|
||||||
|
|
@ -105,7 +101,6 @@ module DiasporaFederation
|
||||||
yield self
|
yield self
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# validates if the engine is configured correctly
|
# validates if the engine is configured correctly
|
||||||
#
|
#
|
||||||
# called from after_initialize
|
# called from after_initialize
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# diaspora* federation rails engine
|
# diaspora* federation rails engine
|
||||||
class Engine < ::Rails::Engine
|
class Engine < ::Rails::Engine
|
||||||
isolate_namespace DiasporaFederation
|
isolate_namespace DiasporaFederation
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# logging module for the diaspora federation
|
# logging module for the diaspora federation
|
||||||
#
|
#
|
||||||
# it uses the logging-gem if available
|
# it uses the logging-gem if available
|
||||||
module Logging
|
module Logging
|
||||||
private
|
private
|
||||||
|
|
||||||
##
|
|
||||||
# get the logger for this class
|
# get the logger for this class
|
||||||
#
|
#
|
||||||
# use the logging-gem if available, else use a default logger
|
# use the logging-gem if available, else use a default logger
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ require "diaspora_federation/engine"
|
||||||
require "diaspora_federation"
|
require "diaspora_federation"
|
||||||
|
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# diaspora* federation rails engine
|
# diaspora* federation rails engine
|
||||||
module Rails
|
module Rails
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# the gem version
|
# the gem version
|
||||||
VERSION = "0.0.2"
|
VERSION = "0.0.2"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
##
|
|
||||||
# This module provides the namespace for the various classes implementing
|
# This module provides the namespace for the various classes implementing
|
||||||
# WebFinger and other protocols used for metadata discovery on remote servers
|
# WebFinger and other protocols used for metadata discovery on remote servers
|
||||||
# in the Diaspora* network.
|
# in the Diaspora* network.
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
module WebFinger
|
module WebFinger
|
||||||
##
|
|
||||||
# Raised, if the XML structure is invalid
|
# Raised, if the XML structure is invalid
|
||||||
class InvalidDocument < RuntimeError
|
class InvalidDocument < RuntimeError
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Raised, if something is wrong with the webfinger data
|
# Raised, if something is wrong with the webfinger data
|
||||||
#
|
#
|
||||||
# * if the +webfinger_url+ is missing or malformed in {HostMeta.from_base_url} or {HostMeta.from_xml}
|
# * if the +webfinger_url+ is missing or malformed in {HostMeta.from_base_url} or {HostMeta.from_xml}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
module WebFinger
|
module WebFinger
|
||||||
##
|
|
||||||
# This class provides the means of generating an parsing account data to and
|
# This class provides the means of generating an parsing account data to and
|
||||||
# from the hCard format.
|
# from the hCard format.
|
||||||
# hCard is based on +RFC 2426+ (vCard) which got superseded by +RFC 6350+.
|
# hCard is based on +RFC 2426+ (vCard) which got superseded by +RFC 6350+.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
module WebFinger
|
module WebFinger
|
||||||
##
|
|
||||||
# Generates and parses Host Meta documents.
|
# Generates and parses Host Meta documents.
|
||||||
#
|
#
|
||||||
# This is a minimal implementation of the standard, only to the degree of what
|
# This is a minimal implementation of the standard, only to the degree of what
|
||||||
|
|
@ -23,7 +22,6 @@ module DiasporaFederation
|
||||||
# URL fragment to append to the base URL
|
# URL fragment to append to the base URL
|
||||||
WEBFINGER_SUFFIX = "webfinger?q={uri}"
|
WEBFINGER_SUFFIX = "webfinger?q={uri}"
|
||||||
|
|
||||||
##
|
|
||||||
# Returns the WebFinger URL that was used to build this instance (either from
|
# Returns the WebFinger URL that was used to build this instance (either from
|
||||||
# xml or by giving a base URL).
|
# xml or by giving a base URL).
|
||||||
# @return [String] WebFinger template URL
|
# @return [String] WebFinger template URL
|
||||||
|
|
@ -31,7 +29,6 @@ module DiasporaFederation
|
||||||
@webfinger_url
|
@webfinger_url
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Produces the XML string for the Host Meta instance with a +Link+ element
|
# Produces the XML string for the Host Meta instance with a +Link+ element
|
||||||
# containing the +webfinger_url+.
|
# containing the +webfinger_url+.
|
||||||
# @return [String] XML string
|
# @return [String] XML string
|
||||||
|
|
@ -43,7 +40,6 @@ module DiasporaFederation
|
||||||
doc.to_xml
|
doc.to_xml
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Builds a new HostMeta instance and constructs the WebFinger URL from the
|
# Builds a new HostMeta instance and constructs the WebFinger URL from the
|
||||||
# given base URL by appending HostMeta::WEBFINGER_SUFFIX.
|
# given base URL by appending HostMeta::WEBFINGER_SUFFIX.
|
||||||
# @return [HostMeta]
|
# @return [HostMeta]
|
||||||
|
|
@ -60,7 +56,6 @@ module DiasporaFederation
|
||||||
hm
|
hm
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Reads the given Host Meta XML document string and populates the
|
# Reads the given Host Meta XML document string and populates the
|
||||||
# +webfinger_url+.
|
# +webfinger_url+.
|
||||||
# @param [String] hostmeta_xml Host Meta XML string
|
# @param [String] hostmeta_xml Host Meta XML string
|
||||||
|
|
@ -77,7 +72,6 @@ module DiasporaFederation
|
||||||
hm
|
hm
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Applies some basic sanity-checking to the given URL
|
# Applies some basic sanity-checking to the given URL
|
||||||
# @param [String] url validation subject
|
# @param [String] url validation subject
|
||||||
# @return [Boolean] validation result
|
# @return [Boolean] validation result
|
||||||
|
|
@ -86,7 +80,6 @@ module DiasporaFederation
|
||||||
end
|
end
|
||||||
private_class_method :webfinger_url_valid?
|
private_class_method :webfinger_url_valid?
|
||||||
|
|
||||||
##
|
|
||||||
# Gets the webfinger url from an XRD data structure
|
# Gets the webfinger url from an XRD data structure
|
||||||
# @param [Hash] data extracted data
|
# @param [Hash] data extracted data
|
||||||
# @return [String] webfinger url
|
# @return [String] webfinger url
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
module WebFinger
|
module WebFinger
|
||||||
##
|
|
||||||
# The WebFinger document used for Diaspora* user discovery is based on an older
|
# The WebFinger document used for Diaspora* user discovery is based on an older
|
||||||
# draft of the specification you can find in the wiki of the "webfinger" project
|
# draft of the specification you can find in the wiki of the "webfinger" project
|
||||||
# on {http://code.google.com/p/webfinger/wiki/WebFingerProtocol Google Code}
|
# on {http://code.google.com/p/webfinger/wiki/WebFingerProtocol Google Code}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
module WebFinger
|
module WebFinger
|
||||||
##
|
|
||||||
# This class implements basic handling of XRD documents as far as it is
|
# This class implements basic handling of XRD documents as far as it is
|
||||||
# necessary in the context of the protocols used with Diaspora* federation.
|
# necessary in the context of the protocols used with Diaspora* federation.
|
||||||
#
|
#
|
||||||
|
|
@ -65,7 +64,6 @@ module DiasporaFederation
|
||||||
@properties = {}
|
@properties = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Generates an XML document from the current instance and returns it as string
|
# Generates an XML document from the current instance and returns it as string
|
||||||
# @return [String] XML document
|
# @return [String] XML document
|
||||||
def to_xml
|
def to_xml
|
||||||
|
|
@ -83,7 +81,6 @@ module DiasporaFederation
|
||||||
builder.to_xml
|
builder.to_xml
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Parse the XRD document from the given string and create a hash containing
|
# Parse the XRD document from the given string and create a hash containing
|
||||||
# the extracted data.
|
# the extracted data.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue