{"_id":"@canonical/macaroon-bakery","_rev":"70-c106627a87c276272d49a9db54650811","name":"@canonical/macaroon-bakery","dist-tags":{"beta":"1.2.0-beta.1","latest":"1.3.2"},"versions":{"0.3.0":{"name":"@canonical/macaroon-bakery","version":"0.3.0","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@0.3.0","maintainers":[{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"calebellis","email":"calebellis2805@gmail.com"},{"name":"barrymcgee","email":"barry.mcgee@integralcode.co.uk"},{"name":"lukewh","email":"luke@lukewh.com"},{"name":"blrandel","email":"kit@nocturne.net.nz"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"hatch","email":"jpihach+npm@gmail.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"59ec07ad31f392bea2364e81dd6b63ac78b32e6c","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-0.3.0.tgz","fileCount":8,"integrity":"sha512-JtMXxasIMLMIVsqIfLMm6VObUcV5itq3WnEt02rV+39j7Z4wNDUM+HuiHQhcmUuogmMOgoyqfLuUHE0Wkk7F4A==","signatures":[{"sig":"MEUCIGBVgdQBzEFYzUp1dk2c7nsqPR2e57MOp2WPaEfTybiCAiEApeXEFzvZg4NmQtBfo5waURxHJU4LHEq88q+/Lb8vs3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":46531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdC+mmCRA9TVsSAnZWagAAe9AP/iIJO5HvAxB1RUX/Wqm6\ntcANR1uUrhdbVtcoPWRH0L+qKbGzk0jY26XcK+mDFFKkpYgSOr+3nBLkvaBK\nJ10jdKN3QShL6gywgcDXGp5Jr2dRkogB1QKofCr2TkMtCq6Ztz7qq/aoLgTI\nnZvxsIOBZ59AFC56BHm1UwnNKccKAN+ZBoVb5aMNW2jua3ujc1qvPK8FiEuv\ngGw2V06RuD8tldVLuve8ew6Axb59B6MODA2tluJSHiXZ0ije0P2Sc44hfX2S\nyT4x8Esr0WuZhLMbs34hypmmoX6JP6/YGnt7Amn616rUg14Eo6UZNluKinMB\nhBEEppHyEsXdkDSGNn2eCySzMxiPPAW3NROOCviiFH9B83aQiCo6/4hjmQRU\nUJIMYJsxY/RXbQdzAWPXA5oDSY3oCsObcbboU9EClqiau/NSOFMj85ryj+eI\nwpYjqgMxWdyy2peZ0RTEYX3V+jTpVwuMzX0APY90PzmLr5vKKnZORFOon9j6\nz/FROb+6YzluscDYrhUoB3b0EfpyWNBtyeUu3/9SXRhJY2ZPceQaNaee9rXW\n9JkdhdKLzyam2bDPxJy40FAgH0fbH6+G+8iuDkCJAWLkaP++BRDiuUTOHKvI\nghtIlQkd/fQBMSMgPqu1YywvI3QjrS4j4i03+H4s3MNxzt2p7rvQeHuwJygc\nVGUN\r\n=Ogep\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"c555cf570582248b0a035a01d0f66f344b7bc980","scripts":{"lint":"eslint .","test":"tap --cov test.js"},"_npmUser":{"name":"hatch","email":"jpihach+npm@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"6.9.0","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"10.16.0","dependencies":{"macaroon":"^3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^14.2.4","atob":"^2.1.2","btoa":"^1.2.1","sinon":"^7.3.2","eslint":"^5.16.0","rewire":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_0.3.0_1561061798002_0.7990403512698245","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@canonical/macaroon-bakery","version":"1.0.0","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.0.0","maintainers":[{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"bethcollins","email":"beth.collins@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"hatch","email":"jpihach+npm@gmail.com"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"barrymcgee","email":"barry.mcgee@integralcode.co.uk"},{"name":"calebellis","email":"calebellis2805@gmail.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"pmahnke","email":"peter.mahnke@canonical.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"b13324cf2cf5527cd827fb7b257146a133451405","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.0.0.tgz","fileCount":7,"integrity":"sha512-eooOtBcvCtkBHL2T/2PAMiOyJwt7lzGmoPmsSHvyL4oGQRm3KdgDu7fb4VSlF7N/uV9SuaHZxzdEvbmffCcYOg==","signatures":[{"sig":"MEUCIGx4S15VQrZEUmNdRahaL3JmO/rtMiEVK8Z7S7FpCmfMAiEAlCaroCTDPjXRS/0soUFZtFu2E/0ZhxLKPLgngU57qfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguT9xCRA9TVsSAnZWagAAElkP+wQEfjUeRDot8klf0qDi\nfAhfkYzu7UG61Tc6tj5VOm+C1rhQSN0+9QMud+UiOtQDvAQnH4i7j90gDswF\nJq/G4r0w9lPsO4Csir/I0sWSbt5b174Dqgho55FVpZ6Y5xoJ7f9FZNnlY1Hc\nT5BAE0mshZsOoTjy+QgHDIZCaBtL4zD/ri8404CK4b3lSEXoV7+CBavE15pH\nNpa5oqWldv8OyaAaAC6llzW37MYo8ebtgNPFYaZb3H1v82ljSNmc9ApIimDj\nheZJIGsKT2sZSRJ+rmZgHJYdTSDGI0SAa70T7ErwFuBRrBP5gKbqdn+LnwdP\nQjI0xrr1h4Vip6UL3MEsjLRUZWQlhXVH61POyIU3B4nEVGtL3NdZe0tvTKgS\nxBIPt/w1zMc7X3R43eHNZihi3IGFMN9rUMYQ2zJxRh/ilTKpr3gqlr0nzvnr\nIn8+Db6hfcxGWDCv565G3OWf4JHvv8LEMvsAiSz7h/79fnMD1rm92Sh3gufs\nc7KJU/kbScMRHsSMpK3wHROjVIRtdTIzz86D2YRF1Lp7bNDQlPOQ8Rw9QO34\nbEGnl9kcflWFaJ28/ihwO3LKtAu5c0enkN4XWL7XqOzgWB8ceKAvlny+fJNq\ngacvi07J+/gOD6aUqm5QPMv9wWJGVLqFdnXFVno9b9C71QcVbmFuzm9sMZST\n1PG3\r\n=VQpf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"dd81b6ea525fcf08f3e1ae419d22d4d7237f32ee","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"tap --cov test.js"},"_npmUser":{"name":"hatch","email":"jpihach+npm@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"6.14.13","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"14.17.0","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tap":"14.10.8","atob":"2.1.2","btoa":"1.2.1","sinon":"9.2.1","eslint":"7.12.1","rewire":"5.0.0","jsdoc-to-markdown":"6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.0.0_1622753137412_0.9195913987434368","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@canonical/macaroon-bakery","version":"1.1.0","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.1.0","maintainers":[{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"calebellis","email":"calebellis2805@gmail.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"pmahnke","email":"peter.mahnke@canonical.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"bethcollins","email":"beth.collins@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"5928a354a4a316916aae6f14a6509c70fcacd574","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.1.0.tgz","fileCount":8,"integrity":"sha512-LAaNdUHPHkLGfspOqDw/MC/Y3navmzadJCB1hGqlGrcjeLis9q5j+RdH8NwsbbUQqomoeZLQutLfMOjLK9kwzw==","signatures":[{"sig":"MEYCIQCJPSegEH88vJLL25yHT4DSXL98X2mHCdaGHY0kassvtQIhAMRkZ5lYF5O7b8S6MQ/zFVLiqh/lH5tx3ho/3lFQbR5+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidIbnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFQQ/9FWK/rtRL6QQskCNe7hky0jdJ+W7EFCkenLn4fPwVxcx2InRO\r\n3BFFggZkveL1LdpvrQwWKGxvZFVISIsRgyibK8VICBPY+o1dFcWElRNg5c9c\r\neDGf+EKGG39ePo0wIcA++SEnf4cjS8H10Kge+T3QzFRxv4Qe3dNM6B8Y4iZD\r\n3DkfI3t4/bW85lt4QaR4ZA767PXAqLryiHZnot+JklqLIQoH7ltqBKh5uANG\r\nL0fcVSyw5tGuOzW5esBgP7PPGq+6r+F/RbrR5gwUaSHbT4+WxWoVBLngPlx2\r\nKImktVR+A5R8K+YNP+nKaUD4dmfxMbJ9O+Fk6jDMttkGZFsJj1fA6V5RmZW+\r\n0nTuQe7p77LFTta+qsraHX3I5dRd7Dsn1GLdvPV5q1j8MUSQjQE3lnIZLeVT\r\nwlI70a8/qbj36iBPX33jAA7pJiaUiTnPZdRDQXo1eXyTth/nugY2apCDDFNH\r\nlWCxi8J8K6jbh66aqrZ8+y/S8TAHJsqq1xCuD7TIAgQgGU4o2f2AQlOZrqTd\r\nXFP08BTki3rIXjREaER/vXkeIZ6EEnzrzUd3oYXTzMWHy99h+6WO/s0D1eg+\r\nKy+15pTIoOxNoANw3dOK6Wa8gXYSi7N33GCPIrbHCuiEtcVfjJyQU5VdhD+d\r\n3zLh4NiIo0eaRjk8GmG12l3uZJge09cb7FQ=\r\n=2dvg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"7a3aef04ab2ebf82ef9f377a2c46fefc3841f8f6","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"tap --cov test.js"},"_npmUser":{"name":"huwshimi","email":"huwshimi@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.5.5","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"16.15.0","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"tap":"14.10.8","atob":"2.1.2","btoa":"1.2.1","sinon":"9.2.1","eslint":"7.12.1","rewire":"5.0.0","jsdoc-to-markdown":"6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.1.0_1651803879002_0.8284607453284996","host":"s3://npm-registry-packages"}},"1.2.0-beta.1":{"name":"@canonical/macaroon-bakery","version":"1.2.0-beta.1","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.2.0-beta.1","maintainers":[{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"calebellis","email":"calebellis2805@gmail.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"pmahnke","email":"peter.mahnke@canonical.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"16f5f5664a354ef86bdfbebda8d8e3a080bb4504","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.2.0-beta.1.tgz","fileCount":5,"integrity":"sha512-fFOoQbgJW0Gy0WWZ28XopxkCKw1ShP5DUCP85MQsecvFOqEyLnCCNG22aqcL+SqZ8hOWmayUlYGxWJzrgLl6NQ==","signatures":[{"sig":"MEQCIGXE9gloyiu0WFuEhDNMkbEW/o2DGzuuL3Dh7Du1+8XbAiA4D1pJejgJGs7kPP3f4Rp1l1rYMF9GzXgNbpsLBuI4sg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiq9I6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolqA//YK071oUq92+in8YAkrtnwhijBgy2i/9OHb4UrPmJPzeYC0Ty\r\nrF7ZfRop6du7nYeCfJRaJMGulnEZimgqWamAu53zL4/VXnfh7mUX4QR95d2v\r\nA4lK0orNkBArdcp66cCSXbFY4eIOyJgWfpLeO/1f4Bd1qsw6AoMSX7pi45fm\r\nKQPWTWs2R8waiVdzXbY3tIWHxv9bZZUJSQS/zNFcs6sNl/BCNDeayBFdy1Wl\r\nq9OJBpqpIyFyyXPJrBZwwld6/DKf8WG+pVvUBhaAoyQbAlp6Rkj/iq49YjKN\r\n9utyE1RYiZfMP3U5Dv6+PmTbPNiUYB5RmlAnkOCUk8mYIpUsGlxTYFBmRDGp\r\noI9f21cjZpk7ikOxgKL/AyiuhhWxSZQRL9tZ6EobgZ9MvKybq0xku7dU/Z7H\r\nUuGl6Ce+XEvTkzHYgAjerzynZTuP6tztJd3oLuVMilVzmujQwO3zo7T9Z+lR\r\nnoVup18E7D2a6zVS0X6A6+kBDV83uSiMwMaEEFyWlt92dQagNPjxrLyDBtuV\r\nnnYSYTC0BFCUpvU5nprY1p6AbrtT944HcPbZPXSbpqSFVmV3YZR2AR6Xv0q5\r\ngrJfF/4IIDS7wyEM2sUur6FgYCHtCqKKA5SSVBVMJ3yWl/TdGdLLCjfSNika\r\nUQf0jpoFroJrbIP3ODYdxtmQ9H4XHmgtTe0=\r\n=1ShL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","readme":"[![view on npm](http://img.shields.io/npm/v/@canonical/macaroon-bakery)](https://www.npmjs.org/package/@canonical/macaroon-bakery)\n[![npm module downloads](http://img.shields.io/npm/dt/@canonical/macaroon-bakery.svg)](https://www.npmjs.org/package/@canonical/macaroon-bakery)\n\n# bakeryjs\n\n# API Reference\nbakeryjs.\n\n**Example**  \n```js\nimport { Bakery } from \"@canonical/macaroon-bakery\";\nconst bakery = new Bakery();\n\nbakery.get(url, headers, callback)\n```\n\n* [bakeryjs](#module_bakeryjs)\n    * [~Bakery](#module_bakeryjs..Bakery)\n        * [new Bakery(config)](#new_module_bakeryjs..Bakery_new)\n        * [.sendRequest(url, method, headers, body, callback)](#module_bakeryjs..Bakery+sendRequest) ⇒ <code>Object</code>\n        * [.get()](#module_bakeryjs..Bakery+get)\n        * [.delete()](#module_bakeryjs..Bakery+delete)\n        * [.post()](#module_bakeryjs..Bakery+post)\n        * [.put()](#module_bakeryjs..Bakery+put)\n        * [.patch()](#module_bakeryjs..Bakery+patch)\n        * [.discharge(macaroon, onSuccess, onFailure)](#module_bakeryjs..Bakery+discharge)\n    * [~BakeryStorage](#module_bakeryjs..BakeryStorage)\n        * [new BakeryStorage(store, config)](#new_module_bakeryjs..BakeryStorage_new)\n        * [.get(key)](#module_bakeryjs..BakeryStorage+get) ⇒ <code>String</code>\n        * [.set(key, value, callback)](#module_bakeryjs..BakeryStorage+set)\n        * [.clear()](#module_bakeryjs..BakeryStorage+clear)\n    * [~InMemoryStore](#module_bakeryjs..InMemoryStore)\n    * [~serialize(macaroons)](#module_bakeryjs..serialize) ⇒ <code>string</code>\n    * [~deserialize(serialized)](#module_bakeryjs..deserialize) ⇒ <code>Array</code>\n\n<a name=\"module_bakeryjs..Bakery\"></a>\n\n### bakeryjs~Bakery\nA macaroon bakery implementation.\n\n  The bakery implements the protocol used to acquire and discharge macaroons\n  over HTTP.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)  \n\n* [~Bakery](#module_bakeryjs..Bakery)\n    * [new Bakery(config)](#new_module_bakeryjs..Bakery_new)\n    * [.sendRequest(url, method, headers, body, callback)](#module_bakeryjs..Bakery+sendRequest) ⇒ <code>Object</code>\n    * [.get()](#module_bakeryjs..Bakery+get)\n    * [.delete()](#module_bakeryjs..Bakery+delete)\n    * [.post()](#module_bakeryjs..Bakery+post)\n    * [.put()](#module_bakeryjs..Bakery+put)\n    * [.patch()](#module_bakeryjs..Bakery+patch)\n    * [.discharge(macaroon, onSuccess, onFailure)](#module_bakeryjs..Bakery+discharge)\n\n<a name=\"new_module_bakeryjs..Bakery_new\"></a>\n\n#### new Bakery(config)\nInitialize a macaroon bakery with the given parameters.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | optional config. |\n| config.onSuccess | <code>function</code> | a function to be called when the request completes         properly. |\n| config.protocolVersion | <code>number</code> | the macaroon protocol version that the bakery should use. |\n| config.storage | <code>function</code> | the storage used to persist macaroons. It must implement the         following interface: |\n| config.storage.get | <code>function</code> | get(key) -> value. |\n| config.storage.set | <code>function</code> | set(key, value, callback): the callback is called without arguments           when the set operation has been performed. If not provided, it defaults to BakeryStorage using an in memory store. |\n| config.visitPage | <code>function</code> | the function used to visit the identity provider page when required, defaulting to opening a pop up window. It receives an         error object. |\n| config.visitPage.Info | <code>Object</code> | an object containing relevant info for the visit handling. |\n| config.visitPage.Info.WaitUrl | <code>String</code> | the url to wait on for IdM discharge. |\n| config.visitPage.Info.VisitUrl | <code>String</code> | the url to visit to authenticate with the IdM. |\n| config.visitPage.jujugui | <code>function</code> | an optional value specifying a method to use against idm to authenticate. Used in non interactive authentication scenarios. |\n| config.sendRequest | <code>function</code> | a function used to make XHR HTTP requests, with the following signature: func(path, method, headers, body, withCredentials, callback) -> xhr. By default an internal function is used. This is mostly for testing. |\n\n<a name=\"module_bakeryjs..Bakery+sendRequest\"></a>\n\n#### bakery.sendRequest(url, method, headers, body, callback) ⇒ <code>Object</code>\nSend an HTTP request to the given URL with the given HTTP method, headers\n    and body. The given callback receives an error and a response when the\n    request is complete.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n**Returns**: <code>Object</code> - the XHR instance.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| url | <code>String</code> | The URL to which to send the request. |\n| method | <code>String</code> | The HTTP method, like \"get\" or \"POST\". |\n| headers | <code>Object</code> | Headers that must be included in the request.       Note that bakery specific headers are automatically added internally. |\n| body | <code>String</code> | The request body if it applies, or null. |\n| callback | <code>function</code> | A function called when the response is       received from the remote URL. It receives a tuple (error, response).       If the request succeeds the error is null. |\n\n<a name=\"module_bakeryjs..Bakery+get\"></a>\n\n#### bakery.get()\nSend an HTTP GET request to the given URL with the given headers.\n    The given callback receives an error and a response when the request is\n    complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+delete\"></a>\n\n#### bakery.delete()\nSend an HTTP DELETE request to the given URL with the given headers and\n    body. The given callback receives an error and a response when the\n    request is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+post\"></a>\n\n#### bakery.post()\nSend an HTTP POST request to the given URL with the given headers and\n    body. The given callback receives an error and a response when the\n    request is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+put\"></a>\n\n#### bakery.put()\nSend an HTTP PUT request to the given URL with the given headers and\n    body. The given callback receives an error and a response when the\n    request is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+patch\"></a>\n\n#### bakery.patch()\nSend an HTTP PATCH request to the given URL with the given headers and\n    body. The given callback receives an error and a response when the\n    request is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+discharge\"></a>\n\n#### bakery.discharge(macaroon, onSuccess, onFailure)\nDischarge the given macaroon. Acquire any third party discharges.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| macaroon | <code>Object</code> | The decoded macaroon to be discharged. |\n| onSuccess | <code>function</code> | The function to be called if the       discharge succeeds. It receives the resulting macaroons array. |\n| onFailure | <code>function</code> | The function to be called if the       discharge fails. It receives an error message. |\n\n<a name=\"module_bakeryjs..BakeryStorage\"></a>\n\n### bakeryjs~BakeryStorage\nA storage for the macaroon bakery.\n\n  The storage is used to persist macaroons.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)  \n\n* [~BakeryStorage](#module_bakeryjs..BakeryStorage)\n    * [new BakeryStorage(store, config)](#new_module_bakeryjs..BakeryStorage_new)\n    * [.get(key)](#module_bakeryjs..BakeryStorage+get) ⇒ <code>String</code>\n    * [.set(key, value, callback)](#module_bakeryjs..BakeryStorage+set)\n    * [.clear()](#module_bakeryjs..BakeryStorage+clear)\n\n<a name=\"new_module_bakeryjs..BakeryStorage_new\"></a>\n\n#### new BakeryStorage(store, config)\nInitialize a bakery storage with the given underlaying store and params.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| store | <code>Object</code> | A store object implement the following interface:       - getItem(key) -> value;       - setItem(key, value);       - clear(). |\n| config | <code>Object</code> | Optional configuration. |\n| config.initial | <code>Object</code> | a map of key/value pairs that must be initially included in |\n| config.services | <code>Object</code> | a map of service names (like \"charmstore\" or \"terms\") to         the base URL of their corresponding API endpoints. This is used to         simplify and reduce the URLs passed as keys to the storage. |\n| config.charmstoreCookieSetter | <code>function</code> | a function that can be used to register         macaroons to the charm store service. The function accepts a value         and a callback, which receives an error and a response. |\n\n<a name=\"module_bakeryjs..BakeryStorage+get\"></a>\n\n#### bakeryStorage.get(key) ⇒ <code>String</code>\nRetrieve and return the value for the provided key.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)  \n**Returns**: <code>String</code> - The corresponding value, usually a serialized macaroon.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| key | <code>String</code> | The storage key, usually a URL. |\n\n<a name=\"module_bakeryjs..BakeryStorage+set\"></a>\n\n#### bakeryStorage.set(key, value, callback)\nStore the given value in the given storage key.\n\n    Call the callback when done.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| key | <code>String</code> | The storage key, usually a URL. |\n| value | <code>String</code> | The value, usually a serialized macaroon. |\n| callback | <code>function</code> | A function called without arguments when the       value is properly stored. |\n\n<a name=\"module_bakeryjs..BakeryStorage+clear\"></a>\n\n#### bakeryStorage.clear()\nRemove all key/value pairs from the storage.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)  \n<a name=\"module_bakeryjs..InMemoryStore\"></a>\n\n### bakeryjs~InMemoryStore\nAn in-memory store for the BakeryStorage.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)  \n<a name=\"module_bakeryjs..serialize\"></a>\n\n### bakeryjs~serialize(macaroons) ⇒ <code>string</code>\nSerialize the given macaroons.\n\n**Kind**: inner method of [<code>bakeryjs</code>](#module_bakeryjs)  \n**Returns**: <code>string</code> - The resulting serialized string.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| macaroons | <code>Array</code> | The macaroons to be serialized. |\n\n<a name=\"module_bakeryjs..deserialize\"></a>\n\n### bakeryjs~deserialize(serialized) ⇒ <code>Array</code>\nDe-serialize the given serialized macaroons.\n\n**Kind**: inner method of [<code>bakeryjs</code>](#module_bakeryjs)  \n**Returns**: <code>Array</code> - The resulting macaroon slice.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| serialized | <code>string</code> | The serialized macaroons. |\n\n\n* * *\n","gitHead":"1f59235768818ae43b157aa771fd89ad30fe7586","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"webpack","clean":"rm -rf node_modules dist"},"_npmUser":{"name":"huwshimi","email":"huwshimi@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.11.0","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"16.15.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"28.1.1","util":"0.12.4","buffer":"6.0.3","eslint":"7.12.1","webpack":"5.73.0","@babel/core":"7.18.5","webpack-cli":"4.10.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","stream-browserify":"3.0.0","babel-plugin-rewire":"1.2.0","jest-environment-jsdom":"28.1.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.2.0-beta.1_1655427642186_0.31685439197920373","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@canonical/macaroon-bakery","version":"1.2.0","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.2.0","maintainers":[{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"calebellis","email":"calebellis2805@gmail.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"pmahnke","email":"peter.mahnke@canonical.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"cbe2024ce5edfea6155f9fbafc8400464c019074","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.2.0.tgz","fileCount":5,"integrity":"sha512-docfGyIlNioBNAsyqK0BCtXTD5cmsHZkOAP/l3JZMNQxRlC63Twif3CCr51ud6LiDjo7SlrUhmmBjp8iQ6z1hw==","signatures":[{"sig":"MEUCIEcvWwr6RO0VxLw25/A7D30/CrzZkqd1g1sgCU2gEnPSAiEAiBjVWjMzShuS9SEgniPjHmj55KKBe4rFb9muoJSuVjs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiq+GNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOwA//QsUrOIa17FajD6CfNCbUZ+x3DZXaQ4EOyzRZSlT5k8c9OqgU\r\n4+YE0SCGfqHkQVdggdq6h4E+gWrzRK9CASa3UpDUpaP4jz3tUyauB1Cef7mG\r\ni+KMXQFw1QygsA2LfVGsBdDJL/VjNmOtjawWnsFLTdqogHqr31YUgdIr5mqu\r\nDzm1Zfi2azooXmiMRKX/X6zPQyVz0B63Oh4IMnRbh9FuxSM2A7RkstOpmWNY\r\nuHA9XpIjrlqqfhbiL76uCbLlJQOvVXsmHzkirubUaTkgHEyUWC2dNo5WShJk\r\n6ZbHGy6xTxu7zcigoE+z02Kh/tq4QPwyJF1ynP6eSWBS5V7pVGBQDqBjcXT6\r\nNIKNsAOH/RlJkgu1NRcPcuWl9N5ycCCrzTzpFJv/61USi8zV/oco9WWmr5p7\r\nAZxA/LVtEU7NMPSPaxOG8rMBSQjvuKTP/MT+Q5Gn/+r0WE+Q5gLmEKiP1Fgq\r\nqgeBYiwA9uodrzqTs+0qpF3YVrUMo9gVzFHO2biymZQptEa/IWb5hvsT6y3d\r\njHwg5jrHEBh6RdaJguLMi/q7Da6RV/cj6uN39LjzmwXAfqj40O2H58GMeZmx\r\nmbhUViqpZ7CvrtDQZk1mjDIIbhEmnE57+rYOQX7stdt5mz7QsvB+k3GXYhWF\r\ncFlB8u7cAYP6CMFh/eGWkS0div5gYCKkjko=\r\n=IGX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","gitHead":"ec3c7283eca65fc6a8eba8a2e79f5fec70e6d81d","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"webpack","clean":"rm -rf node_modules dist"},"_npmUser":{"name":"huwshimi","email":"huwshimi@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.11.0","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"16.15.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"28.1.1","util":"0.12.4","buffer":"6.0.3","eslint":"7.12.1","webpack":"5.73.0","@babel/core":"7.18.5","webpack-cli":"4.10.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","stream-browserify":"3.0.0","babel-plugin-rewire":"1.2.0","jest-environment-jsdom":"28.1.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.2.0_1655431565404_0.6417005039907941","host":"s3://npm-registry-packages"}},"1.2.1":{"name":"@canonical/macaroon-bakery","version":"1.2.1","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.2.1","maintainers":[{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"c3a7a9cda783a6f22f4f1fd01180c1ec63682cd7","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.2.1.tgz","fileCount":4,"integrity":"sha512-CxPkLtZzIJstruiMMd3w4y6RflkotLhqVQPTkJZP3abKahfbJrm70Lqcyfblqth2WAVhmTz5pYvaEnVU/8swxQ==","signatures":[{"sig":"MEQCIGBZoUWOLbMGCGtK4Fi6BZl7bWWvK1naxKirCWIPbLrvAiAzuPTbvDnACj/1fehb2Ki6mYIkkwl8YOBlEALckT/63w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1oOuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHhg/9E6ef5RZYLcVWlDZpZdHQLRTJek2f4M9YOKH0XjqfW/bxp/5d\r\n70PJaG2BvV9zuyUkPLP5wk01o0uUBFGdIngTblvHbQ71FoTB2dY047rCrbjl\r\nSv52cYKyFekzhcebHHoNj6r4Z+14h8DFnZfB6//pCU61iCcgrn20CkBMko0w\r\nBwwntjRoerrKtMvO/HIHn0uV26yF3oTZ5kmu2B25/+gGUnqtayB1g0AD6ZpI\r\ndsCqwkiiIpMtmnSLJnuWAD+nct0x5G4+QOJfHeHwGvXpxmG3CEtIsH5DWqcb\r\n1nb+4OBZwNRo4hM09GweazIJ8adGe+hYagfVa6S418ijK87DCnkuxy58EDts\r\nvG5mDiTHDWxdrzi4EuTg/eBPLVaFw+IZSrQbxlt4EBKKF45bZUd0HG22U6LR\r\nkkZn+6QCMQitp5poRWM7N8z5TREJ+/grtbTC7VjvE3iDW5gBzF/7YN42LGB5\r\ncPM8n8WtuDqwfS6B6Mch434yzoKyfT1MIdiXhEjTbRBtE48pw1mlQa81HAxp\r\nhNlyhaACSI5qjqb5BRZxpfnkL1OHgNzd4ekVr6cABC8XeZTvawcBMmJ7T9rZ\r\naDaRHfsO6T558rze/Fb+UnFtqB0UXwIEVuGNNfkFCt2GKZ1Obctjw/jaJh1F\r\nQytk4h5KaYWcL8BgnopA4M/BHaWz4Fd/oE0=\r\n=e988\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","gitHead":"cc601d9f3b90d1709454ef40b475e88b492dcbc2","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"webpack","clean":"rm -rf node_modules dist"},"_npmUser":{"name":"petermakowski","email":"peter@makowski.uk"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.1.2","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"16.13.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"28.1.1","util":"0.12.4","buffer":"6.0.3","eslint":"7.12.1","webpack":"5.73.0","@babel/core":"7.18.5","webpack-cli":"4.10.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","stream-browserify":"3.0.0","babel-plugin-rewire":"1.2.0","jest-environment-jsdom":"28.1.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.2.1_1658225582534_0.16055811496579842","host":"s3://npm-registry-packages"}},"1.2.2":{"name":"@canonical/macaroon-bakery","version":"1.2.2","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.2.2","maintainers":[{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"bba6ff4f9212f0a3c301edfb7af864ff9b9773ee","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.2.2.tgz","fileCount":5,"integrity":"sha512-wiY9L4DMdff8uLgrABKzQVUQy92mYVApz2ffpvRdNw/G0U9p3H7HouIEQsWHQwSKJC+gLIT/fE5o+hUDoF5Ixw==","signatures":[{"sig":"MEQCIDmWY9Y5ZxFeoUyFQch0kP8szsMj0Bj4/QiTp6wN2RHgAiAxQP7JhJzOolcDaV2NC6lDTAaob726zlCJDNNqZ+7N2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":531774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2peOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqn+BAAmtT/EwpkWAKBv8KkQF440dctMW2+sKgUtRpihyAkq1ljvkvZ\r\nZIsypXpojgu/GMu6d+TuiNtaQqNz0XkRtGxvqDqzy/9jDsDm3iZB4WIYUXiy\r\nuPiJYDpYtRwpSNvpIPbJrFoxM1rKffUTeZRSEOmBlXuIXtKyAOZItBDbQPVF\r\neimfsbDZZcwCqBWAsHd+P0rGSql3VRu5UVtUdmGCf/FLX+Bw+5evxjiMgQsO\r\niL+4HwnrtPvTZK9VaOJbsFORMYCZ2jCuhVdkFF+CdCe6SyMDeLEdARrK69oD\r\nBu7CEa6lqvDWOX7DuyizKa39WhXIkH4V5yeMiD9j/ZD6m5mwN/Cq6nX8YdqF\r\n72wtycBxRc/MIWuiQKwsqtr95Ia2RAOeTXEWAEBodI72OIlsqkw5SgLKyAks\r\nym8TF2eIiREZTIDwkiPdC7asW61+vsYX/btR00pKW1K/5TFBzj308VjPzDoI\r\nPbmt6UAJtmFMDdv1Rr+GYaRPgSK1tUx0scJbovvoGAvELEHZSbyLHBWdIu/6\r\ncaSTi1c0Ng9iPey4srlUNvQGmjVCcovfBycNlgZj/JU7U6U3hkJSE+FIKi/7\r\nD1Hjn3jtScCYaNT4AsDKWDAB2LvoX58dTgTrYZ2JXDjGa69GQHLm9JTjXaef\r\nomW4cCX84tSry+5ng/v+31ZivIV6BAU+Nkg=\r\n=+53T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","gitHead":"7f10f032ceb1b2d5559e7b7942d34fd102ae49df","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"webpack","clean":"rm -rf node_modules dist"},"_npmUser":{"name":"petermakowski","email":"peter@makowski.uk"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.1.2","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"16.13.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"28.1.1","util":"0.12.4","buffer":"6.0.3","eslint":"7.12.1","webpack":"5.73.0","@babel/core":"7.18.5","webpack-cli":"4.10.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","stream-browserify":"3.0.0","babel-plugin-rewire":"1.2.0","jest-environment-jsdom":"28.1.1"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.2.2_1658492814313_0.5133110222436146","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"@canonical/macaroon-bakery","version":"1.3.0","author":{"url":"https://fromanegg.com","name":"Jeff Pihach","email":"jeff.pihach@canonical.com"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.3.0","maintainers":[{"name":"goulin-canonical","email":"goulin.khoge@canonical.com"},{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"9ef021733b5564d64929d3f82f36351cd7b1dd1e","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.3.0.tgz","fileCount":7,"integrity":"sha512-gDv+ScuBxMgQQREHj0s2JdNxni/FJtzvyTUEnJoboISWC3gh6tpou2AlsUaU4dQCNwlbJn2dbDecv2gu7GopMA==","signatures":[{"sig":"MEYCIQDU4ikdBY33uWUyZNS+sGf9KjzvHjpaDX6xsqQxG4AVJAIhAJ4J3TlXG70m7lKNVU2ek8iotlepgmP3Gf6mrO5oSfPx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2312457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjnVwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCphAAl9iEEr0FJ6DzYEBa8c3lSrl8scke3dJbT6rqiYo2l186HwVI\r\n9S22QQ2MsnWOicfnm10goqDGXyWsP0JNMUDuMNn2z00dap4A9gCfQwq/Skcb\r\ntoF9Vdqp8CkkAvlDEDlaWCZEllefZVx+J+dH+SfJWWltw4ikSHBVBF+YCK1w\r\nYfDfKPU9u/arRO6A+jY/aEYkA1tYBEG4vyBOzTbwvt1nXDjATnpqFPJflBUD\r\nsKRxZ6whm/CkHzYo3CAA36eUjFASxXkTN8ww2EkKff1GME6r3gJ6ivPy7/Zm\r\n41gb7QmIUJ/K1cJGLTEHg68GyhePPPL6kvSD3/5piBk45me4GucEAJPvrp31\r\njD0z7P/D5wHNjXgPhOSxDkO+maI8deVdpnbcWebMno5Ikzy/4vv0IYEOnMAv\r\nR9hzMJYt8/cBjvOiuZhMQ8rWQi4otqVLMLS7IYmGj9p0I3dQi1qdna09y0Yj\r\naKF8FOq9WuulF4II+NGOR6ROoWr8YJH6CoL+Y1JDfKPbtrGezpXVoyFYTLtK\r\nIBNPEWzuMESnubanAmXr67IuYBrOBeDtBjz4GwaiH4kH3jMpaLy+Rk/GNYrl\r\nJxt5w9QXCT+ylIgxMgQUlSEM4NFkptHF9B+QG7VZXJ/orxDT0G+vxvxA7Gc0\r\n4ffiKCC5L690cJU7He21nwB7vig3Zx9xVHk=\r\n=jYrq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","type":"module","types":"./dist/bakery.d.ts","gitHead":"080079963d44dbb86266aad9c31efb46f3bcb3b8","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"tsc --project tsconfig.build.json && webpack","clean":"rm -rf node_modules dist"},"_npmUser":{"name":"huwshimi","email":"huwshimi@gmail.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.19.1","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"18.9.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"29.2.2","util":"0.12.4","buffer":"6.0.3","eslint":"7.12.1","ts-jest":"29.0.3","webpack":"5.73.0","xhr-mock":"2.5.1","ts-loader":"9.4.1","typescript":"4.8.4","@babel/core":"7.18.5","@types/atob":"^2.1.2","@types/btoa":"^1.2.3","@types/jest":"29.2.2","@types/sjcl":"1.0.30","webpack-cli":"4.10.0","babel-eslint":"10.1.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","source-map-loader":"4.0.1","stream-browserify":"3.0.0","jest-environment-jsdom":"29.2.2"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.3.0_1670280560495_0.655153825895902","host":"s3://npm-registry-packages"}},"1.3.1":{"name":"@canonical/macaroon-bakery","version":"1.3.1","author":{"url":"https://webteam.canonical.com/","name":"Canonical"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.3.1","maintainers":[{"name":"goulin-canonical","email":"goulin.khoge@canonical.com"},{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"985321a73de2125348c5dd3392207e80445f1aff","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.3.1.tgz","fileCount":8,"integrity":"sha512-fbLFyyfSYqL5woYY+K4f9ZaXWTfLkKNnNA6ZOivE1gNi8qcP2o7P0pPErTQS5uWO3tKinr7fd1dprqiP0oq9xw==","signatures":[{"sig":"MEUCIQDAynwY5ealCpdMWrH5ItxC8c3hgiKyOIgVrbffNGMSFAIgFrU68TXcvt1EuDLqEzDY2JU99MprvFuGNnemcjsLDrM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2329327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt9YjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofFg/7BQWdMkuQn59gJtcOp7EdBJ/EGyjNZNfYGl1rasfo7gMBZXRH\r\nyTgWlFDiQt2uZV/Spm7/fLu6VHVLstuonGdkA+bEvu0yUk4ude5jKZDLTEd0\r\nYk3jrUqYBETMnZIZOoc0Jvz66C6fwfPfhaqnCUFvv+2rdnYazhKNVnUshBTE\r\noqj7QuTg/OtFGH2e7H7ZKE+ID8MeDyuTaGUFTlToBGAz1KSMD633nDAx+eJe\r\ncRt2wosP2DsdFd6V3hdVeU9roDmKEnFGvOszpufSGuy9Yg0oI6W1jKM3ttPo\r\nTL6eu7KdFS4HU9UatmptTJQ5lq8R9osKn+SAE60t6OCLcs4mCjWB0mBfsrsX\r\nIG3+RRb8TehfEcR1DXM05bt3o5v6nlEP/GkvhrusARBzFDnvYYxlJTcAuz0w\r\nbOEh5SXXpVZxuotBW+gchoOU6IyOtSadaLLXKEHRyuz5DPBzxaGPJJyR0bQ5\r\nPCvy1PFrZWPyKT7xAa29SUcDC25lrX9Q7ieYjO1j2/IlGyrbUSvs6mJ+Hd6L\r\nhyv0BMXs7UEfOWGVei4AI/9G5/lKdssbFlYRG6TEkRRT11ys2ZzbqIca+o0f\r\nsq5Bnc2qFD6ymsaVxUNAhZKPsH3y0n8Gg7seyViW8+iSSySipvYrFjaZ9b4b\r\nIFW7+cgEGn+QYFj+QUYqmppGfZhFYXXkhKs=\r\n=mzcJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","type":"module","types":"./dist/bakery.d.ts","gitHead":"eb6ba94ede02067cf25b864635be5f9cfcae4113","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"tsc && yarn copy-dts && webpack","clean":"rm -rf node_modules dist","format":"prettier --write '**/*.(js|ts|json|md)' && eslint --fix .","copy-dts":"copyfiles -u 1 \"src/**/*.d.ts\" dist"},"_npmUser":{"name":"goulin-canonical","email":"goulin.khoge@canonical.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.19.2","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"18.12.1","dependencies":{"macaroon":"3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"29.2.2","util":"0.12.4","buffer":"6.0.3","eslint":"^8.31.0","ts-jest":"29.0.3","webpack":"5.73.0","prettier":"^2.8.1","xhr-mock":"2.5.1","copyfiles":"^2.4.1","ts-loader":"9.4.1","typescript":"4.9.4","@babel/core":"7.18.5","@types/atob":"^2.1.2","@types/btoa":"^1.2.3","@types/jest":"29.2.2","@types/node":"^18.11.18","@types/sjcl":"1.0.30","webpack-cli":"4.10.0","babel-eslint":"10.1.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","source-map-loader":"4.0.1","stream-browserify":"3.0.0","eslint-plugin-jest":"^27.2.0","jest-environment-jsdom":"29.2.2","@typescript-eslint/parser":"^5.48.0","@typescript-eslint/eslint-plugin":"^5.48.0"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.3.1_1672992291714_0.862457270967679","host":"s3://npm-registry-packages"}},"1.3.2":{"name":"@canonical/macaroon-bakery","version":"1.3.2","author":{"url":"https://webteam.canonical.com/","name":"Canonical"},"license":"LGPL-3.0","_id":"@canonical/macaroon-bakery@1.3.2","maintainers":[{"name":"goulin-canonical","email":"goulin.khoge@canonical.com"},{"name":"petesfrench","email":"peterfrench94@gmail.com"},{"name":"petermakowski","email":"peter@makowski.uk"},{"name":"frankban","email":"frankban@gmail.com"},{"name":"huwshimi","email":"huwshimi@gmail.com"},{"name":"anthonydillon","email":"me@anthonydillon.com"},{"name":"nottrobin","email":"robin@robinwinslow.co.uk"},{"name":"sowasred2012","email":"sowasred2012@gmail.com"},{"name":"steverydz","email":"steverydz@gmail.com"},{"name":"amylily1011","email":"amy.lily@canonical.com"},{"name":"bartaz","email":"bartek.szopka@canonical.com"},{"name":"clementchaumel","email":"clement.chaumel@canonical.com"},{"name":"jkfran","email":"francisco.jimenez.cabrera@canonical.com"},{"name":"jpmartinspt","email":"joao.figueiredo.martins@canonical.com"},{"name":"albertkol","email":"albert.kolozsvari@canonical.com"}],"homepage":"https://github.com/juju/bakeryjs#readme","bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"dist":{"shasum":"14b81154c247eb9b59fb9d7b5d167d1c2dec4d4f","tarball":"https://registry.npmjs.org/@canonical/macaroon-bakery/-/macaroon-bakery-1.3.2.tgz","fileCount":8,"integrity":"sha512-3VtI9L9m8EPxmddIF4ed+s5KL+QK0pXnHNYaRqiTwOSnwGuJz/TdVwubrtE//hbt9jj/UoYnAlZp5caNUaKjfA==","signatures":[{"sig":"MEQCIGDOeA1Ny2zzepdaygGNEY/vRvS70MB2Z8vFlcQRRLr5AiBMv2CMTfR/cHjOVp0X54W58j10IA6fBD8op0seDgnzzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2329327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt9jvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsSg//WdQjneA9Lb/A0ABf33XkoASt8CwGnIO6e4gCoH9RhU9gvhgV\r\nGaGhjF8TwRF3rPmCjfFFi2vO2cOhUKhThUGsoZv0qdP0L6w0bGqrno3hn48O\r\nVjE71JhJo3cPkl3dUShRiqCG+1kDCIZkKm+2aySVpLzYawRRuLJfK6J/ZBRz\r\n9BrgQMWvGHKhe3iXcUIc7Hpem6WORDMG6573MKMKFPX60cUsqXFU25VOVd03\r\n5H37Thkq/Uv5g6hsKaNrg9KpovtT8flpOUmwXDtPoh4DUvfWDjnn1ldmMZ0r\r\nt2yreK4FMg1PYxYCedadSYl5N2UROqTyoHhbwqYNdYBt6t94KGxHd+B1SIzv\r\npadyl42iqpm8+GWNnDna4qeuQA99QptxWL6qJzsEJn8JtT/5Dnupw5xUpBnv\r\nzQAdPsWIMWJxTFH9a8NNCKrf+lrliijmAEsB9494GjR1MqvA/48ppoe5lSIr\r\nl6kjgkHZL6ATt1Et5b/S9vljxdZDIdnCSynJDXNwYCGoDhmBp+WnVbg6x09L\r\nf0NP9MWbL4roEy9W5E6osm7aNhbobWa92Q2OoV63XMwCvO9NEawtwlYTlVym\r\n98YfW0Vv6ZKYVJZnt7DVpMOA4e5icPaVJPND+tEIRD8z6ZWcXyWKGZJj4RCp\r\nMexDEzW3NLEx6BykSiLVtF7GLTUSkUczK28=\r\n=zHQI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/bakery.js","type":"module","types":"./dist/bakery.d.ts","gitHead":"eb6ba94ede02067cf25b864635be5f9cfcae4113","scripts":{"docs":"jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo","lint":"eslint .","test":"jest","build":"tsc && yarn copy-dts && webpack","clean":"rm -rf node_modules dist","format":"prettier --write '**/*.(js|ts|json|md)' && eslint --fix .","copy-dts":"copyfiles -u 1 \"src/**/*.d.ts\" dist"},"_npmUser":{"name":"goulin-canonical","email":"goulin.khoge@canonical.com"},"repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"_npmVersion":"8.19.2","description":"Perform macaroon aware network requests","directories":{},"_nodeVersion":"18.12.1","dependencies":{"macaroon":"3.0.4","@types/sjcl":"1.0.30"},"_hasShrinkwrap":false,"devDependencies":{"atob":"2.1.2","btoa":"1.2.1","jest":"29.2.2","util":"0.12.4","buffer":"6.0.3","eslint":"^8.31.0","ts-jest":"29.0.3","webpack":"5.73.0","prettier":"^2.8.1","xhr-mock":"2.5.1","copyfiles":"^2.4.1","ts-loader":"9.4.1","typescript":"4.9.4","@babel/core":"7.18.5","@types/atob":"^2.1.2","@types/btoa":"^1.2.3","@types/jest":"29.2.2","@types/node":"^18.11.18","webpack-cli":"4.10.0","babel-eslint":"10.1.0","babel-loader":"8.2.5","@babel/preset-env":"7.18.2","crypto-browserify":"3.12.0","jsdoc-to-markdown":"6.0.1","source-map-loader":"4.0.1","stream-browserify":"3.0.0","eslint-plugin-jest":"^27.2.0","jest-environment-jsdom":"29.2.2","@typescript-eslint/parser":"^5.48.0","@typescript-eslint/eslint-plugin":"^5.48.0"},"_npmOperationalInternal":{"tmp":"tmp/macaroon-bakery_1.3.2_1672993007594_0.7744098408437581","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-06-20T20:16:37.841Z","modified":"2026-09-09T10:46:42.276Z","0.3.0":"2019-06-20T20:16:38.159Z","1.0.0":"2021-06-03T20:45:37.545Z","1.1.0":"2022-05-06T02:24:39.163Z","1.2.0-beta.1":"2022-06-17T01:00:42.468Z","1.2.0":"2022-06-17T02:06:05.640Z","1.2.1":"2022-07-19T10:13:02.702Z","1.2.2":"2022-07-22T12:26:54.555Z","1.3.0":"2022-12-05T22:49:20.750Z","1.3.1":"2023-01-06T08:04:51.930Z","1.3.2":"2023-01-06T08:16:47.842Z"},"bugs":{"url":"https://github.com/juju/bakeryjs/issues"},"author":{"url":"https://webteam.canonical.com/","name":"Canonical"},"license":"LGPL-3.0","homepage":"https://github.com/juju/bakeryjs#readme","repository":{"url":"git+https://github.com/juju/bakeryjs.git","type":"git"},"description":"Perform macaroon aware network requests","maintainers":[{"email":"ilayda.cavusoglupars@canonical.com","name":"ilayda21"},{"email":"frankban@gmail.com","name":"frankban"},{"email":"huw@ikmail.com","name":"huwshimi"},{"email":"me@anthonydillon.com","name":"anthonydillon"},{"email":"steverydz@gmail.com","name":"steverydz"},{"email":"bartek.szopka@canonical.com","name":"bartaz"},{"email":"joao.figueiredo.martins@canonical.com","name":"jpmartinspt"},{"email":"peterfrench94@gmail.com","name":"petesfrench"},{"email":"jmuzina@pm.me","name":"jmuzina"},{"email":"mariapaula.trujillo@canonical.com","name":"mtruj"},{"email":"david.edler@canonical.com","name":"edlerd"},{"email":"ardavan.behnia@canonical.com","name":"abehnia"},{"email":"is-admin@canonical.com","name":"canonical-organization"},{"email":"eduard.manta@canonical.com","name":"edisile-canonical"},{"email":"adam.steciuk@canonical.com","name":"steciuk-canonical"},{"email":"abbie.sims@canonical.com","name":"abbiesims"},{"email":"atakan99saglam@gmail.com","name":"ataku_b"},{"email":"adrian.villa.g@gmail.com","name":"ad.vl"},{"email":"its.muhammad.ali.mughal@gmail.com","name":"engr-ali"},{"email":"urvashi.sharma271099@gmail.com","name":"ninfa_jeon"},{"email":"n.devilliers1999@gmail.com","name":"ndv99"},{"email":"goulin.khoge@canonical.com","name":"goulin-canonical"},{"email":"21112002mj@gmail.com","name":"immortalcodes"},{"email":"alvaro.mateoalvarez@canonical.com","name":"alvaromateo"},{"email":"benjaminaderopo.oni@canonical.com","name":"onibenjo-canonical"}],"readme":"[![view on npm](http://img.shields.io/npm/v/@canonical/macaroon-bakery)](https://www.npmjs.org/package/@canonical/macaroon-bakery)\n[![npm module downloads](http://img.shields.io/npm/dt/@canonical/macaroon-bakery.svg)](https://www.npmjs.org/package/@canonical/macaroon-bakery)\n\n# bakeryjs\n\n# API Reference\n\nbakeryjs.\n\n**Example**\n\n```js\nimport { Bakery } from \"@canonical/macaroon-bakery\";\nconst bakery = new Bakery();\n\nbakery.get(url, headers, callback);\n```\n\n- [bakeryjs](#module_bakeryjs)\n  - [~Bakery](#module_bakeryjs..Bakery)\n    - [new Bakery(config)](#new_module_bakeryjs..Bakery_new)\n    - [.sendRequest(url, method, headers, body, callback)](#module_bakeryjs..Bakery+sendRequest) ⇒ <code>Object</code>\n    - [.get()](#module_bakeryjs..Bakery+get)\n    - [.delete()](#module_bakeryjs..Bakery+delete)\n    - [.post()](#module_bakeryjs..Bakery+post)\n    - [.put()](#module_bakeryjs..Bakery+put)\n    - [.patch()](#module_bakeryjs..Bakery+patch)\n    - [.discharge(macaroon, onSuccess, onFailure)](#module_bakeryjs..Bakery+discharge)\n  - [~BakeryStorage](#module_bakeryjs..BakeryStorage)\n    - [new BakeryStorage(store, config)](#new_module_bakeryjs..BakeryStorage_new)\n    - [.get(key)](#module_bakeryjs..BakeryStorage+get) ⇒ <code>String</code>\n    - [.set(key, value, callback)](#module_bakeryjs..BakeryStorage+set)\n    - [.clear()](#module_bakeryjs..BakeryStorage+clear)\n  - [~InMemoryStore](#module_bakeryjs..InMemoryStore)\n  - [~serialize(macaroons)](#module_bakeryjs..serialize) ⇒ <code>string</code>\n  - [~deserialize(serialized)](#module_bakeryjs..deserialize) ⇒ <code>Array</code>\n\n<a name=\"module_bakeryjs..Bakery\"></a>\n\n### bakeryjs~Bakery\n\nA macaroon bakery implementation.\n\nThe bakery implements the protocol used to acquire and discharge macaroons\nover HTTP.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)\n\n- [~Bakery](#module_bakeryjs..Bakery)\n  - [new Bakery(config)](#new_module_bakeryjs..Bakery_new)\n  - [.sendRequest(url, method, headers, body, callback)](#module_bakeryjs..Bakery+sendRequest) ⇒ <code>Object</code>\n  - [.get()](#module_bakeryjs..Bakery+get)\n  - [.delete()](#module_bakeryjs..Bakery+delete)\n  - [.post()](#module_bakeryjs..Bakery+post)\n  - [.put()](#module_bakeryjs..Bakery+put)\n  - [.patch()](#module_bakeryjs..Bakery+patch)\n  - [.discharge(macaroon, onSuccess, onFailure)](#module_bakeryjs..Bakery+discharge)\n\n<a name=\"new_module_bakeryjs..Bakery_new\"></a>\n\n#### new Bakery(config)\n\nInitialize a macaroon bakery with the given parameters.\n\n| Param                          | Type                  | Description                                                                                                                                                                                                        |\n| ------------------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| config                         | <code>Object</code>   | optional config.                                                                                                                                                                                                   |\n| config.onSuccess               | <code>function</code> | a function to be called when the request completes properly.                                                                                                                                                       |\n| config.protocolVersion         | <code>number</code>   | the macaroon protocol version that the bakery should use.                                                                                                                                                          |\n| config.storage                 | <code>function</code> | the storage used to persist macaroons. It must implement the following interface:                                                                                                                                  |\n| config.storage.get             | <code>function</code> | get(key) -> value.                                                                                                                                                                                                 |\n| config.storage.set             | <code>function</code> | set(key, value, callback): the callback is called without arguments when the set operation has been performed. If not provided, it defaults to BakeryStorage using an in memory store.                             |\n| config.visitPage               | <code>function</code> | the function used to visit the identity provider page when required, defaulting to opening a pop up window. It receives an error object.                                                                           |\n| config.visitPage.Info          | <code>Object</code>   | an object containing relevant info for the visit handling.                                                                                                                                                         |\n| config.visitPage.Info.WaitUrl  | <code>String</code>   | the url to wait on for IdM discharge.                                                                                                                                                                              |\n| config.visitPage.Info.VisitUrl | <code>String</code>   | the url to visit to authenticate with the IdM.                                                                                                                                                                     |\n| config.visitPage.jujugui       | <code>function</code> | an optional value specifying a method to use against idm to authenticate. Used in non interactive authentication scenarios.                                                                                        |\n| config.sendRequest             | <code>function</code> | a function used to make XHR HTTP requests, with the following signature: func(path, method, headers, body, withCredentials, callback) -> xhr. By default an internal function is used. This is mostly for testing. |\n\n<a name=\"module_bakeryjs..Bakery+sendRequest\"></a>\n\n#### bakery.sendRequest(url, method, headers, body, callback) ⇒ <code>Object</code>\n\nSend an HTTP request to the given URL with the given HTTP method, headers\nand body. The given callback receives an error and a response when the\nrequest is complete.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n**Returns**: <code>Object</code> - the XHR instance.\n\n| Param    | Type                  | Description                                                                                                                                            |\n| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| url      | <code>String</code>   | The URL to which to send the request.                                                                                                                  |\n| method   | <code>String</code>   | The HTTP method, like \"get\" or \"POST\".                                                                                                                 |\n| headers  | <code>Object</code>   | Headers that must be included in the request. Note that bakery specific headers are automatically added internally.                                    |\n| body     | <code>String</code>   | The request body if it applies, or null.                                                                                                               |\n| callback | <code>function</code> | A function called when the response is received from the remote URL. It receives a tuple (error, response). If the request succeeds the error is null. |\n\n<a name=\"module_bakeryjs..Bakery+get\"></a>\n\n#### bakery.get()\n\nSend an HTTP GET request to the given URL with the given headers.\nThe given callback receives an error and a response when the request is\ncomplete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+delete\"></a>\n\n#### bakery.delete()\n\nSend an HTTP DELETE request to the given URL with the given headers and\nbody. The given callback receives an error and a response when the\nrequest is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+post\"></a>\n\n#### bakery.post()\n\nSend an HTTP POST request to the given URL with the given headers and\nbody. The given callback receives an error and a response when the\nrequest is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+put\"></a>\n\n#### bakery.put()\n\nSend an HTTP PUT request to the given URL with the given headers and\nbody. The given callback receives an error and a response when the\nrequest is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+patch\"></a>\n\n#### bakery.patch()\n\nSend an HTTP PATCH request to the given URL with the given headers and\nbody. The given callback receives an error and a response when the\nrequest is complete.\n\n    See the \"sendRequest\" method above for a description of the parameters.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)  \n<a name=\"module_bakeryjs..Bakery+discharge\"></a>\n\n#### bakery.discharge(macaroon, onSuccess, onFailure)\n\nDischarge the given macaroon. Acquire any third party discharges.\n\n**Kind**: instance method of [<code>Bakery</code>](#module_bakeryjs..Bakery)\n\n| Param     | Type                  | Description                                                                                     |\n| --------- | --------------------- | ----------------------------------------------------------------------------------------------- |\n| macaroon  | <code>Object</code>   | The decoded macaroon to be discharged.                                                          |\n| onSuccess | <code>function</code> | The function to be called if the discharge succeeds. It receives the resulting macaroons array. |\n| onFailure | <code>function</code> | The function to be called if the discharge fails. It receives an error message.                 |\n\n<a name=\"module_bakeryjs..BakeryStorage\"></a>\n\n### bakeryjs~BakeryStorage\n\nA storage for the macaroon bakery.\n\nThe storage is used to persist macaroons.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)\n\n- [~BakeryStorage](#module_bakeryjs..BakeryStorage)\n  - [new BakeryStorage(store, config)](#new_module_bakeryjs..BakeryStorage_new)\n  - [.get(key)](#module_bakeryjs..BakeryStorage+get) ⇒ <code>String</code>\n  - [.set(key, value, callback)](#module_bakeryjs..BakeryStorage+set)\n  - [.clear()](#module_bakeryjs..BakeryStorage+clear)\n\n<a name=\"new_module_bakeryjs..BakeryStorage_new\"></a>\n\n#### new BakeryStorage(store, config)\n\nInitialize a bakery storage with the given underlaying store and params.\n\n| Param                         | Type                  | Description                                                                                                                                                                             |\n| ----------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| store                         | <code>Object</code>   | A store object implement the following interface: - getItem(key) -> value; - setItem(key, value); - clear().                                                                            |\n| config                        | <code>Object</code>   | Optional configuration.                                                                                                                                                                 |\n| config.initial                | <code>Object</code>   | a map of key/value pairs that must be initially included in                                                                                                                             |\n| config.services               | <code>Object</code>   | a map of service names (like \"charmstore\" or \"terms\") to the base URL of their corresponding API endpoints. This is used to simplify and reduce the URLs passed as keys to the storage. |\n| config.charmstoreCookieSetter | <code>function</code> | a function that can be used to register macaroons to the charm store service. The function accepts a value and a callback, which receives an error and a response.                      |\n\n<a name=\"module_bakeryjs..BakeryStorage+get\"></a>\n\n#### bakeryStorage.get(key) ⇒ <code>String</code>\n\nRetrieve and return the value for the provided key.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)  \n**Returns**: <code>String</code> - The corresponding value, usually a serialized macaroon.\n\n| Param | Type                | Description                     |\n| ----- | ------------------- | ------------------------------- |\n| key   | <code>String</code> | The storage key, usually a URL. |\n\n<a name=\"module_bakeryjs..BakeryStorage+set\"></a>\n\n#### bakeryStorage.set(key, value, callback)\n\nStore the given value in the given storage key.\n\n    Call the callback when done.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)\n\n| Param    | Type                  | Description                                                            |\n| -------- | --------------------- | ---------------------------------------------------------------------- |\n| key      | <code>String</code>   | The storage key, usually a URL.                                        |\n| value    | <code>String</code>   | The value, usually a serialized macaroon.                              |\n| callback | <code>function</code> | A function called without arguments when the value is properly stored. |\n\n<a name=\"module_bakeryjs..BakeryStorage+clear\"></a>\n\n#### bakeryStorage.clear()\n\nRemove all key/value pairs from the storage.\n\n**Kind**: instance method of [<code>BakeryStorage</code>](#module_bakeryjs..BakeryStorage)  \n<a name=\"module_bakeryjs..InMemoryStore\"></a>\n\n### bakeryjs~InMemoryStore\n\nAn in-memory store for the BakeryStorage.\n\n**Kind**: inner class of [<code>bakeryjs</code>](#module_bakeryjs)  \n<a name=\"module_bakeryjs..serialize\"></a>\n\n### bakeryjs~serialize(macaroons) ⇒ <code>string</code>\n\nSerialize the given macaroons.\n\n**Kind**: inner method of [<code>bakeryjs</code>](#module_bakeryjs)  \n**Returns**: <code>string</code> - The resulting serialized string.\n\n| Param     | Type               | Description                     |\n| --------- | ------------------ | ------------------------------- |\n| macaroons | <code>Array</code> | The macaroons to be serialized. |\n\n<a name=\"module_bakeryjs..deserialize\"></a>\n\n### bakeryjs~deserialize(serialized) ⇒ <code>Array</code>\n\nDe-serialize the given serialized macaroons.\n\n**Kind**: inner method of [<code>bakeryjs</code>](#module_bakeryjs)  \n**Returns**: <code>Array</code> - The resulting macaroon slice.\n\n| Param      | Type                | Description               |\n| ---------- | ------------------- | ------------------------- |\n| serialized | <code>string</code> | The serialized macaroons. |\n\n---\n","readmeFilename":"README.md"}