Commit fc948ea
Changed files (21)
lib
saml
kit
builders
lib/saml/kit/bindings/binding.rb
@@ -3,6 +3,7 @@
module Saml
module Kit
module Bindings
+ # This class is a base class for SAML bindings.
# {include:file:spec/saml/kit/bindings/binding_spec.rb}
class Binding
attr_reader :binding, :location
lib/saml/kit/bindings/http_post.rb
@@ -3,6 +3,11 @@
module Saml
module Kit
module Bindings
+ # This class is responsible for
+ # serializing/deserializing SAML
+ # documents using the HTTP Post
+ # binding specification.
+ # https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf
# {include:file:spec/saml/kit/bindings/http_post_spec.rb}
class HttpPost < Binding
include Serializable
lib/saml/kit/bindings/http_redirect.rb
@@ -3,6 +3,11 @@
module Saml
module Kit
module Bindings
+ # This class is responsible for
+ # serializing/deserializing SAML
+ # documents using the HTTP Redirect
+ # binding specification.
+ # https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf
# {include:file:spec/saml/kit/bindings/http_redirect_spec.rb}
class HttpRedirect < Binding
include Serializable
lib/saml/kit/bindings/url_builder.rb
@@ -3,6 +3,11 @@
module Saml
module Kit
module Bindings
+ # This class is responsible for
+ # generating a url as per the
+ # rules for the HTTP redirect binding
+ # specification.
+ # https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf
# {include:file:spec/saml/kit/bindings/url_builder_spec.rb}
class UrlBuilder
include Serializable
lib/saml/kit/builders/assertion.rb
@@ -3,6 +3,7 @@
module Saml
module Kit
module Builders
+ # This class is responsible for building a SAML Assertion
# {include:file:lib/saml/kit/builders/templates/assertion.builder}
class Assertion
include XmlTemplatable
lib/saml/kit/builders/encrypted_assertion.rb
@@ -3,6 +3,7 @@
module Saml
module Kit
module Builders
+ # This class is responsible for encrypting an Assertion.
# {include:file:lib/saml/kit/builders/templates/encrypted_assertion.builder}
class EncryptedAssertion
include XmlTemplatable
lib/saml/kit/assertion.rb
@@ -2,6 +2,9 @@
module Saml
module Kit
+ # This class validates the Assertion
+ # element nested in a Response element
+ # of a SAML document.
class Assertion
include ActiveModel::Validations
include Translatable
lib/saml/kit/bindings.rb
@@ -7,6 +7,9 @@ require 'saml/kit/bindings/url_builder'
module Saml
module Kit
+ # This module is responsible for exposing
+ # the different SAML bindings that are
+ # supported by this gem.
module Bindings
HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'.freeze
HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'.freeze
lib/saml/kit/buildable.rb
@@ -2,6 +2,9 @@
module Saml
module Kit
+ # This module is responsible for
+ # providing an API to build a
+ # document object, xml, or builder class.
module Buildable
extend ActiveSupport::Concern
lib/saml/kit/builders.rb
@@ -13,6 +13,8 @@ require 'saml/kit/builders/service_provider_metadata'
module Saml
module Kit
+ # This module contains all the builders classes
+ # that are used to create SAML documents.
module Builders
end
end
lib/saml/kit/composite_metadata.rb
@@ -2,6 +2,11 @@
module Saml
module Kit
+ # This class implements the Composite
+ # design pattern to allow client
+ # component to work with a metadata
+ # that provides an IDPSSODescriptor
+ # and SPSSODescriptor element.
class CompositeMetadata < Metadata # :nodoc:
include Enumerable
attr_reader :service_provider, :identity_provider
lib/saml/kit/default_registry.rb
@@ -69,6 +69,9 @@ module Saml
end
end
+ # This class is responsible for
+ # making HTTP requests to fetch metadata
+ # from remote locations.
class HttpApi # :nodoc:
def initialize(url, verify_ssl: true)
@uri = URI.parse(url)
lib/saml/kit/document.rb
@@ -2,6 +2,7 @@
module Saml
module Kit
+ # This class is a base class for SAML documents.
class Document
include ActiveModel::Validations
include XsdValidatable
lib/saml/kit/invalid_document.rb
@@ -2,6 +2,8 @@
module Saml
module Kit
+ # This class represents an invalid SAML
+ # document that could not be parsed.
# {include:file:spec/saml/kit/invalid_document_spec.rb}
class InvalidDocument < Document
validate do |model|
lib/saml/kit/null_assertion.rb
@@ -2,6 +2,9 @@
module Saml
module Kit
+ # This class is an implementation of the
+ # Null Object pattern for when a Response
+ # is missing an Assertion.
class NullAssertion
include ActiveModel::Validations
include Translatable
lib/saml/kit/requestable.rb
@@ -2,6 +2,10 @@
module Saml
module Kit
+ # This module is responsible for providing
+ # the functionality available to all
+ # SAML request documents.
+ # e.g. AuthnRequest, LogoutRequest.
module Requestable
extend ActiveSupport::Concern
lib/saml/kit/respondable.rb
@@ -2,6 +2,9 @@
module Saml
module Kit
+ # This module provides the behaviours
+ # associated with SAML Response documents.
+ # .e.g. Response, LogoutResponse
module Respondable
extend ActiveSupport::Concern
attr_reader :request_id
lib/saml/kit/response.rb
@@ -2,6 +2,8 @@
module Saml
module Kit
+ # This class is responsible for validating and
+ # parsing a SAML Response document.
# {include:file:spec/examples/response_spec.rb}
class Response < Document
include Respondable
lib/saml/kit/serializable.rb
@@ -2,6 +2,7 @@
module Saml
module Kit
+ # This module is responsible for serializing/deserialing values.
module Serializable
# Base 64 decodes the value.
#
lib/saml/kit.rb
@@ -48,7 +48,11 @@ I18n.load_path +=
Dir[File.expand_path('kit/locales/*.yml', File.dirname(__FILE__))]
module Saml
+ # This module is the container for all classes/modules in this gem.
module Kit
+ # This class provides a global access to the
+ # default SAML configuration. This is useful
+ # for long running processes.
class << self
def configuration
@configuration ||= Saml::Kit::Configuration.new
.reek
@@ -61,28 +61,6 @@ ControlParameter:
- Saml::Kit::Document#to_xml
- Saml::Kit::Metadata#to_xml
- Saml::Kit::Signature#to_xml
-IrresponsibleModule:
- exclude:
- - Saml::Kit::Assertion
- - Saml::Kit::Bindings::Binding
- - Saml::Kit::Bindings::HttpPost
- - Saml::Kit::Bindings::HttpRedirect
- - Saml::Kit::Bindings::UrlBuilder
- - Saml::Kit::Bindings
- - Saml::Kit::Buildable
- - Saml::Kit::Builders::Assertion
- - Saml::Kit::Builders::EncryptedAssertion
- - Saml::Kit::Builders
- - Saml::Kit::CompositeMetadata
- - Saml::Kit::DefaultRegistry::HttpApi
- - Saml::Kit::Document
- - Saml::Kit::InvalidDocument
- - Saml::Kit::NullAssertion
- - Saml::Kit::Requestable
- - Saml::Kit::Respondable
- - Saml::Kit::Response
- - Saml::Kit::Serializable
- - Saml::Kit
PrimaDonnaMethod:
exclude:
- Saml::Kit::Assertion