Skip to content

Commit 43b0bb6

Browse files
committed
Make IdpMetadataParser#get_idp_metadata public
I have a use-case for being able to cache the intermediate fetch of metadata in case of temporary failures, so rather than: parser.parse_remote(url) I'd like to begin metadata = parser.get_idp_metadata(url, true) do_my_caching(metadata) parser.parse(metadata) rescue HttpError load_cache end There's a fair amount of logic in the get_idp_metadata method that I'd rather not need to re-implement. Right now I have this implemented with `parser.send(:get_idp_metadata, url, true)` which is obviously not great if the internals of this class change in the future. Can we move this method to the public API?
1 parent f40c59b commit 43b0bb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/onelogin/ruby-saml/idp_metadata_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ def parse_to_idp_metadata_array(idp_metadata, options = {})
186186
idpsso_descriptors.map {|id| IdpMetadata.new(id, id.parent.attributes["entityID"])}
187187
end
188188

189-
private
190-
191189
# Retrieve the remote IdP metadata from the URL or a cached copy.
192190
# @param url [String] Url where the XML of the Identity Provider Metadata is published.
193191
# @param validate_cert [Boolean] If true and the URL is HTTPs, the cert of the domain is checked.
@@ -220,6 +218,8 @@ def get_idp_metadata(url, validate_cert)
220218
)
221219
end
222220

221+
private
222+
223223
class IdpMetadata
224224
attr_reader :idpsso_descriptor, :entity_id
225225

0 commit comments

Comments
 (0)