diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1daf9bf4c..da9714b0f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-07-08 09:28:53 UTC using RuboCop version 1.64.1. +# on 2024-07-08 10:27:10 UTC using RuboCop version 1.64.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -10,15 +10,15 @@ # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLineAfterGuardClause: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' # Offense count: 9 # This cop supports safe autocorrection (--autocorrect). @@ -26,19 +26,19 @@ Layout/EmptyLineAfterGuardClause: # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only Layout/EmptyLinesAroundClassBody: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' - 'lib/xml_security.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLinesAroundMethodBody: Exclude: - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 12 # This cop supports safe autocorrection (--autocorrect). @@ -46,17 +46,17 @@ Layout/EmptyLinesAroundMethodBody: # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines Layout/EmptyLinesAroundModuleBody: Exclude: - - 'lib/onelogin/ruby-saml/attribute_service.rb' - - 'lib/onelogin/ruby-saml/attributes.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/attribute_service.rb' + - 'lib/ruby_saml/attributes.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 1 @@ -64,15 +64,15 @@ Layout/EmptyLinesAroundModuleBody: # SupportedStyles: native, lf, crlf Layout/EndOfLine: Exclude: - - 'lib/onelogin/ruby-saml/setting_error.rb' + - 'lib/ruby_saml.rb' # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. Layout/ExtraSpacing: Exclude: - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/response.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/response.rb' # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). @@ -80,7 +80,7 @@ Layout/ExtraSpacing: # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses Layout/FirstArgumentIndentation: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' + - 'lib/ruby_saml/response.rb' - 'lib/xml_security.rb' # Offense count: 5 @@ -89,31 +89,22 @@ Layout/FirstArgumentIndentation: # SupportedStyles: special_inside_parentheses, consistent, align_braces Layout/FirstHashElementIndentation: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/metadata.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: normal, indented_internal_methods -Layout/IndentationConsistency: - Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - -# Offense count: 6 +# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Width, AllowedPatterns. Layout/IndentationWidth: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/response.rb' + - 'lib/ruby_saml/response.rb' # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). Layout/SpaceAfterComma: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/settings.rb' - 'lib/xml_security.rb' # Offense count: 12 @@ -122,13 +113,13 @@ Layout/SpaceAfterComma: # SupportedStyles: space, no_space Layout/SpaceAroundEqualsInParameterDefault: Exclude: - - 'lib/onelogin/ruby-saml/attribute_service.rb' - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/attribute_service.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 16 # This cop supports safe autocorrection (--autocorrect). @@ -137,8 +128,8 @@ Layout/SpaceAroundEqualsInParameterDefault: # SupportedStylesForRationalLiterals: space, no_space Layout/SpaceAroundOperators: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 5 @@ -148,8 +139,8 @@ Layout/SpaceAroundOperators: # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceInsideBlockBraces: Exclude: - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 37 # This cop supports safe autocorrection (--autocorrect). @@ -158,36 +149,25 @@ Layout/SpaceInsideBlockBraces: # SupportedStylesForEmptyBraces: space, no_space Layout/SpaceInsideHashLiteralBraces: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' - 'lib/xml_security.rb' -# Offense count: 4 +# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line Layout/TrailingEmptyLines: Exclude: - - 'lib/onelogin/ruby-saml/http_error.rb' - - 'lib/onelogin/ruby-saml/setting_error.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/validation_error.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowInHeredoc. -Layout/TrailingWhitespace: - Exclude: - - 'lib/onelogin/ruby-saml/attributes.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' + - 'lib/ruby_saml.rb' # Offense count: 2 Lint/NoReturnInBeginEndBlocks: Exclude: - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). @@ -195,23 +175,23 @@ Lint/NoReturnInBeginEndBlocks: # SupportedStyles: strict, consistent Lint/SymbolConversion: Exclude: - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/settings.rb' # Offense count: 1 # Configuration parameters: AllowedPatterns. # AllowedPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) Lint/UnreachableLoop: Exclude: - - 'lib/onelogin/ruby-saml/saml_message.rb' + - 'lib/ruby_saml/saml_message.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AutoCorrect. Lint/UselessAssignment: Exclude: - - 'lib/onelogin/ruby-saml/logging.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/logging.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 42 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. @@ -252,17 +232,16 @@ Metrics/PerceivedComplexity: # Offense count: 13 Naming/AccessorMethodName: Exclude: - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/utils.rb' -# Offense count: 2 +# Offense count: 1 # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. # CheckDefinitionPathHierarchyRoots: lib, spec, test, src # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Exclude: - 'Rakefile.rb' - - 'lib/onelogin/ruby-saml.rb' - 'lib/ruby-saml.rb' # Offense count: 2 @@ -271,7 +250,7 @@ Naming/FileName: # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' + - 'lib/ruby_saml/response.rb' # Offense count: 4 # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. @@ -282,53 +261,53 @@ Naming/MemoizedInstanceVariableName: Naming/PredicateName: Exclude: - 'spec/**/*' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Exclude: - - 'lib/onelogin/ruby-saml/saml_message.rb' + - 'lib/ruby_saml/saml_message.rb' # Offense count: 14 # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, camelCase Naming/VariableName: Exclude: - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 1 # Configuration parameters: MinSize. Performance/CollectionLiteralInLoop: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' + - 'lib/ruby_saml/response.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowRegexpMatch. Performance/RedundantEqualityComparisonBlock: Exclude: - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/settings.rb' # Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/StringInclude: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 8 # This cop supports safe autocorrection (--autocorrect). Performance/StringReplacement: Exclude: - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 54 @@ -337,12 +316,12 @@ Performance/StringReplacement: # SupportedStyles: separated, grouped Style/AccessorGrouping: Exclude: - - 'lib/onelogin/ruby-saml/attribute_service.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/attribute_service.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). @@ -350,10 +329,10 @@ Style/AccessorGrouping: # SupportedStyles: prefer_alias, prefer_alias_method Style/Alias: Exclude: - - 'lib/onelogin/ruby-saml/attributes.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/attributes.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 13 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -361,16 +340,16 @@ Style/Alias: # SupportedStyles: always, conditionals Style/AndOr: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' # Offense count: 3 Style/ClassVars: Exclude: - - 'lib/onelogin/ruby-saml/attributes.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' + - 'lib/ruby_saml/attributes.rb' + - 'lib/ruby_saml/saml_message.rb' # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). @@ -378,22 +357,21 @@ Style/ClassVars: # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' - 'lib/xml_security.rb' -# Offense count: 8 +# Offense count: 6 # Configuration parameters: AllowedConstants. Style/Documentation: Exclude: - 'spec/**/*' - 'test/**/*' - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/error_handling.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logging.rb' + - 'lib/ruby_saml/error_handling.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logging.rb' - 'lib/xml_security.rb' # Offense count: 2 @@ -401,8 +379,8 @@ Style/Documentation: # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/settings.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -410,8 +388,8 @@ Style/GuardClause: # AllowedReceivers: Thread.current Style/HashEachMethods: Exclude: - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/settings.rb' # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). @@ -420,24 +398,24 @@ Style/HashEachMethods: # SupportedShorthandSyntax: always, never, either, consistent, either_consistent Style/HashSyntax: Exclude: - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/settings.rb' # Offense count: 66 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/error_handling.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/error_handling.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 15 @@ -445,28 +423,28 @@ Style/IfUnlessModifier: # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: Exclude: - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Style/RedundantBegin: Exclude: - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/utils.rb' # Offense count: 8 # This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpArgument: Exclude: - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 3 @@ -475,8 +453,8 @@ Style/RedundantRegexpArgument: # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -484,46 +462,45 @@ Style/RegexpLiteral: # AllowedMethods: present?, blank?, presence, try, try! Style/SafeNavigation: Exclude: - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' # Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: Exclude: - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' -# Offense count: 443 +# Offense count: 440 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Exclude: - - 'lib/onelogin/ruby-saml/attribute_service.rb' - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/error_handling.rb' - - 'lib/onelogin/ruby-saml/idp_metadata_parser.rb' - - 'lib/onelogin/ruby-saml/logging.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/logoutresponse.rb' - - 'lib/onelogin/ruby-saml/metadata.rb' - - 'lib/onelogin/ruby-saml/response.rb' - - 'lib/onelogin/ruby-saml/saml_message.rb' - - 'lib/onelogin/ruby-saml/settings.rb' - - 'lib/onelogin/ruby-saml/slo_logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' - - 'lib/onelogin/ruby-saml/utils.rb' + - 'lib/ruby_saml/attribute_service.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/error_handling.rb' + - 'lib/ruby_saml/idp_metadata_parser.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/logoutresponse.rb' + - 'lib/ruby_saml/metadata.rb' + - 'lib/ruby_saml/response.rb' + - 'lib/ruby_saml/saml_message.rb' + - 'lib/ruby_saml/settings.rb' + - 'lib/ruby_saml/slo_logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/utils.rb' - 'lib/xml_security.rb' # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). Style/SuperArguments: Exclude: - - 'lib/onelogin/ruby-saml/authrequest.rb' - - 'lib/onelogin/ruby-saml/logoutrequest.rb' - - 'lib/onelogin/ruby-saml/slo_logoutresponse.rb' + - 'lib/ruby_saml/authrequest.rb' + - 'lib/ruby_saml/logoutrequest.rb' + - 'lib/ruby_saml/slo_logoutresponse.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). @@ -531,11 +508,11 @@ Style/SuperArguments: # SupportedStyles: percent, brackets Style/SymbolArray: Exclude: - - 'lib/onelogin/ruby-saml/settings.rb' + - 'lib/ruby_saml/settings.rb' -# Offense count: 103 +# Offense count: 94 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: - Max: 254 + Max: 252 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f100c9c5..554006f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # Ruby SAML Changelog ### 2.0.0 -* Remove OneLogin namespace. The root namespace of the gem is now "RubySaml". +* [#685](https://github.com/SAML-Toolkits/ruby-saml/pull/685) Remove `OneLogin` namespace. The root namespace of the gem is now `RubySaml`. +* [#685](https://github.com/SAML-Toolkits/ruby-saml/pull/685) Change directly structure from `lib/onelogin/ruby-saml` to `lib/ruby_saml`. +* [#685](https://github.com/SAML-Toolkits/ruby-saml/pull/685) Move schema files from `lib/onelogin/schemas` to `lib/ruby_saml/schemas`. ### 1.17.0 * [#673](https://github.com/SAML-Toolkits/ruby-saml/pull/673) Add `Settings#sp_cert_multi` paramter to facilitate SP certificate and key rotation. @@ -23,26 +25,26 @@ * Fix tests, Adjust dependencies, Add ruby 3.2 and new jruby versions tests to the CI. Add coveralls support ### 1.14.0 (Feb 01, 2022) -* [#627](https://github.com/onelogin/ruby-saml/pull/627) Support escape downcasing for validating SLO Signatures of ADFS/Azure -* [#633](https://github.com/onelogin/ruby-saml/pull/633) Support ability to change ID prefix +* [#627](https://github.com/ruby_saml/pull/627) Support escape downcasing for validating SLO Signatures of ADFS/Azure +* [#633](https://github.com/ruby_saml/pull/633) Support ability to change ID prefix * Make the uuid editable on the SAML Messages generated by the toolkit -* [#622](https://github.com/onelogin/ruby-saml/pull/622) Add security setting to more strictly enforce audience validation +* [#622](https://github.com/ruby_saml/pull/622) Add security setting to more strictly enforce audience validation ### 1.13.0 (Sept 06, 2021) -* [#611](https://github.com/onelogin/ruby-saml/pull/601) Replace MAX_BYTE_SIZE constant with setting: message_max_bytesize -* [#605](https://github.com/onelogin/ruby-saml/pull/605) :allowed_clock_drift is now bidrectional -* [#614](https://github.com/onelogin/ruby-saml/pull/614) Support :name_id_format option for IdpMetadataParser -* [#611](https://github.com/onelogin/ruby-saml/pull/611) IdpMetadataParser should always set idp_cert_multi, even when there is only one cert -* [#610](https://github.com/onelogin/ruby-saml/pull/610) New IDP sso/slo binding params which deprecate :embed_sign -* [#602](https://github.com/onelogin/ruby-saml/pull/602) Refactor the OneLogin::RubySaml::Metadata class -* [#586](https://github.com/onelogin/ruby-saml/pull/586) Support milliseconds in cacheDuration parsing -* [#585](https://github.com/onelogin/ruby-saml/pull/585) Do not append " | " to StatusCode unnecessarily -* [#607](https://github.com/onelogin/ruby-saml/pull/607) Clean up +* [#611](https://github.com/ruby_saml/pull/601) Replace MAX_BYTE_SIZE constant with setting: message_max_bytesize +* [#605](https://github.com/ruby_saml/pull/605) :allowed_clock_drift is now bidrectional +* [#614](https://github.com/ruby_saml/pull/614) Support :name_id_format option for IdpMetadataParser +* [#611](https://github.com/ruby_saml/pull/611) IdpMetadataParser should always set idp_cert_multi, even when there is only one cert +* [#610](https://github.com/ruby_saml/pull/610) New IDP sso/slo binding params which deprecate :embed_sign +* [#602](https://github.com/ruby_saml/pull/602) Refactor the OneLogin::RubySaml::Metadata class +* [#586](https://github.com/ruby_saml/pull/586) Support milliseconds in cacheDuration parsing +* [#585](https://github.com/ruby_saml/pull/585) Do not append " | " to StatusCode unnecessarily +* [#607](https://github.com/ruby_saml/pull/607) Clean up * Add warning about the use of IdpMetadataParser class and SSRF * CI: Migrate from Travis to Github Actions ### 1.12.2 (Apr 08, 2021) -* [#575](https://github.com/onelogin/ruby-saml/pull/575) Fix SloLogoutresponse bug on LogoutRequest +* [#575](https://github.com/ruby_saml/pull/575) Fix SloLogoutresponse bug on LogoutRequest ### 1.12.1 (Apr 05, 2021) * Fix XPath typo incompatible with Rexml 3.2.5 @@ -52,18 +54,18 @@ * Support AES-128-GCM, AES-192-GCM, and AES-256-GCM encryptions * Parse & return SLO ResponseLocation in IDPMetadataParser & Settings * Adding idp_sso_service_url and idp_slo_service_url settings -* [#536](https://github.com/onelogin/ruby-saml/pull/536) Adding feth method to be able retrieve attributes based on regex +* [#536](https://github.com/ruby_saml/pull/536) Adding feth method to be able retrieve attributes based on regex * Reduce size of built gem by excluding the test folder * Improve protection on Zlib deflate decompression bomb attack. * Add ValidUntil and cacheDuration support on Metadata generator * Add support for cacheDuration at the IdpMetadataParser * Support customizable statusCode on generated LogoutResponse -* [#545](https://github.com/onelogin/ruby-saml/pull/545) More specific error messages for signature validation +* [#545](https://github.com/ruby_saml/pull/545) More specific error messages for signature validation * Support Process Transform * Raise SettingError if invoking an action with no endpoint defined on the settings * Made IdpMetadataParser more extensible for subclasses -* [#548](https://github.com/onelogin/ruby-saml/pull/548) Add :skip_audience option -* [#555](https://github.com/onelogin/ruby-saml/pull/555) Define 'soft' variable to prevent exception when doc cert is invalid +* [#548](https://github.com/ruby_saml/pull/548) Add :skip_audience option +* [#555](https://github.com/ruby_saml/pull/555) Define 'soft' variable to prevent exception when doc cert is invalid * Improve documentation ### 1.11.0 (Jul 24, 2019) @@ -87,54 +89,54 @@ * Forces nokogiri >= 1.8.2 when possible ### 1.9.0 (Sept 03, 2018) -* [#458](https://github.com/onelogin/ruby-saml/pull/458) Remove ruby 2.4+ warnings +* [#458](https://github.com/ruby_saml/pull/458) Remove ruby 2.4+ warnings * Improve JRuby support -* [#465](https://github.com/onelogin/ruby-saml/pull/465) Extend Settings initialization with the new keep_security_attributes parameter +* [#465](https://github.com/ruby_saml/pull/465) Extend Settings initialization with the new keep_security_attributes parameter * Fix wrong message when SessionNotOnOrAfter expired -* [#471](https://github.com/onelogin/ruby-saml/pull/471) Allow for `allowed_clock_drift` to be set as a string +* [#471](https://github.com/ruby_saml/pull/471) Allow for `allowed_clock_drift` to be set as a string ### 1.8.0 (April 23, 2018) -* [#437](https://github.com/onelogin/ruby-saml/issues/437) Creating AuthRequests/LogoutRequests/LogoutResponses with nil RelayState should not send empty RelayState URL param -* [#454](https://github.com/onelogin/ruby-saml/pull/454) Added Response available options -* [#453](https://github.com/onelogin/ruby-saml/pull/453) Raise a more descriptive exception if idp_sso_target_url is missing -* [#452](https://github.com/onelogin/ruby-saml/pull/452) Fix behavior of skip_conditions flag on Response -* [#449](https://github.com/onelogin/ruby-saml/pull/449) Add ability to skip authnstatement validation +* [#437](https://github.com/ruby_saml/issues/437) Creating AuthRequests/LogoutRequests/LogoutResponses with nil RelayState should not send empty RelayState URL param +* [#454](https://github.com/ruby_saml/pull/454) Added Response available options +* [#453](https://github.com/ruby_saml/pull/453) Raise a more descriptive exception if idp_sso_target_url is missing +* [#452](https://github.com/ruby_saml/pull/452) Fix behavior of skip_conditions flag on Response +* [#449](https://github.com/ruby_saml/pull/449) Add ability to skip authnstatement validation * Clear cached values to be able to use IdpMetadataParser more than once * Updated invalid audience error message ### 1.7.2 (Feb 28, 2018) -* [#446](https://github.com/onelogin/ruby-saml/pull/446) Normalize text returned by OneLogin::RubySaml::Utils.element_text +* [#446](https://github.com/ruby_saml/pull/446) Normalize text returned by OneLogin::RubySaml::Utils.element_text ### 1.7.1 (Feb 28, 2018) -* [#444](https://github.com/onelogin/ruby-saml/pull/444) Fix audience validation for empty audience restriction +* [#444](https://github.com/ruby_saml/pull/444) Fix audience validation for empty audience restriction ### 1.7.0 (Feb 27, 2018) * Fix vulnerability CVE-2017-11428. Process text of nodes properly, ignoring comments ### 1.6.1 (January 15, 2018) -* [#428](https://github.com/onelogin/ruby-saml/issues/428) Fix a bug on IdPMetadataParser when parsing certificates -* [#426](https://github.com/onelogin/ruby-saml/pull/426) Ensure `Rails` responds to `logger` +* [#428](https://github.com/ruby_saml/issues/428) Fix a bug on IdPMetadataParser when parsing certificates +* [#426](https://github.com/ruby_saml/pull/426) Ensure `Rails` responds to `logger` ### 1.6.0 (November 27, 2017) -* [#418](https://github.com/onelogin/ruby-saml/pull/418) Improve SAML message signature validation using original encoded parameters instead decoded in order to avoid conflicts (URL-encoding is not canonical, reported issues with ADFS) -* [#420](https://github.com/onelogin/ruby-saml/pull/420) Expose NameID Format on SloLogoutrequest -* [#423](https://github.com/onelogin/ruby-saml/pull/423) Allow format_cert to work with chained certificates -* [#422](https://github.com/onelogin/ruby-saml/pull/422) Use to_s for requested attribute value +* [#418](https://github.com/ruby_saml/pull/418) Improve SAML message signature validation using original encoded parameters instead decoded in order to avoid conflicts (URL-encoding is not canonical, reported issues with ADFS) +* [#420](https://github.com/ruby_saml/pull/420) Expose NameID Format on SloLogoutrequest +* [#423](https://github.com/ruby_saml/pull/423) Allow format_cert to work with chained certificates +* [#422](https://github.com/ruby_saml/pull/422) Use to_s for requested attribute value ### 1.5.0 (August 31, 2017) -* [#400](https://github.com/onelogin/ruby-saml/pull/400) When validating Signature use stored IdP certficate if Signature contains no info about Certificate -* [#402](https://github.com/onelogin/ruby-saml/pull/402) Fix validate_response_state method that rejected SAMLResponses when using idp_cert_multi and idp_cert and idp_cert_fingerprint were not provided. -* [#411](https://github.com/onelogin/ruby-saml/pull/411) Allow space in Base64 string -* [#407](https://github.com/onelogin/ruby-saml/issues/407) Improve IdpMetadataParser raising an ArgumentError when parser method receive a metadata string with no IDPSSODescriptor element. -* [#374](https://github.com/onelogin/ruby-saml/issues/374) Support more than one level of StatusCode -* [#405](https://github.com/onelogin/ruby-saml/pull/405) Support ADFS encrypted key (Accept KeyInfo nodes with no ds namespace) +* [#400](https://github.com/ruby_saml/pull/400) When validating Signature use stored IdP certficate if Signature contains no info about Certificate +* [#402](https://github.com/ruby_saml/pull/402) Fix validate_response_state method that rejected SAMLResponses when using idp_cert_multi and idp_cert and idp_cert_fingerprint were not provided. +* [#411](https://github.com/ruby_saml/pull/411) Allow space in Base64 string +* [#407](https://github.com/ruby_saml/issues/407) Improve IdpMetadataParser raising an ArgumentError when parser method receive a metadata string with no IDPSSODescriptor element. +* [#374](https://github.com/ruby_saml/issues/374) Support more than one level of StatusCode +* [#405](https://github.com/ruby_saml/pull/405) Support ADFS encrypted key (Accept KeyInfo nodes with no ds namespace) ### 1.4.3 (May 18, 2017) * Added SubjectConfirmation Recipient validation -* [#393](https://github.com/onelogin/ruby-saml/pull/393) Implement IdpMetadataParser#parse_to_hash +* [#393](https://github.com/ruby_saml/pull/393) Implement IdpMetadataParser#parse_to_hash * Adapt IdP XML metadata parser to take care of multiple IdP certificates and be able to inject the data obtained on the settings. * Improve binding detection on idp metadata parser -* [#373](https://github.com/onelogin/ruby-saml/pull/373) Allow metadata to be retrieved from source containing data for multiple entities +* [#373](https://github.com/ruby_saml/pull/373) Allow metadata to be retrieved from source containing data for multiple entities * Be able to register future SP x509cert on the settings and publish it on SP metadata * Be able to register more than 1 Identity Provider x509cert, linked with an specific use (signing or encryption. * Improve regex to detect base64 encoded messages @@ -149,11 +151,11 @@ * Only publish `KeyDescriptor[use="encryption"]` at SP metadata if `security[:want_assertions_encrypted]` is true * Be able to skip destination validation * Improved inResponse validation on SAMLResponses and LogoutResponses -* [#354](https://github.com/onelogin/ruby-saml/pull/354) Allow scheme and domain to match ignoring case -* [#363](https://github.com/onelogin/ruby-saml/pull/363) Add support for multiple requested attributes +* [#354](https://github.com/ruby_saml/pull/354) Allow scheme and domain to match ignoring case +* [#363](https://github.com/ruby_saml/pull/363) Add support for multiple requested attributes ### 1.4.1 (October 19, 2016) -* [#357](https://github.com/onelogin/ruby-saml/pull/357) Add EncryptedAttribute support. Improve decrypt method +* [#357](https://github.com/ruby_saml/pull/357) Add EncryptedAttribute support. Improve decrypt method * Allow multiple authn_context_decl_ref in settings * Allow options[:settings] to be an hash for Settings overrides in IdpMetadataParser#parse * Recover issuers method @@ -169,128 +171,128 @@ * Destination value can't be blank (if present must match ACS URL). * Check that the EncryptedAssertion element only contains 1 Assertion element. -* [#335](https://github.com/onelogin/ruby-saml/pull/335) Explicitly parse as XML and fix setting of Nokogiri options. -* [#345](https://github.com/onelogin/ruby-saml/pull/345)Support multiple settings.auth_context +* [#335](https://github.com/ruby_saml/pull/335) Explicitly parse as XML and fix setting of Nokogiri options. +* [#345](https://github.com/ruby_saml/pull/345)Support multiple settings.auth_context * More tests to prevent XML Signature Wrapping -* [#342](https://github.com/onelogin/ruby-saml/pull/342) Correct the usage of Mutex -* [352](https://github.com/onelogin/ruby-saml/pull/352) Support multiple AttributeStatement tags +* [#342](https://github.com/ruby_saml/pull/342) Correct the usage of Mutex +* [352](https://github.com/ruby_saml/pull/352) Support multiple AttributeStatement tags ### 1.3.1 (July 10, 2016) * Fix response_test.rb of gem 1.3.0 * Add reference to Security Guidelines * Update License -* [#334](https://github.com/onelogin/ruby-saml/pull/334) Keep API backward-compatibility on IdpMetadataParser fingerprint method. +* [#334](https://github.com/ruby_saml/pull/334) Keep API backward-compatibility on IdpMetadataParser fingerprint method. ### 1.3.0 (June 24, 2016) -* [Security Fix](https://github.com/onelogin/ruby-saml/commit/a571f52171e6bfd87db59822d1d9e8c38fb3b995) Add extra validations to prevent Signature wrapping attacks +* [Security Fix](https://github.com/ruby_saml/commit/a571f52171e6bfd87db59822d1d9e8c38fb3b995) Add extra validations to prevent Signature wrapping attacks * Fix XMLSecurity SHA256 and SHA512 uris -* [#326](https://github.com/onelogin/ruby-saml/pull/326) Fix Destination validation +* [#326](https://github.com/ruby_saml/pull/326) Fix Destination validation ### 1.2.0 (April 29, 2016) -* [#269](https://github.com/onelogin/ruby-saml/pull/269) Refactor error handling; allow collect error messages when soft=true (normal validation stop after find first error) -* [#289](https://github.com/onelogin/ruby-saml/pull/289) Remove uuid gem in favor of SecureRandom -* [#297](https://github.com/onelogin/ruby-saml/pull/297) Implement EncryptedKey RetrievalMethod support -* [#298](https://github.com/onelogin/ruby-saml/pull/298) IDP metadata parsing improved: binding parsing, fingerprint_algorithm support) -* [#299](https://github.com/onelogin/ruby-saml/pull/299) Make 'signing' at KeyDescriptor optional -* [#308](https://github.com/onelogin/ruby-saml/pull/308) Support name_id_format on SAMLResponse -* [#315](https://github.com/onelogin/ruby-saml/pull/315) Support for canonicalization with comments -* [#316](https://github.com/onelogin/ruby-saml/pull/316) Fix Misspelling of transation_id to transaction_id -* [#321](https://github.com/onelogin/ruby-saml/pull/321) Support Attribute Names on IDPSSODescriptor parser +* [#269](https://github.com/ruby_saml/pull/269) Refactor error handling; allow collect error messages when soft=true (normal validation stop after find first error) +* [#289](https://github.com/ruby_saml/pull/289) Remove uuid gem in favor of SecureRandom +* [#297](https://github.com/ruby_saml/pull/297) Implement EncryptedKey RetrievalMethod support +* [#298](https://github.com/ruby_saml/pull/298) IDP metadata parsing improved: binding parsing, fingerprint_algorithm support) +* [#299](https://github.com/ruby_saml/pull/299) Make 'signing' at KeyDescriptor optional +* [#308](https://github.com/ruby_saml/pull/308) Support name_id_format on SAMLResponse +* [#315](https://github.com/ruby_saml/pull/315) Support for canonicalization with comments +* [#316](https://github.com/ruby_saml/pull/316) Fix Misspelling of transation_id to transaction_id +* [#321](https://github.com/ruby_saml/pull/321) Support Attribute Names on IDPSSODescriptor parser * Changes on empty URI of Signature reference management -* [#320](https://github.com/onelogin/ruby-saml/pull/320) Dont mutate document to fix lack of reference URI -* [#306](https://github.com/onelogin/ruby-saml/pull/306) Support WantAssertionsSigned +* [#320](https://github.com/ruby_saml/pull/320) Dont mutate document to fix lack of reference URI +* [#306](https://github.com/ruby_saml/pull/306) Support WantAssertionsSigned ### 1.1.2 (February 15, 2016) * Improve signature validation. Add tests. - [#302](https://github.com/onelogin/ruby-saml/pull/302) Add Destination validation. -* [#292](https://github.com/onelogin/ruby-saml/pull/292) Improve the error message when validating the audience. -* [#287](https://github.com/onelogin/ruby-saml/pull/287) Keep the extracted certificate when parsing IdP metadata. + [#302](https://github.com/ruby_saml/pull/302) Add Destination validation. +* [#292](https://github.com/ruby_saml/pull/292) Improve the error message when validating the audience. +* [#287](https://github.com/ruby_saml/pull/287) Keep the extracted certificate when parsing IdP metadata. ### 1.1.1 (November 10, 2015) -* [#275](https://github.com/onelogin/ruby-saml/pull/275) Fix a bug on signature validations that invalidates valid SAML messages. +* [#275](https://github.com/ruby_saml/pull/275) Fix a bug on signature validations that invalidates valid SAML messages. ### 1.1.0 (October 27, 2015) -* [#273](https://github.com/onelogin/ruby-saml/pull/273) Support SAMLResponse without ds:x509certificate -* [#270](https://github.com/onelogin/ruby-saml/pull/270) Allow SAML elements to come from any namespace (at decryption process) -* [#261](https://github.com/onelogin/ruby-saml/pull/261) Allow validate_subject_confirmation Response validation to be skipped -* [#258](https://github.com/onelogin/ruby-saml/pull/258) Fix allowed_clock_drift on the validate_session_expiration test -* [#256](https://github.com/onelogin/ruby-saml/pull/256) Separate the create_authentication_xml_doc in two methods. -* [#255](https://github.com/onelogin/ruby-saml/pull/255) Refactor validate signature. -* [#254](https://github.com/onelogin/ruby-saml/pull/254) Handle empty URI references -* [#251](https://github.com/onelogin/ruby-saml/pull/251) Support qualified and unqualified NameID in attributes -* [#234](https://github.com/onelogin/ruby-saml/pull/234) Add explicit support for JRuby +* [#273](https://github.com/ruby_saml/pull/273) Support SAMLResponse without ds:x509certificate +* [#270](https://github.com/ruby_saml/pull/270) Allow SAML elements to come from any namespace (at decryption process) +* [#261](https://github.com/ruby_saml/pull/261) Allow validate_subject_confirmation Response validation to be skipped +* [#258](https://github.com/ruby_saml/pull/258) Fix allowed_clock_drift on the validate_session_expiration test +* [#256](https://github.com/ruby_saml/pull/256) Separate the create_authentication_xml_doc in two methods. +* [#255](https://github.com/ruby_saml/pull/255) Refactor validate signature. +* [#254](https://github.com/ruby_saml/pull/254) Handle empty URI references +* [#251](https://github.com/ruby_saml/pull/251) Support qualified and unqualified NameID in attributes +* [#234](https://github.com/ruby_saml/pull/234) Add explicit support for JRuby ### 1.0.0 (June 30, 2015) -* [#247](https://github.com/onelogin/ruby-saml/pull/247) Avoid entity expansion (XEE attacks) -* [#246](https://github.com/onelogin/ruby-saml/pull/246) Fix bug generating Logout Response (issuer was at wrong order) -* [#243](https://github.com/onelogin/ruby-saml/issues/243) and [#244](https://github.com/onelogin/ruby-saml/issues/244) Fix metadata builder errors. Fix metadata xsd. -* [#241](https://github.com/onelogin/ruby-saml/pull/241) Add decrypt support (EncryptID and EncryptedAssertion). Improve compatibility with namespaces. -* [#240](https://github.com/onelogin/ruby-saml/pull/240) and [#238](https://github.com/onelogin/ruby-saml/pull/238) Improve test coverage and refactor. -* [#239](https://github.com/onelogin/ruby-saml/pull/239) Improve security: Add more validations to SAMLResponse, LogoutRequest and LogoutResponse. Refactor code and improve tests coverage. -* [#237](https://github.com/onelogin/ruby-saml/pull/237) Don't pretty print metadata by default. -* [#235](https://github.com/onelogin/ruby-saml/pull/235) Remove the soft parameter from validation methods. Now can be configured on the settings and each class read it and store as an attribute of the class. Adding some validations and refactor old ones. -* [#232](https://github.com/onelogin/ruby-saml/pull/232) Improve validations: Store the causes in the errors array, code refactor -* [#231](https://github.com/onelogin/ruby-saml/pull/231) Refactor HTTP-Redirect Sign method, Move test data to right folder -* [#226](https://github.com/onelogin/ruby-saml/pull/226) Ensure IdP certificate is formatted properly -* [#225](https://github.com/onelogin/ruby-saml/pull/225) Add documentation to several methods. Fix xpath injection on xml_security.rb -* [#223](https://github.com/onelogin/ruby-saml/pull/223) Allow logging to be delegated to an arbitrary Logger -* [#222](https://github.com/onelogin/ruby-saml/pull/222) No more silent failure fetching idp metadata (OneLogin::RubySaml::HttpError raised). +* [#247](https://github.com/ruby_saml/pull/247) Avoid entity expansion (XEE attacks) +* [#246](https://github.com/ruby_saml/pull/246) Fix bug generating Logout Response (issuer was at wrong order) +* [#243](https://github.com/ruby_saml/issues/243) and [#244](https://github.com/ruby_saml/issues/244) Fix metadata builder errors. Fix metadata xsd. +* [#241](https://github.com/ruby_saml/pull/241) Add decrypt support (EncryptID and EncryptedAssertion). Improve compatibility with namespaces. +* [#240](https://github.com/ruby_saml/pull/240) and [#238](https://github.com/ruby_saml/pull/238) Improve test coverage and refactor. +* [#239](https://github.com/ruby_saml/pull/239) Improve security: Add more validations to SAMLResponse, LogoutRequest and LogoutResponse. Refactor code and improve tests coverage. +* [#237](https://github.com/ruby_saml/pull/237) Don't pretty print metadata by default. +* [#235](https://github.com/ruby_saml/pull/235) Remove the soft parameter from validation methods. Now can be configured on the settings and each class read it and store as an attribute of the class. Adding some validations and refactor old ones. +* [#232](https://github.com/ruby_saml/pull/232) Improve validations: Store the causes in the errors array, code refactor +* [#231](https://github.com/ruby_saml/pull/231) Refactor HTTP-Redirect Sign method, Move test data to right folder +* [#226](https://github.com/ruby_saml/pull/226) Ensure IdP certificate is formatted properly +* [#225](https://github.com/ruby_saml/pull/225) Add documentation to several methods. Fix xpath injection on xml_security.rb +* [#223](https://github.com/ruby_saml/pull/223) Allow logging to be delegated to an arbitrary Logger +* [#222](https://github.com/ruby_saml/pull/222) No more silent failure fetching idp metadata (OneLogin::RubySaml::HttpError raised). ### 0.9.2 (Apr 28, 2015) -* [#216](https://github.com/onelogin/ruby-saml/pull/216) Add fingerprint algorithm support -* [#218](https://github.com/onelogin/ruby-saml/pull/218) Update README.md -* [#214](https://github.com/onelogin/ruby-saml/pull/214) Cleanup `SamlMessage` class -* [#213](https://github.com/onelogin/ruby-saml/pull/213) Add ability to sign metadata. (Improved) -* [#212](https://github.com/onelogin/ruby-saml/pull/212) Rename library entry point -* [#210](https://github.com/onelogin/ruby-saml/pull/210) Call assert in tests -* [#208](https://github.com/onelogin/ruby-saml/pull/208) Update tests and CI for Ruby 2.2.0 -* [#205](https://github.com/onelogin/ruby-saml/pull/205) Allow requirement of single files -* [#204](https://github.com/onelogin/ruby-saml/pull/204) Require ‘net/http’ library -* [#201](https://github.com/onelogin/ruby-saml/pull/201) Freeze and duplicate default security settings hash so that it doesn't get modified. -* [#200](https://github.com/onelogin/ruby-saml/pull/200) Set default SSL certificate store in Ruby 1.8. -* [#199](https://github.com/onelogin/ruby-saml/pull/199) Change Nokogiri's runtime dependency to fix support for Ruby 1.8.7. -* [#179](https://github.com/onelogin/ruby-saml/pull/179) Add support for setting the entity ID and name ID format when parsing metadata -* [#175](https://github.com/onelogin/ruby-saml/pull/175) Introduce thread safety to SAML schema validation -* [#171](https://github.com/onelogin/ruby-saml/pull/171) Fix inconsistent results with using regex matches in decode_raw_saml +* [#216](https://github.com/ruby_saml/pull/216) Add fingerprint algorithm support +* [#218](https://github.com/ruby_saml/pull/218) Update README.md +* [#214](https://github.com/ruby_saml/pull/214) Cleanup `SamlMessage` class +* [#213](https://github.com/ruby_saml/pull/213) Add ability to sign metadata. (Improved) +* [#212](https://github.com/ruby_saml/pull/212) Rename library entry point +* [#210](https://github.com/ruby_saml/pull/210) Call assert in tests +* [#208](https://github.com/ruby_saml/pull/208) Update tests and CI for Ruby 2.2.0 +* [#205](https://github.com/ruby_saml/pull/205) Allow requirement of single files +* [#204](https://github.com/ruby_saml/pull/204) Require ‘net/http’ library +* [#201](https://github.com/ruby_saml/pull/201) Freeze and duplicate default security settings hash so that it doesn't get modified. +* [#200](https://github.com/ruby_saml/pull/200) Set default SSL certificate store in Ruby 1.8. +* [#199](https://github.com/ruby_saml/pull/199) Change Nokogiri's runtime dependency to fix support for Ruby 1.8.7. +* [#179](https://github.com/ruby_saml/pull/179) Add support for setting the entity ID and name ID format when parsing metadata +* [#175](https://github.com/ruby_saml/pull/175) Introduce thread safety to SAML schema validation +* [#171](https://github.com/ruby_saml/pull/171) Fix inconsistent results with using regex matches in decode_raw_saml ### 0.9.1 (Feb 10, 2015) -* [#194](https://github.com/onelogin/ruby-saml/pull/194) Relax nokogiri gem requirements -* [#191](https://github.com/onelogin/ruby-saml/pull/191) Use Minitest instead of Test::Unit +* [#194](https://github.com/ruby_saml/pull/194) Relax nokogiri gem requirements +* [#191](https://github.com/ruby_saml/pull/191) Use Minitest instead of Test::Unit ### 0.9 (Jan 26, 2015) -* [#169](https://github.com/onelogin/ruby-saml/pull/169) WantAssertionSigned should be either true or false -* [#167](https://github.com/onelogin/ruby-saml/pull/167) (doc update) make unit of clock drift obvious -* [#160](https://github.com/onelogin/ruby-saml/pull/160) Extended solution for Attributes method [] can raise NoMethodError -* [#158](https://github.com/onelogin/ruby-saml/pull/1) Added ability to specify attribute services in metadata -* [#154](https://github.com/onelogin/ruby-saml/pull/154) Fix incorrect gem declaration statement -* [#152](https://github.com/onelogin/ruby-saml/pull/152) Fix the PR #99 -* [#150](https://github.com/onelogin/ruby-saml/pull/150) Nokogiri already in gemspec -* [#147](https://github.com/onelogin/ruby-saml/pull/147) Fix LogoutResponse issuer validation and implement SAML Response issuer validation. -* [#144](https://github.com/onelogin/ruby-saml/pull/144) Fix DigestMethod lookup bug -* [#139](https://github.com/onelogin/ruby-saml/pull/139) Fixes handling of some soft and hard validation failures -* [#138](https://github.com/onelogin/ruby-saml/pull/138) Change logoutrequest.rb to UTC time -* [#136](https://github.com/onelogin/ruby-saml/pull/136) Remote idp metadata -* [#135](https://github.com/onelogin/ruby-saml/pull/135) Restored support for NIL as well as empty AttributeValues -* [#134](https://github.com/onelogin/ruby-saml/pull/134) explicitly require "onelogin/ruby-saml/logging" -* [#133](https://github.com/onelogin/ruby-saml/pull/133) Added license to gemspec -* [#132](https://github.com/onelogin/ruby-saml/pull/132) Support AttributeConsumingServiceIndex in AuthnRequest -* [#131](https://github.com/onelogin/ruby-saml/pull/131) Add ruby 2.1.1 to .travis.yml -* [#122](https://github.com/onelogin/ruby-saml/pull/122) Fixes #112 and #117 in a backwards compatible manner -* [#119](https://github.com/onelogin/ruby-saml/pull/119) Add support for extracting IdP details from metadata xml +* [#169](https://github.com/ruby_saml/pull/169) WantAssertionSigned should be either true or false +* [#167](https://github.com/ruby_saml/pull/167) (doc update) make unit of clock drift obvious +* [#160](https://github.com/ruby_saml/pull/160) Extended solution for Attributes method [] can raise NoMethodError +* [#158](https://github.com/ruby_saml/pull/1) Added ability to specify attribute services in metadata +* [#154](https://github.com/ruby_saml/pull/154) Fix incorrect gem declaration statement +* [#152](https://github.com/ruby_saml/pull/152) Fix the PR #99 +* [#150](https://github.com/ruby_saml/pull/150) Nokogiri already in gemspec +* [#147](https://github.com/ruby_saml/pull/147) Fix LogoutResponse issuer validation and implement SAML Response issuer validation. +* [#144](https://github.com/ruby_saml/pull/144) Fix DigestMethod lookup bug +* [#139](https://github.com/ruby_saml/pull/139) Fixes handling of some soft and hard validation failures +* [#138](https://github.com/ruby_saml/pull/138) Change logoutrequest.rb to UTC time +* [#136](https://github.com/ruby_saml/pull/136) Remote idp metadata +* [#135](https://github.com/ruby_saml/pull/135) Restored support for NIL as well as empty AttributeValues +* [#134](https://github.com/ruby_saml/pull/134) explicitly require "ruby_saml/logging" +* [#133](https://github.com/ruby_saml/pull/133) Added license to gemspec +* [#132](https://github.com/ruby_saml/pull/132) Support AttributeConsumingServiceIndex in AuthnRequest +* [#131](https://github.com/ruby_saml/pull/131) Add ruby 2.1.1 to .travis.yml +* [#122](https://github.com/ruby_saml/pull/122) Fixes #112 and #117 in a backwards compatible manner +* [#119](https://github.com/ruby_saml/pull/119) Add support for extracting IdP details from metadata xml ### 0.8.2 (Jan 26, 2015) -* [#183](https://github.com/onelogin/ruby-saml/pull/183) Resolved a security vulnerability where string interpolation in a `REXML::XPath.first()` method call allowed for arbitrary code execution. +* [#183](https://github.com/ruby_saml/pull/183) Resolved a security vulnerability where string interpolation in a `REXML::XPath.first()` method call allowed for arbitrary code execution. ### 0.8.0 (Feb 21, 2014) **IMPORTANT**: This release changed namespace of the gem from `OneLogin::Saml` to `OneLogin::RubySaml`. Please update your implementations of the gem accordingly. -* [#111](https://github.com/onelogin/ruby-saml/pull/111) `Onelogin::` is `OneLogin::` -* [#108](https://github.com/onelogin/ruby-saml/pull/108) Change namespacing from `Onelogin::Saml` to `Onelogin::Rubysaml` +* [#111](https://github.com/ruby_saml/pull/111) `Onelogin::` is `OneLogin::` +* [#108](https://github.com/ruby_saml/pull/108) Change namespacing from `Onelogin::Saml` to `Onelogin::Rubysaml` ### 0.7.3 (Feb 20, 2014) Updated gem dependencies to be compatible with Ruby 1.8.7-p374 and 1.9.3-p448. Removed unnecessary `canonix` gem dependency. -* [#107](https://github.com/onelogin/ruby-saml/pull/107) Relax nokogiri version requirement to >= 1.5.0 -* [#105](https://github.com/onelogin/ruby-saml/pull/105) Lock Gem versions, fix to resolve possible namespace collision +* [#107](https://github.com/ruby_saml/pull/107) Relax nokogiri version requirement to >= 1.5.0 +* [#105](https://github.com/ruby_saml/pull/105) Lock Gem versions, fix to resolve possible namespace collision diff --git a/Gemfile b/Gemfile index cfbda3cde..1e873d60f 100644 --- a/Gemfile +++ b/Gemfile @@ -4,8 +4,8 @@ source 'https://rubygems.org' gemspec -gem 'minitest', '~> 5.18', require: false -gem 'mocha', '~> 2.0', require: false +gem 'minitest', '~> 5.24', require: false +gem 'mocha', '~> 2.4', require: false gem 'rake', '~> 13.0' gem 'rubocop', '~> 1.64.1', require: false gem 'rubocop-minitest', '~> 0.35.0', require: false diff --git a/README.md b/README.md index 466a7a3a7..9d037ae1e 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,13 @@ gem install ruby-saml You may require the entire Ruby SAML gem: ```ruby -require 'onelogin/ruby-saml' +require 'ruby_saml' ``` or just the required components individually: ```ruby -require 'onelogin/ruby-saml/authrequest' +require 'ruby_saml/authrequest' ``` ### Installation on Ruby 1.8.7 @@ -336,7 +336,7 @@ Using `IdpMetadataParser#parse_remote`, the IdP metadata will be added to the se def saml_settings idp_metadata_parser = RubySaml::IdpMetadataParser.new - # Returns OneLogin::RubySaml::Settings pre-populated with IdP metadata + # Returns RubySaml::Settings pre-populated with IdP metadata settings = idp_metadata_parser.parse_remote("https://example.com/auth/saml2/idp/metadata") settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume" @@ -397,7 +397,7 @@ by the values of binding and nameid: ### Parsing Metadata into an Hash -The `OneLogin::RubySaml::IdpMetadataParser` also provides the methods `#parse_to_hash` and `#parse_remote_to_hash`. +The `RubySaml::IdpMetadataParser` also provides the methods `#parse_to_hash` and `#parse_remote_to_hash`. Those return an Hash instead of a `Settings` object, which may be useful for configuring [omniauth-saml](https://github.com/omniauth/omniauth-saml), for instance. @@ -412,11 +412,11 @@ but it can be done as follows: ```ruby require "xml_security" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/idp_metadata_parser" +require "ruby_saml/utils" +require "ruby_saml/idp_metadata_parser" url = "" -idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new +idp_metadata_parser = RubySaml::IdpMetadataParser.new uri = URI.parse(url) raise ArgumentError.new("url must begin with http or https") unless /^https?/ =~ uri.scheme @@ -433,7 +433,7 @@ xml = response.body errors = [] doc = XMLSecurity::SignedDocument.new(xml, errors) cert_str = "" -cert = OneLogin::RubySaml::Utils.format_cert("cert_str") +cert = RubySaml::Utils.format_cert("cert_str") metadata_sign_cert = OpenSSL::X509::Certificate.new(cert) valid = doc.validate_document_with_cert(metadata_sign_cert, true) if valid @@ -452,7 +452,7 @@ If you are using `saml:AttributeStatement` to transfer data like the username, y `single_value_compatibility` (when activated, only the first value is returned) ```ruby -response = OneLogin::RubySaml::Response.new(params[:SAMLResponse]) +response = RubySaml::Response.new(params[:SAMLResponse]) response.settings = saml_settings response.attributes[:username] @@ -492,7 +492,7 @@ Imagine this `saml:AttributeStatement` ``` ```ruby -pp(response.attributes) # is an OneLogin::RubySaml::Attributes object +pp(response.attributes) # is an RubySaml::Attributes object # => @attributes= {"uid"=>["demo"], "another_value"=>["value1", "value2"], @@ -502,7 +502,7 @@ pp(response.attributes) # is an OneLogin::RubySaml::Attributes object "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"=>["usersName"]}> # Active single_value_compatibility -OneLogin::RubySaml::Attributes.single_value_compatibility = true +RubySaml::Attributes.single_value_compatibility = true pp(response.attributes[:uid]) # => "demo" @@ -538,7 +538,7 @@ pp(response.attributes.fetch(/givenname/)) # => "usersName" # Deprecated single_value_compatibility -OneLogin::RubySaml::Attributes.single_value_compatibility = false +RubySaml::Attributes.single_value_compatibility = false pp(response.attributes[:uid]) # => ["demo"] @@ -585,7 +585,7 @@ building the authrequest object. To form a trusted pair relationship with the IdP, the SP (you) need to provide metadata XML to the IdP for various good reasons. (Caching, certificate lookups, relaying party permissions, etc) -The class `OneLogin::RubySaml::Metadata` takes care of this by reading the Settings and returning XML. All you have to do is add a controller to return the data, then give this URL to the IdP administrator. +The class `RubySaml::Metadata` takes care of this by reading the Settings and returning XML. All you have to do is add a controller to return the data, then give this URL to the IdP administrator. The metadata will be polled by the IdP every few minutes, so updating your settings should propagate to the IdP settings. @@ -595,7 +595,7 @@ class SamlController < ApplicationController # ... the rest of your controller definitions ... def metadata settings = Account.get_saml_settings - meta = OneLogin::RubySaml::Metadata.new + meta = RubySaml::Metadata.new render :xml => meta.generate(settings), :content_type => "application/samlmetadata+xml" end end @@ -711,7 +711,7 @@ You may require SP and IdP certificates to be non-expired using the following se settings.security[:check_sp_cert_expiration] = true # Raise error SP X.509 cert is expired ``` -By default, Ruby SAML will raise a `OneLogin::RubySaml::ValidationError` if a signature or certificate +By default, Ruby SAML will raise a `RubySaml::ValidationError` if a signature or certificate validation fails. You may disable such exceptions using the `settings.security[:soft]` parameter. ```ruby @@ -800,7 +800,7 @@ def sp_logout_request delete_session else - logout_request = OneLogin::RubySaml::Logoutrequest.new + logout_request = RubySaml::Logoutrequest.new logger.info "New SP SLO for userid '#{session[:userid]}' transactionid '#{logout_request.uuid}'" if settings.name_identifier_value.nil? @@ -831,9 +831,9 @@ def process_logout_response settings = Account.get_saml_settings if session.has_key? :transaction_id - logout_response = OneLogin::RubySaml::Logoutresponse.new(params[:SAMLResponse], settings, :matches_request_id => session[:transaction_id]) + logout_response = RubySaml::Logoutresponse.new(params[:SAMLResponse], settings, :matches_request_id => session[:transaction_id]) else - logout_response = OneLogin::RubySaml::Logoutresponse.new(params[:SAMLResponse], settings) + logout_response = RubySaml::Logoutresponse.new(params[:SAMLResponse], settings) end logger.info "LogoutResponse is: #{logout_response.to_s}" @@ -867,7 +867,7 @@ def idp_logout_request # uppercase. Turn it True for ADFS compatibility on signature verification settings.security[:lowercase_url_encoding] = true - logout_request = OneLogin::RubySaml::SloLogoutrequest.new( + logout_request = RubySaml::SloLogoutrequest.new( params[:SAMLRequest], settings: settings ) if !logout_request.is_valid? @@ -881,7 +881,7 @@ def idp_logout_request # Generate a response to the IdP. logout_request_id = logout_request.id - logout_response = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request_id, nil, :RelayState => params[:RelayState]) + logout_response = RubySaml::SloLogoutresponse.new.create(settings, logout_request_id, nil, :RelayState => params[:RelayState]) redirect_to logout_response end ``` @@ -913,7 +913,7 @@ First, ensure that both systems synchronize their clocks, using for example the Even then you may experience intermittent issues, as the clock of the Identity Provider may drift slightly ahead of your system clocks. To allow for a small amount of clock drift, you can initialize the response by passing in an option named `:allowed_clock_drift`. Its value must be given in a number (and/or fraction) of seconds. The value given is added to the current time at which the response is validated before it's tested against the `NotBefore` assertion. For example: ```ruby -response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], :allowed_clock_drift => 1.second) +response = RubySaml::Response.new(params[:SAMLResponse], :allowed_clock_drift => 1.second) ``` Make sure to keep the value as comfortably small as possible to keep security risks to a minimum. @@ -928,14 +928,14 @@ Example: ```ruby def consume - response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], { settings: saml_settings }) + response = RubySaml::Response.new(params[:SAMLResponse], { settings: saml_settings }) ... end private def saml_settings - OneLogin::RubySaml::Settings.new(message_max_bytesize: 500_000) + RubySaml::Settings.new(message_max_bytesize: 500_000) end ``` @@ -944,7 +944,7 @@ end To request attributes from the IdP the SP needs to provide an attribute service within it's metadata and reference the index in the assertion. ```ruby -settings = OneLogin::RubySaml::Settings.new +settings = RubySaml::Settings.new settings.attributes_index = 5 settings.attribute_consuming_service.configure do service_name "Service" @@ -959,11 +959,11 @@ The `attribute_value` option additionally accepts an array of possible values. ## Custom Metadata Fields Some IdPs may require to add SPs to add additional fields (Organization, ContactPerson, etc.) -into the SP metadata. This can be achieved by extending the `OneLogin::RubySaml::Metadata` +into the SP metadata. This can be achieved by extending the `RubySaml::Metadata` class and overriding the `#add_extras` method as per the following example: ```ruby -class MyMetadata < OneLogin::RubySaml::Metadata +class MyMetadata < RubySaml::Metadata def add_extras(root, _settings) org = root.add_element("md:Organization") org.add_element("md:OrganizationName", 'xml:lang' => "en-US").text = 'ACME Inc.' diff --git a/UPGRADING.md b/UPGRADING.md index 908dbddcc..0623bcbcd 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,5 +1,15 @@ # Ruby SAML Migration Guide +## Updating from 1.17.x to 2.0.0 + +Before attempting to upgrade to `2.0.0`: +- Upgrade your project to minimum Ruby 3.0, JRuby 9.4, or TruffleRuby 22. +- Upgrade RubySaml to `1.17.x`. Note that RubySaml `1.17.x` is compatible with up to Ruby 3.3. + +RubySaml version `2.0.0` changes the root namespace from `OneLogin::RubySaml::` to just `RubySaml::`. This will require you +to search your codebase for the string `OneLogin::` and remove it as appropriate. Aside from this namespace change, +the class names themselves have intentionally been kept the same. + ## Updating from 1.12.x to 1.13.0 Version `1.13.0` adds `settings.idp_sso_service_binding` and `settings.idp_slo_service_binding`, and diff --git a/lib/onelogin/ruby-saml.rb b/lib/onelogin/ruby-saml.rb deleted file mode 100644 index dc63a87f5..000000000 --- a/lib/onelogin/ruby-saml.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require 'onelogin/ruby-saml/logging' -require 'onelogin/ruby-saml/saml_message' -require 'onelogin/ruby-saml/authrequest' -require 'onelogin/ruby-saml/logoutrequest' -require 'onelogin/ruby-saml/logoutresponse' -require 'onelogin/ruby-saml/attributes' -require 'onelogin/ruby-saml/slo_logoutrequest' -require 'onelogin/ruby-saml/slo_logoutresponse' -require 'onelogin/ruby-saml/response' -require 'onelogin/ruby-saml/settings' -require 'onelogin/ruby-saml/attribute_service' -require 'onelogin/ruby-saml/http_error' -require 'onelogin/ruby-saml/validation_error' -require 'onelogin/ruby-saml/metadata' -require 'onelogin/ruby-saml/idp_metadata_parser' -require 'onelogin/ruby-saml/utils' -require 'onelogin/ruby-saml/version' diff --git a/lib/ruby-saml.rb b/lib/ruby-saml.rb index 5c7064b8c..247891dcd 100644 --- a/lib/ruby-saml.rb +++ b/lib/ruby-saml.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -require 'onelogin/ruby-saml' +require 'ruby_saml' diff --git a/lib/ruby_saml.rb b/lib/ruby_saml.rb new file mode 100644 index 000000000..10bfd527c --- /dev/null +++ b/lib/ruby_saml.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require 'ruby_saml/logging' +require 'ruby_saml/saml_message' +require 'ruby_saml/authrequest' +require 'ruby_saml/logoutrequest' +require 'ruby_saml/logoutresponse' +require 'ruby_saml/attributes' +require 'ruby_saml/slo_logoutrequest' +require 'ruby_saml/slo_logoutresponse' +require 'ruby_saml/response' +require 'ruby_saml/settings' +require 'ruby_saml/attribute_service' +require 'ruby_saml/http_error' +require 'ruby_saml/validation_error' +require 'ruby_saml/metadata' +require 'ruby_saml/idp_metadata_parser' +require 'ruby_saml/utils' +require 'ruby_saml/version' diff --git a/lib/onelogin/ruby-saml/attribute_service.rb b/lib/ruby_saml/attribute_service.rb similarity index 100% rename from lib/onelogin/ruby-saml/attribute_service.rb rename to lib/ruby_saml/attribute_service.rb diff --git a/lib/onelogin/ruby-saml/attributes.rb b/lib/ruby_saml/attributes.rb similarity index 100% rename from lib/onelogin/ruby-saml/attributes.rb rename to lib/ruby_saml/attributes.rb diff --git a/lib/onelogin/ruby-saml/authrequest.rb b/lib/ruby_saml/authrequest.rb similarity index 97% rename from lib/onelogin/ruby-saml/authrequest.rb rename to lib/ruby_saml/authrequest.rb index 9378c1537..539b8add1 100644 --- a/lib/onelogin/ruby-saml/authrequest.rb +++ b/lib/ruby_saml/authrequest.rb @@ -2,10 +2,10 @@ require "rexml/document" -require "onelogin/ruby-saml/logging" -require "onelogin/ruby-saml/saml_message" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/setting_error" +require "ruby_saml/logging" +require "ruby_saml/saml_message" +require "ruby_saml/utils" +require "ruby_saml/setting_error" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/error_handling.rb b/lib/ruby_saml/error_handling.rb similarity index 93% rename from lib/onelogin/ruby-saml/error_handling.rb rename to lib/ruby_saml/error_handling.rb index e2fea9373..b6afd38fa 100644 --- a/lib/onelogin/ruby-saml/error_handling.rb +++ b/lib/ruby_saml/error_handling.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "onelogin/ruby-saml/validation_error" +require "ruby_saml/validation_error" module RubySaml module ErrorHandling diff --git a/lib/onelogin/ruby-saml/http_error.rb b/lib/ruby_saml/http_error.rb similarity index 100% rename from lib/onelogin/ruby-saml/http_error.rb rename to lib/ruby_saml/http_error.rb diff --git a/lib/onelogin/ruby-saml/idp_metadata_parser.rb b/lib/ruby_saml/idp_metadata_parser.rb similarity index 98% rename from lib/onelogin/ruby-saml/idp_metadata_parser.rb rename to lib/ruby_saml/idp_metadata_parser.rb index 44215ad8f..0c2443d59 100644 --- a/lib/onelogin/ruby-saml/idp_metadata_parser.rb +++ b/lib/ruby_saml/idp_metadata_parser.rb @@ -118,12 +118,12 @@ def parse_remote_to_array(url, validate_cert = true, options = {}) # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. # - # @return [OneLogin::RubySaml::Settings] + # @return [RubySaml::Settings] def parse(idp_metadata, options = {}) parsed_metadata = parse_to_hash(idp_metadata, options) unless parsed_metadata[:cache_duration].nil? - cache_valid_until_timestamp = OneLogin::RubySaml::Utils.parse_duration(parsed_metadata[:cache_duration]) + cache_valid_until_timestamp = RubySaml::Utils.parse_duration(parsed_metadata[:cache_duration]) if !cache_valid_until_timestamp.nil? && (parsed_metadata[:valid_until].nil? || cache_valid_until_timestamp < Time.parse(parsed_metadata[:valid_until], Time.now.utc).to_i) parsed_metadata[:valid_until] = Time.at(cache_valid_until_timestamp).utc.strftime("%Y-%m-%dT%H:%M:%SZ") end @@ -135,9 +135,9 @@ def parse(idp_metadata, options = {}) settings = options[:settings] if settings.nil? - OneLogin::RubySaml::Settings.new(parsed_metadata) + RubySaml::Settings.new(parsed_metadata) elsif settings.is_a?(Hash) - OneLogin::RubySaml::Settings.new(settings.merge(parsed_metadata)) + RubySaml::Settings.new(settings.merge(parsed_metadata)) else merge_parsed_metadata_into(settings, parsed_metadata) end @@ -208,7 +208,7 @@ def get_idp_metadata(url, validate_cert) @response = http.request(get) return response.body if response.is_a? Net::HTTPSuccess - raise OneLogin::RubySaml::HttpError.new( + raise RubySaml::HttpError.new( "Failed to fetch idp metadata: #{response.code}: #{response.message}" ) end diff --git a/lib/onelogin/ruby-saml/logging.rb b/lib/ruby_saml/logging.rb similarity index 86% rename from lib/onelogin/ruby-saml/logging.rb rename to lib/ruby_saml/logging.rb index af612c1dd..7045a93c6 100644 --- a/lib/onelogin/ruby-saml/logging.rb +++ b/lib/ruby_saml/logging.rb @@ -19,13 +19,13 @@ class << self end def self.debug(message) - return if ENV["ruby-saml/testing"] + return if ENV['ruby-saml/testing'] logger.debug(message) end def self.info(message) - return if ENV["ruby-saml/testing"] + return if ENV['ruby-saml/testing'] logger.info(message) end diff --git a/lib/onelogin/ruby-saml/logoutrequest.rb b/lib/ruby_saml/logoutrequest.rb similarity index 97% rename from lib/onelogin/ruby-saml/logoutrequest.rb rename to lib/ruby_saml/logoutrequest.rb index bba92f27d..d808c054d 100644 --- a/lib/onelogin/ruby-saml/logoutrequest.rb +++ b/lib/ruby_saml/logoutrequest.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require "onelogin/ruby-saml/logging" -require "onelogin/ruby-saml/saml_message" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/setting_error" +require "ruby_saml/logging" +require "ruby_saml/saml_message" +require "ruby_saml/utils" +require "ruby_saml/setting_error" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/logoutresponse.rb b/lib/ruby_saml/logoutresponse.rb similarity index 99% rename from lib/onelogin/ruby-saml/logoutresponse.rb rename to lib/ruby_saml/logoutresponse.rb index b70cb16c9..7c885239e 100644 --- a/lib/onelogin/ruby-saml/logoutresponse.rb +++ b/lib/ruby_saml/logoutresponse.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "xml_security" -require "onelogin/ruby-saml/saml_message" +require "ruby_saml/saml_message" require "time" diff --git a/lib/onelogin/ruby-saml/metadata.rb b/lib/ruby_saml/metadata.rb similarity index 98% rename from lib/onelogin/ruby-saml/metadata.rb rename to lib/ruby_saml/metadata.rb index 20213c0e1..a979aa3dc 100644 --- a/lib/onelogin/ruby-saml/metadata.rb +++ b/lib/ruby_saml/metadata.rb @@ -2,8 +2,8 @@ require "uri" -require "onelogin/ruby-saml/logging" -require "onelogin/ruby-saml/utils" +require "ruby_saml/logging" +require "ruby_saml/utils" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/response.rb b/lib/ruby_saml/response.rb similarity index 99% rename from lib/onelogin/ruby-saml/response.rb rename to lib/ruby_saml/response.rb index 31e6d290e..774df6639 100644 --- a/lib/onelogin/ruby-saml/response.rb +++ b/lib/ruby_saml/response.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "xml_security" -require "onelogin/ruby-saml/attributes" +require "ruby_saml/attributes" require "time" require "nokogiri" diff --git a/lib/onelogin/ruby-saml/saml_message.rb b/lib/ruby_saml/saml_message.rb similarity index 97% rename from lib/onelogin/ruby-saml/saml_message.rb rename to lib/ruby_saml/saml_message.rb index 2c1c7cd53..dd8b25714 100644 --- a/lib/onelogin/ruby-saml/saml_message.rb +++ b/lib/ruby_saml/saml_message.rb @@ -6,7 +6,7 @@ require 'nokogiri' require 'rexml/document' require 'rexml/xpath' -require "onelogin/ruby-saml/error_handling" +require 'ruby_saml/error_handling' # Only supports SAML 2.0 module RubySaml @@ -26,7 +26,7 @@ class SamlMessage # def self.schema @@mutex.synchronize do - Dir.chdir(File.expand_path('../../schemas', __dir__)) do + Dir.chdir(File.expand_path('../../lib/ruby_saml/schemas', __dir__)) do ::Nokogiri::XML::Schema(File.read("saml-schema-protocol-2.0.xsd")) end end diff --git a/lib/schemas/saml-schema-assertion-2.0.xsd b/lib/ruby_saml/schemas/saml-schema-assertion-2.0.xsd similarity index 100% rename from lib/schemas/saml-schema-assertion-2.0.xsd rename to lib/ruby_saml/schemas/saml-schema-assertion-2.0.xsd diff --git a/lib/schemas/saml-schema-authn-context-2.0.xsd b/lib/ruby_saml/schemas/saml-schema-authn-context-2.0.xsd similarity index 100% rename from lib/schemas/saml-schema-authn-context-2.0.xsd rename to lib/ruby_saml/schemas/saml-schema-authn-context-2.0.xsd diff --git a/lib/schemas/saml-schema-authn-context-types-2.0.xsd b/lib/ruby_saml/schemas/saml-schema-authn-context-types-2.0.xsd similarity index 100% rename from lib/schemas/saml-schema-authn-context-types-2.0.xsd rename to lib/ruby_saml/schemas/saml-schema-authn-context-types-2.0.xsd diff --git a/lib/schemas/saml-schema-metadata-2.0.xsd b/lib/ruby_saml/schemas/saml-schema-metadata-2.0.xsd similarity index 100% rename from lib/schemas/saml-schema-metadata-2.0.xsd rename to lib/ruby_saml/schemas/saml-schema-metadata-2.0.xsd diff --git a/lib/schemas/saml-schema-protocol-2.0.xsd b/lib/ruby_saml/schemas/saml-schema-protocol-2.0.xsd similarity index 100% rename from lib/schemas/saml-schema-protocol-2.0.xsd rename to lib/ruby_saml/schemas/saml-schema-protocol-2.0.xsd diff --git a/lib/schemas/sstc-metadata-attr.xsd b/lib/ruby_saml/schemas/sstc-metadata-attr.xsd similarity index 100% rename from lib/schemas/sstc-metadata-attr.xsd rename to lib/ruby_saml/schemas/sstc-metadata-attr.xsd diff --git a/lib/schemas/sstc-saml-attribute-ext.xsd b/lib/ruby_saml/schemas/sstc-saml-attribute-ext.xsd similarity index 100% rename from lib/schemas/sstc-saml-attribute-ext.xsd rename to lib/ruby_saml/schemas/sstc-saml-attribute-ext.xsd diff --git a/lib/schemas/sstc-saml-metadata-algsupport-v1.0.xsd b/lib/ruby_saml/schemas/sstc-saml-metadata-algsupport-v1.0.xsd similarity index 100% rename from lib/schemas/sstc-saml-metadata-algsupport-v1.0.xsd rename to lib/ruby_saml/schemas/sstc-saml-metadata-algsupport-v1.0.xsd diff --git a/lib/schemas/sstc-saml-metadata-ui-v1.0.xsd b/lib/ruby_saml/schemas/sstc-saml-metadata-ui-v1.0.xsd similarity index 97% rename from lib/schemas/sstc-saml-metadata-ui-v1.0.xsd rename to lib/ruby_saml/schemas/sstc-saml-metadata-ui-v1.0.xsd index de0b754ab..a9f718e2b 100644 --- a/lib/schemas/sstc-saml-metadata-ui-v1.0.xsd +++ b/lib/ruby_saml/schemas/sstc-saml-metadata-ui-v1.0.xsd @@ -1,89 +1,89 @@ - - - - - - Document title: Metadata Extension Schema for SAML V2.0 Metadata Extensions for Login and Discovery User Interface Version 1.0 - Document identifier: sstc-saml-metadata-ui-v1.0.xsd - Location: http://docs.oasis-open.org/security/saml/Post2.0/ - Revision history: - 16 November 2010: - Added Keywords element/type. - 01 November 2010 - Changed filename. - September 2010: - Initial version. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + Document title: Metadata Extension Schema for SAML V2.0 Metadata Extensions for Login and Discovery User Interface Version 1.0 + Document identifier: sstc-saml-metadata-ui-v1.0.xsd + Location: http://docs.oasis-open.org/security/saml/Post2.0/ + Revision history: + 16 November 2010: + Added Keywords element/type. + 01 November 2010 + Changed filename. + September 2010: + Initial version. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/schemas/xenc-schema.xsd b/lib/ruby_saml/schemas/xenc-schema.xsd similarity index 100% rename from lib/schemas/xenc-schema.xsd rename to lib/ruby_saml/schemas/xenc-schema.xsd diff --git a/lib/schemas/xml.xsd b/lib/ruby_saml/schemas/xml.xsd similarity index 100% rename from lib/schemas/xml.xsd rename to lib/ruby_saml/schemas/xml.xsd diff --git a/lib/schemas/xmldsig-core-schema.xsd b/lib/ruby_saml/schemas/xmldsig-core-schema.xsd similarity index 100% rename from lib/schemas/xmldsig-core-schema.xsd rename to lib/ruby_saml/schemas/xmldsig-core-schema.xsd diff --git a/lib/onelogin/ruby-saml/setting_error.rb b/lib/ruby_saml/setting_error.rb similarity index 100% rename from lib/onelogin/ruby-saml/setting_error.rb rename to lib/ruby_saml/setting_error.rb diff --git a/lib/onelogin/ruby-saml/settings.rb b/lib/ruby_saml/settings.rb similarity index 98% rename from lib/onelogin/ruby-saml/settings.rb rename to lib/ruby_saml/settings.rb index 558fdba9f..9eb6debd2 100644 --- a/lib/onelogin/ruby-saml/settings.rb +++ b/lib/ruby_saml/settings.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true require "xml_security" -require "onelogin/ruby-saml/attribute_service" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/validation_error" +require "ruby_saml/attribute_service" +require "ruby_saml/utils" +require "ruby_saml/validation_error" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/slo_logoutrequest.rb b/lib/ruby_saml/slo_logoutrequest.rb similarity index 99% rename from lib/onelogin/ruby-saml/slo_logoutrequest.rb rename to lib/ruby_saml/slo_logoutrequest.rb index b3cd765bb..7cdf47eef 100644 --- a/lib/onelogin/ruby-saml/slo_logoutrequest.rb +++ b/lib/ruby_saml/slo_logoutrequest.rb @@ -4,7 +4,7 @@ require 'time' require 'nokogiri' -require "onelogin/ruby-saml/saml_message" +require "ruby_saml/saml_message" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/slo_logoutresponse.rb b/lib/ruby_saml/slo_logoutresponse.rb similarity index 97% rename from lib/onelogin/ruby-saml/slo_logoutresponse.rb rename to lib/ruby_saml/slo_logoutresponse.rb index d481a5c7c..d23378162 100644 --- a/lib/onelogin/ruby-saml/slo_logoutresponse.rb +++ b/lib/ruby_saml/slo_logoutresponse.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -require "onelogin/ruby-saml/logging" +require "ruby_saml/logging" -require "onelogin/ruby-saml/saml_message" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/setting_error" +require "ruby_saml/saml_message" +require "ruby_saml/utils" +require "ruby_saml/setting_error" # Only supports SAML 2.0 module RubySaml diff --git a/lib/onelogin/ruby-saml/utils.rb b/lib/ruby_saml/utils.rb similarity index 100% rename from lib/onelogin/ruby-saml/utils.rb rename to lib/ruby_saml/utils.rb diff --git a/lib/onelogin/ruby-saml/validation_error.rb b/lib/ruby_saml/validation_error.rb similarity index 100% rename from lib/onelogin/ruby-saml/validation_error.rb rename to lib/ruby_saml/validation_error.rb diff --git a/lib/onelogin/ruby-saml/version.rb b/lib/ruby_saml/version.rb similarity index 100% rename from lib/onelogin/ruby-saml/version.rb rename to lib/ruby_saml/version.rb diff --git a/lib/xml_security.rb b/lib/xml_security.rb index e55a62686..ea3354a89 100644 --- a/lib/xml_security.rb +++ b/lib/xml_security.rb @@ -31,8 +31,8 @@ require 'nokogiri' require "digest/sha1" require "digest/sha2" -require "onelogin/ruby-saml/utils" -require "onelogin/ruby-saml/error_handling" +require "ruby_saml/utils" +require "ruby_saml/error_handling" module XMLSecurity diff --git a/ruby-saml.gemspec b/ruby-saml.gemspec index 013d9c75b..34f2360fb 100644 --- a/ruby-saml.gemspec +++ b/ruby-saml.gemspec @@ -1,5 +1,5 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__) -require 'onelogin/ruby-saml/version' +require 'ruby_saml/version' Gem::Specification.new do |s| s.name = 'ruby-saml' diff --git a/test/attributes_test.rb b/test/attributes_test.rb index a765044f6..9c50ac1f4 100644 --- a/test/attributes_test.rb +++ b/test/attributes_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/attributes' +require 'ruby_saml/attributes' class AttributesTest < Minitest::Test describe 'Attributes' do diff --git a/test/idp_metadata_parser_test.rb b/test/idp_metadata_parser_test.rb index 08e985c6b..c616c2995 100644 --- a/test/idp_metadata_parser_test.rb +++ b/test/idp_metadata_parser_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/idp_metadata_parser' +require 'ruby_saml/idp_metadata_parser' class IdpMetadataParserTest < Minitest::Test class MockSuccessResponse < Net::HTTPSuccess diff --git a/test/logging_test.rb b/test/logging_test.rb index bd6d9be86..957511081 100644 --- a/test/logging_test.rb +++ b/test/logging_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/logging' +require 'ruby_saml/logging' class LoggingTest < Minitest::Test diff --git a/test/logoutrequest_test.rb b/test/logoutrequest_test.rb index 0c75071e8..30a5f5b9c 100644 --- a/test/logoutrequest_test.rb +++ b/test/logoutrequest_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/logoutrequest' +require 'ruby_saml/logoutrequest' class RequestTest < Minitest::Test diff --git a/test/logoutresponse_test.rb b/test/logoutresponse_test.rb index cabf58bca..4d5455b29 100644 --- a/test/logoutresponse_test.rb +++ b/test/logoutresponse_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/logoutresponse' +require 'ruby_saml/logoutresponse' require 'logout_responses/logoutresponse_fixtures' class RubySamlTest < Minitest::Test diff --git a/test/metadata_test.rb b/test/metadata_test.rb index c69a66e50..e72928da4 100644 --- a/test/metadata_test.rb +++ b/test/metadata_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/metadata' +require 'ruby_saml/metadata' class MetadataTest < Minitest::Test diff --git a/test/request_test.rb b/test/request_test.rb index ea5907301..00c190a6c 100644 --- a/test/request_test.rb +++ b/test/request_test.rb @@ -1,7 +1,7 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/authrequest' -require 'onelogin/ruby-saml/setting_error' +require 'ruby_saml/authrequest' +require 'ruby_saml/setting_error' class RequestTest < Minitest::Test diff --git a/test/response_test.rb b/test/response_test.rb index 7b80a75b1..312406480 100644 --- a/test/response_test.rb +++ b/test/response_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/response' +require 'ruby_saml/response' class RubySamlTest < Minitest::Test diff --git a/test/settings_test.rb b/test/settings_test.rb index a0ca46faa..b31fb59aa 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -1,7 +1,7 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/settings' -require 'onelogin/ruby-saml/validation_error' +require 'ruby_saml/settings' +require 'ruby_saml/validation_error' class SettingsTest < Minitest::Test diff --git a/test/slo_logoutrequest_test.rb b/test/slo_logoutrequest_test.rb index 3ae13c269..e0e7eb90f 100644 --- a/test/slo_logoutrequest_test.rb +++ b/test/slo_logoutrequest_test.rb @@ -1,7 +1,7 @@ require_relative 'test_helper' require 'logout_responses/logoutresponse_fixtures' -require 'onelogin/ruby-saml/slo_logoutrequest' +require 'ruby_saml/slo_logoutrequest' require 'timecop' class RubySamlTest < Minitest::Test diff --git a/test/slo_logoutresponse_test.rb b/test/slo_logoutresponse_test.rb index 43441e3d5..6680a2622 100644 --- a/test/slo_logoutresponse_test.rb +++ b/test/slo_logoutresponse_test.rb @@ -1,6 +1,6 @@ require_relative 'test_helper' -require 'onelogin/ruby-saml/slo_logoutresponse' +require 'ruby_saml/slo_logoutresponse' class SloLogoutresponseTest < Minitest::Test diff --git a/test/test_helper.rb b/test/test_helper.rb index d19d11b38..1c8e3e5ab 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,7 +9,7 @@ SimpleCov.start do add_filter "test/" add_filter "vendor/" - add_filter "lib/onelogin/ruby-saml/logging.rb" + add_filter "lib/ruby_saml/logging.rb" end end @@ -26,7 +26,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) -require 'onelogin/ruby-saml/logging' +require 'ruby_saml/logging' TEST_LOGGER = Logger.new(StringIO.new) RubySaml::Logging.logger = TEST_LOGGER @@ -333,7 +333,7 @@ def decode_saml_request_payload(unauth_url) inflated end - SCHEMA_DIR = File.expand_path(File.join(__FILE__, '../../lib/schemas')) + SCHEMA_DIR = File.expand_path(File.join(__FILE__, '../../lib/ruby_saml/schemas')) # # validate an xml document against the given schema