{"action":"created","issue":{"url":"https://api.github.com/repos/rohe/pysaml2/issues/203","labels_url":"https://api.github.com/repos/rohe/pysaml2/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/rohe/pysaml2/issues/203/comments","events_url":"https://api.github.com/repos/rohe/pysaml2/issues/203/events","html_url":"https://github.com/rohe/pysaml2/issues/203","id":68954355,"number":203,"title":"\"inline\" metadata load is broken as of version 2.3.0","user":{"login":"tombriles","id":10157170,"avatar_url":"https://avatars.githubusercontent.com/u/10157170?v=3","gravatar_id":"","url":"https://api.github.com/users/tombriles","html_url":"https://github.com/tombriles","followers_url":"https://api.github.com/users/tombriles/followers","following_url":"https://api.github.com/users/tombriles/following{/other_user}","gists_url":"https://api.github.com/users/tombriles/gists{/gist_id}","starred_url":"https://api.github.com/users/tombriles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombriles/subscriptions","organizations_url":"https://api.github.com/users/tombriles/orgs","repos_url":"https://api.github.com/users/tombriles/repos","events_url":"https://api.github.com/users/tombriles/events{/privacy}","received_events_url":"https://api.github.com/users/tombriles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-16T15:55:48Z","updated_at":"2015-04-21T23:16:17Z","closed_at":null,"body":"Here is a sample stack trace:\r\n\r\n```\r\n  File \"/home/devbuild/working_dir/flask_pysaml2/flask_pysaml2.py\", line 207, in __init__\r\n    self._config = SPConfig().load(config)\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/config.py\", line 353, in load\r\n    self.load_complex(cnf, metadata_construction=metadata_construction)\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/config.py\", line 293, in load_complex\r\n    self.load_metadata(cnf[\"metadata\"]))\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/config.py\", line 398, in load_metadata\r\n    mds.imp(metadata_conf)\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/mdstore.py\", line 814, in imp\r\n    self.load(key, val)\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/mdstore.py\", line 800, in load\r\n    _md.load()\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/mdstore.py\", line 186, in load\r\n    self.parse(self.metadata)\r\n  File \"/opt/kavi/service/web/ve/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/mdstore.py\", line 180, in parse\r\n    raise NotImplementedError\r\nNotImplementedError: \r\n```\r\n\r\nThis patch (for master) seems to fix it:\r\n\r\n```\r\ndiff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py\r\nindex 36344cf..aa96e6b 100644\r\n--- a/src/saml2/mdstore.py\r\n+++ b/src/saml2/mdstore.py\r\n@@ -777,7 +777,7 @@ class MetadataStore(object):\r\n         elif typ == \"inline\":\r\n             self.ii += 1\r\n             key = self.ii\r\n-            _md = MetaData(self.onts, self.attrc, args[0], **kwargs)\r\n+            _md = InMemoryMetaData(self.onts, self.attrc, args[0], **kwargs)\r\n         elif typ == \"remote\":\r\n             key = kwargs[\"url\"]\r\n             _args = {}\r\n```"},"comment":{"url":"https://api.github.com/repos/rohe/pysaml2/issues/comments/94969537","html_url":"https://github.com/rohe/pysaml2/issues/203#issuecomment-94969537","issue_url":"https://api.github.com/repos/rohe/pysaml2/issues/203","id":94969537,"user":{"login":"dcoleman17","id":142439,"avatar_url":"https://avatars.githubusercontent.com/u/142439?v=3","gravatar_id":"","url":"https://api.github.com/users/dcoleman17","html_url":"https://github.com/dcoleman17","followers_url":"https://api.github.com/users/dcoleman17/followers","following_url":"https://api.github.com/users/dcoleman17/following{/other_user}","gists_url":"https://api.github.com/users/dcoleman17/gists{/gist_id}","starred_url":"https://api.github.com/users/dcoleman17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcoleman17/subscriptions","organizations_url":"https://api.github.com/users/dcoleman17/orgs","repos_url":"https://api.github.com/users/dcoleman17/repos","events_url":"https://api.github.com/users/dcoleman17/events{/privacy}","received_events_url":"https://api.github.com/users/dcoleman17/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T23:16:17Z","updated_at":"2015-04-21T23:16:17Z","body":"To Reproduce: \r\n```\r\nfrom saml2.config import Config\r\nidp_data = #string representation of XML idp definition\r\n\r\nsaml_config = Config()\r\n\r\nconfig_dict = {\r\n    \"metadata\": { \"inline\": idp_metadata }\r\n}\r\ncfg = saml_config.load(config_dict) \r\n```\r\nThe traceback is\r\n```\r\nTraceback (most recent call last):\r\n  File \"./st.py\", line 201, in <module>\r\n    cfg = saml_config.load(old_config_dict)\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/config.py\", line 353, in load\r\n    self.load_complex(cnf, metadata_construction=metadata_construction)\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/config.py\", line 293, in load_complex\r\n    self.load_metadata(cnf[\"metadata\"]))\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/config.py\", line 398, in load_metadata\r\n    mds.imp(metadata_conf)\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/mdstore.py\", line 814, in imp\r\n    self.load(key, val)\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/mdstore.py\", line 800, in load\r\n    _md.load()\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/mdstore.py\", line 186, in load\r\n    self.parse(self.metadata)\r\n  File \"/home/vagrant/dogweb/python/lib/python2.7/site-packages/saml2/mdstore.py\", line 180, in parse\r\n    raise NotImplementedError\r\nNotImplementedError\r\n```\r\n\r\nUsing a different format to specify the metadata does work:\r\n\r\n```\r\nfrom saml2.config import Config\r\nidp_data = #string representation of XML idp definition\r\n\r\nsaml_config = Config()\r\n\r\nconfig_dict = {\r\n    \"metadata\": [{\r\n        \"class\": \"saml2.mdstore.InMemoryMetaData\",\r\n        \"metadata\": [(idp_metadata, )]\r\n    }]\r\n}\r\n\r\ncfg = saml_config.load(config_dict) \r\n```"}}