{"_id":"@bogeychan/kingworld-oauth2","_rev":"10-c7754c1dfbf210028cf13d59e5fb6a35","time":{"created":"2022-07-19T06:24:56.020Z","0.0.0-experimental.0":"2022-07-19T05:58:51.757Z","modified":"2023-04-24T16:57:24.482Z","0.0.0":"2022-07-19T06:24:56.342Z","0.0.1":"2022-07-19T06:27:33.606Z","0.0.2":"2022-07-19T17:28:36.641Z","0.0.3":"2022-07-20T20:06:44.849Z","0.0.4":"2022-07-24T18:38:19.149Z","0.0.5":"2022-12-25T03:38:50.333Z","0.0.6":"2022-12-25T03:56:30.405Z"},"name":"@bogeychan/kingworld-oauth2","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.0":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.0","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/**/*.ts","devDependencies":{"bun-types":"^0.1.4","kingworld":"^0.0.0-experimental.17","typescript":"^4.7.4"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"keywords":["kingworld","oauth2"],"gitHead":"5be4e2655e583c70eed2b55d5340da5eed06dc2d","_id":"@bogeychan/kingworld-oauth2@0.0.0","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-GUskGlMglt6Fu4wGUw3lQp3mwPFkScCuUrC2asZXlHIRzQkO4e2m5sz32LYNsrmgPnHPGfDeo3OR6kWbZ8aKSA==","shasum":"2ae131576b3486c64e4a1a12d15a53a85003044d","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.0.tgz","fileCount":9,"unpackedSize":20251,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5EuL635qvZy52s44ZaBSLY5s00yjFOPaQKjEoUytSEAiEAvwfZRDUFu+UU37jH8Of3aotRuHOrmEw8PnqXRHXrJxQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1k44ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1oQ//e0bx5FW1VPzn0W/1CSG0K+jFc+CngTmunLtMfBJW9bBIef/4\r\nNZituwJ+MuEz7mKT1JzWNagK9jvOKRm/xWuvWqUZ5YASNI+GFNDI9ZU3OZrc\r\nGxmXTZB0xOsVJh9yOzEYJq4+Axd4HEVLhhSDD8m8G1qd9hILGCFTDtI5YfIn\r\nERiPQuoRifTiIUYQqIp42kzhwy/sNuSB6/fUm+pCPQceNqrhJt8bVLrjGOz3\r\nm0j3/VqjX7YwotNmjemiti5/YukU5HO2uUElt8Sn5pK1wu+PSPyd7vK+L4p5\r\nBU0tr8BcGckbeCxAagdCnQco5ujLA+r6z2/hKkOHwXFJx7cC1W6i1bnjrT8f\r\nIiy8im9/IoxC+dkt3KturEbTBdZJbeQIofttdfWXMf+ctDs0VJy/X3/IIA9P\r\n2DEdKW3HApbb+AMDQWg1v7EMZHXUOWPj96dxohWnuvDIwTvy61dEC1owSAoS\r\nvqLVWpyjhK4uLY2VS3p31Q/AjPoJShbLqzBfFxfdfd1flgwWUgiqr0O+DZKx\r\nF3yI0XwVW/YZSwepqgN/htwpzvwM8zIu4qo+wxz2CjeW+6CVE4oS+V9au6am\r\n9TmimOE+PHIJwVSDwzItD7eF0+6J2BqW4bx+iUXeA3cVBvS+mp2LmryBiAul\r\nW8PwJMuHPZIvrGzy9OFaBAgdtYcXe5mib3A=\r\n=rAtO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.0_1658211896099_0.2930333761043882"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.1":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.1","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.1.4","kingworld":"^0.0.0-experimental.17","typescript":"^4.7.4"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"keywords":["kingworld","oauth2"],"gitHead":"5be4e2655e583c70eed2b55d5340da5eed06dc2d","_id":"@bogeychan/kingworld-oauth2@0.0.1","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-aFEeEiB/s9KBRmyKXSBh+NK+EPtaQ7jyWaE/04WKc/UfDv5mLxdDMG/mlg8VItlKjSY5sQwi5oqcKCKZhwgHKA==","shasum":"26d255b13a22eff919b319e68571a7023d4e2cb7","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.1.tgz","fileCount":9,"unpackedSize":20252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0eVO4yurBM7oZYEKeVrVgLnWJXAIWXcR1uUBzHyI1zQIgYtLGIlZybR2oc4fO/EzO0PzxYTi1vSEAu3gtYaoenJk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1k7VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmof3BAAgBhWyazLdxXxVizf9jgYoqDI4M4sDGO5E3MAwt0xniRfV0HP\r\nEIoyH6BLQEKSJ98p3vrArJXdQS8p1VLI/bNiPnyeucTOJ0tzzlkyqbCsRMy9\r\nVPtprKZ4ZYXjKz3fETW5sIWZCVmmCgRkfXGADfrfGygtEDO6i6R+LLEhiarU\r\no34YHTu8Fi23hGxHUmnvb70AknJv0FHTYPj/yiFGlH7ARHDLTDW7Ojj3/Gtw\r\nsSBgM0V1uNwTn/NYaxUUHVvlm5UkY2KUTx2CdkShrDQGwVJszFUsnDx3+HGo\r\nyAQXl29dV2q4HrkhYBw1r/Hc29rFRoFyR9qXDq0Arei9qHFDtKaNsY9M4ogK\r\nOrdy1lPpr9zQE+dZkrshRV2JfStVSLWc3ED4WzCYVoFYA22X/mn7giOlKSdM\r\nkJBw5J4NzKmWpC3V52hZsDSB5DqsSm7YOV7VsGzZbz40zbvNuPr8nvo24U4R\r\niAg36BnM6Lnsq3ViXNRWyakJEI98RujY0fKXNV49Z66bqU45ScgvvVLpjqdE\r\npHXOqRBWBQme7UzH9OVsW1zRsJGBRIe16SeREOzK72kSkBBXAwzHdL9WlMDY\r\n/LRsEqOjrcPfPM8zOu1bmFqC81jWmBL4UZ/rAiIBouyOBgZFB2JFcI5KTqw9\r\nXfQV7/SgXmIReKkN1y6ArXxgoe2GYfgwVSI=\r\n=CVW/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.1_1658212053486_0.5134300714447009"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.2":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.2","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.1.4","kingworld":"^0.0.0-experimental.17","typescript":"^4.7.4"},"peerDependencies":{"kingworld":">= 0.0.0-experimental.17"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"license":"MIT","keywords":["kingworld","oauth2"],"gitHead":"9c3633f16d785f43a8d0bc4a2fc4f277776515c2","_id":"@bogeychan/kingworld-oauth2@0.0.2","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-h8OaC55lSox/NhCT0Yw0KuD7UVeiL7oZvERBBZrclFlk0lHsgAcK3KX7nkQz+TneVl+KYpAs881oQIY2GYCM4Q==","shasum":"821236f88cf8f12ff781887957c854c31d11dd62","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.2.tgz","fileCount":9,"unpackedSize":20542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPXbLZz1JNJSOy3fygiu+ONMQhYZdVzTItprmDnh/YzQIgNgx5A1GQ96Hgu9AMOwjGqt9vHjmUePR5hPjjFo9RpYA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1unEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2HhAAnTxBaT2mIbpwoNSlbKVlEZM9ud0ROdiEPzfi4Ix3fVV6sd7x\r\ns6xv0EgUNg2hxeJyxIM5wdfBtH7v8Uv+hmZK1vTQXU250XmFZ9s411jwc1KU\r\n5WqxgaYWr6G16mSRH8+0kn3R8VLISBIonUoA/FUN+NakmCVVXRp/lZkMlLgI\r\nBSO2WfsaV0HMTgCucJBjmmNdawFYrSC4Xc0xE4811/69ysGT/w20eHLyM7z0\r\n/GsKLBLEHRVVZIT4UvdugeoR4WByJ5eB0z2Xl3mTNKB7DR1r1joobREPnemy\r\nnvPbFYa8kx7oKzaXlG18TDUUkqP2mnO29fjKgu2unZhDvV8wT2UzbM9nYyKf\r\nXvR3aSM9YKJHB1jGPuG++T7PmW17BITTIeTTL9qzINUm+q1/nV8HwBkwY3WJ\r\njguJA//Cx5SXR+oO3cVAJxinxHfqKk1kYzJrKKCOPUYzC4gH89NlP0su4Jt6\r\nNjW4aJ2M4J2tp1kkEGud90WkmZwC4lBjsRctogkotA87z/L584t+7kNEFoJV\r\nzpYLAsiwwFjsrgRb0IZ0eVpKG56JP5bPUayFP72u+sWaJ0dFoJ9k3CLg2Ko2\r\nXNczmK2kF9Pm99L7v80uVmOSTKymFywzf9CfobKdODf3HUA13YquZ90/pB5W\r\nCV6dNtQKNV7MwyzdUaGcfEkT2qJku6ScL/M=\r\n=8De7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.2_1658251716463_0.623271294825382"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.3":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.3","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.1.4","kingworld":"^0.0.0-experimental.17","typescript":"^4.7.4"},"peerDependencies":{"kingworld":">= 0.0.0-experimental.17"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"license":"MIT","keywords":["kingworld","oauth2","bun"],"gitHead":"c62b7fc999821e60776d63e4664a2ee689601f30","_id":"@bogeychan/kingworld-oauth2@0.0.3","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-CwToAXNX2wxu50yxK6yKm1cgIqZgc3/10grYAZiX27xh471gWQAqx2gBoV1d2HpTVgeBioUosvCDnYVCExM5ZA==","shasum":"103104d233da563805a8f926c3c9dea17ddf0da2","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.3.tgz","fileCount":11,"unpackedSize":22991,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEhOYZ8HP/csaSXXwLc+ZWqbgIGngd0V3Q5tsqzkqXHgIhAJGw1qxZQ782kgvACjfMv4H4cvl3kzMw/mOjm5RF5P4u"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2GBUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsrQ/9E11oIrvtguuCECZscyQ1kSE/bMySdWzMDBjTk5nnV4sdDTrk\r\nbkIQxgvLlab5sv/k7JE3GoZxOxR8o9VtwBe52GeC6b0HOzvVThvutAW3TS5y\r\nejBT9KqOtOsRsnlGgoQoNxPGN1TZKNXOBEt4OUV24lnb57tJGs8BBu+Eopfk\r\n8fPvP3emIx0VGw/cUITzV18NBiOa/1HqPMGcm0zAx31MtnkWLKhdMaG+74Gi\r\ncKtyVIwZ9360AONJRXJ6xY0YyBOeSD6yAd8ef2bqcuz3eAleEUbfL9xbU+Rf\r\nEoBe2C+6HskeEmbcgdNvXB1W0iVmGDS72PXw3VfSlN5CHkkvI9hmno9C3RGx\r\nDGXrgxEVyTdt2QuacGZFeyiTXR9/kci3MPjTgwOpfi7QKULK2dmbGXQ3AISw\r\niRUn/Plk5DkT1h1faw4fc6lT6rIRphRidi5FXnxCkecMLYJftbxwBUIrc9yP\r\nqEuqkLa0jQfR8/N4ldU9lsk14ZlNh0xM2GdsrN4V0nfC//KZymaxRNGY4861\r\n41eWRr73i2PakcJIhZ/rk4D2iosucPgEvKbhXzG2VbhQi0TA/4nmP81NOBBM\r\n9p0ul4TepJdpUb8DEmbzJauOzsnwTuWvj0IC5Iavevsk+Q0KDUan3ivDl27m\r\nZ2ECWucc+UC5L6EiBcGBZzpLK+9TamEkFfA=\r\n=BEsd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.3_1658347604706_0.7540630581148058"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.4":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.4","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.1.4","kingworld":"^0.0.0-experimental.17","typescript":"^4.7.4"},"peerDependencies":{"kingworld":">= 0.0.0-experimental.17"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"license":"MIT","keywords":["kingworld","oauth2","bun"],"gitHead":"372b53abfd6a3fdf1a9612810e667a678698f83e","_id":"@bogeychan/kingworld-oauth2@0.0.4","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-5QanCwZTKEEkBH+ZKdj7QIFvZ0atB3R9sWQItiuqadiYI6biyEVMaa9rLj4pbADnkkzSj1NktM7yUrengZ35wg==","shasum":"15cc379fc8a57fe09e9f4259b51b9f2fd7475c5c","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.4.tgz","fileCount":13,"unpackedSize":25968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzCDz5raENvUyHYeaR38fRpfY6ICfT1HJc/SEcoHk5JAiEAxFhcvMKmi45mgta9sAd2wkMjbFmRr8eqM/4szFciZ7w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3ZGbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6Ew/8CzX+kHVkwLSkQ/ldGwplGzuP/O8nIzhYNIPEapFODmPf2fxz\r\na2CgitGVBlAGs4hAiutkcKq9Wc7eNdrSxmtz6VFP+HJFMZXF7PGxf6LyYOZT\r\n1qAG6PhOXORMG5nuX8jBIdBv5MMym+WYno4PDp8/GtDam6eNWPSAxtmMmmZe\r\nyyOeQgfrxMA6prWk8xQ8tcMaKiH5sHxFdhpadccsNKOHMXMzaN78/09azxI/\r\njyndHYdbUvlrHUxtV42urYkcwMBx0kHGU59Ab9Vf+KrG35LOWxu4GTHVg0Gu\r\n5ObJCVfl+dEpqdUtIHp7b0n7O958B0fbeVQv+xmxnFNpX2XghwDd5CpQBu7m\r\npuucfbhU2JkcBK+dqPV7EjuC5wsKTh7pzQ5lDk7DfFP1zUa8gkRy1OOFKttO\r\nu/53BS91km8w4NVnzM0p6pB6lMf4ejLFoExx3T4VPCv5BFuYnQyCFqe2Snzj\r\nJklzGbSN2dlXxZ7KaTZeOWsBP+CdAriMGkw+QzYaUqO6qnbP0l2HTghJKPXn\r\nYiY/3WP4JWXFgm+crCOa+VWnhasnKZ+l9QUBXoczP+n/MuBjl5htWE5qN1mt\r\nPGJajnTkurPjwqw38+zzWQTLHBOJLRBcHeW1XUPSZvAl0fvQcz3KRHlol+Br\r\nx5+1TBwFV8SPel9pR3NDnfzQY6jfFXkcqQ8=\r\n=5dDc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.4_1658687898880_0.13873352985559517"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.5":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.5","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.4.0","kingworld":"^0.0.0-experimental.55","typescript":"^4.9.4"},"peerDependencies":{"kingworld":">= 0.0.0-experimental.55"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"license":"MIT","keywords":["kingworld","oauth2","bun"],"gitHead":"a06c5781615cc1f84e89ae4ee5320c472ae35384","_id":"@bogeychan/kingworld-oauth2@0.0.5","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-D7kdDYMiEZ9sMXoCiPmPqWO2U5M5P37GSnh2EdWADLl6AZhrhkZkSoc69fy6xvC8xM+02ct00uQYRK86ExRFvw==","shasum":"ab30c20f2ac3a1b26b6796526757c0ae4668017f","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.5.tgz","fileCount":13,"unpackedSize":26256,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnPLFO2ZQHrRCAcLKM/XIEolxLH2aGE7hdxAlkT6UM/AiEAyGnAAz/GQGiwsUVcxemCBvhh3WVAimTnz2j/mi2NgJA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjp8XKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrP/w/6Av54ifz7HN6h1Pi87vkmPFgym/2dX+BQROp15AIbpsVffMlL\r\nmRI9THVaGCHQyNDcwCRGW5eGmW96lOEFojyNMjnEJOaS5V1fXP2tPnUlTl3I\r\ndGT1qB2vg8KDzNmAyIcA8xcfbxRVhYDMPVc8zvBJ8lh45pU7qwIAdxw2c1eQ\r\ni7wdpU/T1V5aAop3yA8vUyqd2v3+m4Ia6ZAHOV2KMFu6akVvzZQeeWCOL3oj\r\nPpdHDszOZ/gr0a4EqkPRg7T8WhL26vU6gKMv8DeAaWem5uA6H1IQzS6u7Op1\r\n4SssgUfo8Lxl5IB4CY+goqx3e4f9fNZGeHf/HkGj9Hvf7nZnmcyr8px8CHWr\r\njpbTOnyUfbbVzd620nKGdzlUlE5z6WJ6tbhtuxOsOkgP9QXirvfwigocxiML\r\nOhx2GgmdrWCNRZMejPapYCdN3V9u1mcBnOUXdDNobZpSfSbUUvdGM8vhqGh2\r\n8D6Tpa7VjXDN+7svSJODTzFe39vLA8KxI6lJzRavAwyQ1SuwHJaOOk7hgr8/\r\nbCAjRldRRpSdFLjtxr643/+HjYXwPOSshid0882S3AGu86mYTvelbQp+ZHCJ\r\no1as2m8ZaY5WrwBFGSlI+cjC+bFkmI9ekukOAqSXhfA34q1g7BmfJE2614GM\r\nfBhdGntl67+pd8xGZ02tE4tUYuzVRTD01Sw=\r\n=iqyX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.5_1671939530180_0.29417025294959553"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.6":{"name":"@bogeychan/kingworld-oauth2","version":"0.0.6","description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","devDependencies":{"bun-types":"^0.4.0","kingworld":"^0.0.0-experimental.55","typescript":"^4.9.4"},"peerDependencies":{"kingworld":">= 0.0.0-experimental.55"},"homepage":"https://github.com/bogeychan/kingworld-oauth2","bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"license":"MIT","keywords":["kingworld","oauth2","bun"],"gitHead":"17473b025a9b640ebd267287d302f8bd84850f22","_id":"@bogeychan/kingworld-oauth2@0.0.6","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-mw+Njj52q8Q0lIJi0CVq5utZnvL4t8fzZGHyBhg9e+IuTxB9LJOBY1fRbvN4xCKlUnnlIPxqs2Z87siT60q93A==","shasum":"fe218e0e5d19dbb4b325c38239b192f93f71416b","tarball":"https://registry.npmjs.org/@bogeychan/kingworld-oauth2/-/kingworld-oauth2-0.0.6.tgz","fileCount":13,"unpackedSize":26373,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICJsYtIOLeOeuh1llbRMWCbLJ0hiNroP7sA/nq0iPy1SAiEA6ZoQiEQ3o5aM/iM8lRdJ1/g+R7ogj/IGRIFKv0srDXE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjp8nuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsrQ/+MRJdMrwEkezrYQimFvGghlHCv6lm4CxHZgZkd4b4/qrN/ZU9\r\nLuEtYhYWCaiwLvM1lLIxg4aDk20CB5sgAh/zndUps1jseNvL/oP/pirOzVcF\r\nDgOHCHmw4wHWZf1R9Z/SE1jxEEHNP13UQ9kJKzUpVLL5JpMBRZQhwNZaadeH\r\n6YPJEsTe/nzLTCGAX3V7SruUwtBps7CSbbqToZ6KKtFmTl5nKaUwXXz+6R36\r\ncZAQ5FYyF04X4SeMWUane0tYwxMBM5PCQ0W7+f//ZtMbDMF+/H217dWWrTbg\r\nf7n8r15x5VykmvAvefOW3weFdW4410Jx2jM1GCqM9SmM1zhCX6FQDBiOgdze\r\nKuWYxGXsR6weOX5fuQ79JctV2KaY4q+GSdrSO+N3nrxnBrGHxr+jiOT6USl0\r\nKWLN7BcU383dBrhlJxI9OOP7GqPv6x5juo6t700iLr89WENv4Blv+l2EH0iF\r\n3SvBAooYtXwPSVl+H4sn76V50+WZaOcZs5Qeq7iG8ZjDlKP9YKg/+GQ3Jqg/\r\nEabY5RyivixCGfiA/fK8JWOXoNHMDA4751CS8B+hPZ8+2kd7Js6QN/ufa8bn\r\ndSJ9vrsqOdTN25RCWcFNnmFSlqvZSVoXz+V3iAHThQh/0D+4J2EEhPQVbuJr\r\n9DZP0Av1r8rtKXXM3M7q3zxA7lkTMvnLTAM=\r\n=bZH8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kingworld-oauth2_0.0.6_1671940590234_0.3386492715841265"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"description":"A plugin for kingworld for server-side OAuth 2.0 Authorization Code Flow","homepage":"https://github.com/bogeychan/kingworld-oauth2","keywords":["kingworld","oauth2","bun"],"repository":{"type":"git","url":"git+https://github.com/bogeychan/kingworld-oauth2.git"},"author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"bugs":{"url":"https://github.com/bogeychan/kingworld-oauth2/issues"},"readme":"## ⚠️ KingWorld is now [\"Elysia\"](https://github.com/elysiajs/elysia) therefore @bogeychan/kingworld-oauth2 moved to a new repo [@bogeychan/elysia-oauth2](https://github.com/bogeychan/elysia-oauth2)\r\n\r\nA plugin for [kingworld](https://github.com/saltyaom/kingworld) for server-side [OAuth 2.0 Authorization Code Flow](https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/)\r\n\r\n## Installation\r\n\r\n```bash\r\nbun add @bogeychan/kingworld-oauth2\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport KingWorld from 'kingworld';\r\nimport oauth2, { github } from '@bogeychan/kingworld-oauth2';\r\n\r\nimport { randomBytes } from 'crypto';\r\n\r\nconst globalState = randomBytes(8).toString('hex');\r\nlet globalToken = null;\r\n\r\n// typescript type support\r\nconst app = new KingWorld();\r\n\r\nconst auth = oauth2({\r\n  profiles: {\r\n    // define multiple OAuth 2.0 profiles\r\n    github: {\r\n      provider: github(),\r\n      scope: ['user']\r\n    }\r\n  },\r\n  state: {\r\n    // custom state verification between requests\r\n    check(req, name, state) {\r\n      return state === globalState;\r\n    },\r\n    generate(req, name) {\r\n      return globalState;\r\n    }\r\n  },\r\n  storage: {\r\n    // storage of users' access tokens is up to you\r\n    async get(req, name) {\r\n      return globalToken;\r\n    },\r\n    async set(req, name, token) {\r\n      globalToken = token;\r\n    },\r\n    async delete(req, name) {\r\n      globalToken = null;\r\n    }\r\n  }\r\n});\r\n\r\nfunction userPage(user: {}, logout: string) {\r\n  const html = `<!DOCTYPE html>\r\n    <html lang=\"en\">\r\n    <body>\r\n      User:\r\n      <pre>${JSON.stringify(user, null, '\\t')}</pre>\r\n      <a href=\"${logout}\">Logout</a>\r\n    </body>\r\n    </html>`;\r\n\r\n  return new Response(html, { headers: { 'Content-Type': 'text/html' } });\r\n}\r\n\r\napp\r\n  .use(auth)\r\n  .get('/', async (ctx) => {\r\n    // get login, callback, logout urls for one or more OAuth 2.0 profiles\r\n    const profiles = ctx.profiles('github');\r\n\r\n    // check if one or more OAuth 2.0 profiles are authorized\r\n    if (await ctx.authorized('github')) {\r\n      const user = await fetch('https://api.github.com/user', {\r\n        // ... and use the Authorization header afterwards\r\n        headers: await ctx.tokenHeaders('github')\r\n      });\r\n\r\n      return userPage(await user.json(), profiles.github.logout);\r\n    }\r\n\r\n    // Render login page\r\n    const html = `<!DOCTYPE html>\r\n    <html lang=\"en\">\r\n    <body>\r\n      <h2>Login with <a href=\"${profiles.github.login}\">Github</a></h2>\r\n    </body>\r\n    </html>`;\r\n\r\n    return new Response(html, { headers: { 'Content-Type': 'text/html' } });\r\n  })\r\n  .listen(3000);\r\n\r\nconsole.log('Listening on http://localhost:3000');\r\n```\r\n\r\n## Where are the client credentials?\r\n\r\n1. Generate a `client id` and `client secret` for an [OAuth app on Github](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)\r\n2. Use `http://localhost:3000/login/github/authorized` as your `Authorization callback URL`\r\n3. Create an `.env` file based on the previously generated client credentials:\r\n   ```env\r\n   GITHUB_OAUTH_CLIENT_ID=client id\r\n   GITHUB_OAUTH_CLIENT_SECRET=client secret\r\n   ```\r\n4. [bun.js](https://bun.sh/) automatically loads environment variables from `.env` files\r\n\r\nIf you are unsure which URL should be used as `Authorization callback URL` call `ctx.profiles()` without an argument to get all URLs of all registered OAuth 2.0 Profiles:\r\n\r\n```ts\r\napp\r\n  .use(auth)\r\n  .get('/', (ctx) => {\r\n    return ctx.profiles();\r\n  })\r\n  .listen(3000);\r\n```\r\n\r\n## Use predefined OAuth 2.0 providers\r\n\r\n```ts\r\nimport { azure, discord, github, ... } from '@bogeychan/kingworld-oauth2';\r\n```\r\n\r\n- All available providers are listed inside the [providers](./src/providers) folder.\r\n\r\n- Checkout the [examples](./examples) folder on github for further use cases such as the [sqlite module of bun.js](https://github.com/oven-sh/bun#bunsqlite-sqlite3-module).\r\n\r\n## Define your own OAuth 2.0 provider\r\n\r\n```ts\r\nimport oauth2, { TOAuth2Provider } from '@bogeychan/kingworld-oauth2';\r\n\r\nfunction myGithub(): TOAuth2Provider {\r\n  return {\r\n    clientId: 'YOUR_CLIENT_ID',\r\n    clientSecret: 'YOUR_CLIENT_SECRET',\r\n\r\n    auth: {\r\n      url: 'https://github.com/login/oauth/authorize',\r\n      params: {\r\n        allow_signup: true\r\n      }\r\n    },\r\n\r\n    token: {\r\n      url: 'https://github.com/login/oauth/access_token',\r\n      params: {}\r\n    }\r\n  };\r\n}\r\n\r\nconst auth = oauth2({\r\n  profiles: {\r\n    github: {\r\n      provider: myGithub(),\r\n      scope: ['user']\r\n    }\r\n  }\r\n  // ...\r\n});\r\n```\r\n\r\n## Author\r\n\r\n[bogeychan](https://github.com/bogeychan)\r\n\r\n## License\r\n\r\n[MIT](LICENSE)\r\n","readmeFilename":"README.md","license":"MIT"}