{"_id":"@axel669/acheron","_rev":"4-80393ec1b3a38c1a4f7856b933f01a29","name":"@axel669/acheron","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@axel669/acheron","version":"0.1.0","keywords":[],"author":{"name":"Axel"},"license":"MIT","_id":"@axel669/acheron@0.1.0","maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"dist":{"shasum":"e10713cebeac4d12a1af9af07ea333dc51003d52","tarball":"https://registry.npmjs.org/@axel669/acheron/-/acheron-0.1.0.tgz","fileCount":16,"integrity":"sha512-qfs8njkRUhFhH/IStTXSO4HJlOXptdCnH06job+t2Gv5Zo6I0edoESPsCkO1XiMd7hiNjVgiUTo28IlQhj0VqA==","signatures":[{"sig":"MEUCICVB3CD3mBPagnzwnfhYvFvFqLj2LasxL6UahNcNmZLQAiEAvoSPQ3OL86gQWaLWxm/Eix6k1FzAL50MPu3+iUW/c2E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42014},"main":"lib/main.js","type":"module","gitHead":"c621672b3e15e76c860528e8d7b65d23be322f2f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"axel669","email":"axel@axel669.net"},"_npmVersion":"10.2.3","description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acheron_0.1.0_1727916922489_0.10366292248377063","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@axel669/acheron","version":"0.1.1","keywords":[],"author":{"name":"Axel"},"license":"MIT","_id":"@axel669/acheron@0.1.1","maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"homepage":"https://github.com/axel669/lib.acheron-cf#readme","bugs":{"url":"https://github.com/axel669/lib.acheron-cf/issues"},"dist":{"shasum":"62e2d1cb63408e02f5eb5678527af5c98e4156f9","tarball":"https://registry.npmjs.org/@axel669/acheron/-/acheron-0.1.1.tgz","fileCount":17,"integrity":"sha512-2hFNj3InQsroVdPec7OPKzvasEIBKku9HNncALOH4XhwmU689Cv0v7hBg8qFn4SxHGq6/g2762ybeFdzNVTKOw==","signatures":[{"sig":"MEUCIB2SpMHWxHMYRNjwQqduF0IaxwTSStQFbXw1ElLv6F24AiEAr33OqY3lLWCJ36BLsoYKIsQwcyvnOQ5/379p4r7/BFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42517},"main":"lib/main.js","type":"module","exports":{".":"./lib/main.js"},"gitHead":"577bcaeb0f8015b2a76efe835f440c4978b2101d","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"axel669","email":"axel@axel669.net"},"repository":{"url":"git+https://github.com/axel669/lib.acheron-cf.git","type":"git"},"_npmVersion":"10.2.3","description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acheron_0.1.1_1728419274596_0.2994831100545017","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@axel669/acheron","version":"0.1.2","keywords":[],"author":{"name":"Axel"},"license":"MIT","_id":"@axel669/acheron@0.1.2","maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"homepage":"https://github.com/axel669/lib.acheron-cf#readme","bugs":{"url":"https://github.com/axel669/lib.acheron-cf/issues"},"dist":{"shasum":"3e624677ac02e42a506f7064f0ebc7b413ed0f8e","tarball":"https://registry.npmjs.org/@axel669/acheron/-/acheron-0.1.2.tgz","fileCount":17,"integrity":"sha512-KnGWnsPLFeR5eDrgPt5GJUHVbMgQrLY9beuVDKgZL3RblByrcMSndXWDFWp+HWsUlc/4cMDlC55aRCj5u/h/3g==","signatures":[{"sig":"MEYCIQCdLO0kYjAbxgK2I+0H3yolRnEIInrzWTWKgNceAJp7uQIhAKUKBlOCApbsnWbSij4WTkkxeOgBec0ExYoUq9iNHfmo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42605},"main":"lib/main.js","type":"module","exports":{".":"./lib/main.js"},"gitHead":"5bcc56c53db751405ce9c53010d49c9a0fc3ea75","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"axel669","email":"axel@axel669.net"},"repository":{"url":"git+https://github.com/axel669/lib.acheron-cf.git","type":"git"},"_npmVersion":"10.2.3","description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acheron_0.1.2_1729127659890_0.3881329006726071","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@axel669/acheron","version":"0.1.3","keywords":[],"author":{"name":"Axel"},"license":"MIT","_id":"@axel669/acheron@0.1.3","maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"homepage":"https://github.com/axel669/lib.acheron-cf#readme","bugs":{"url":"https://github.com/axel669/lib.acheron-cf/issues"},"bin":{"ach-run":"cli/run.sh","ach-setup":"cli/install.js","ach-deploy":"cli/deploy.sh","ach-win-run":"cli/run.bat","ach-win-deploy":"cli/deploy.bat"},"dist":{"shasum":"81cdcffe349c611282846afad2f7d655efaa8b55","tarball":"https://registry.npmjs.org/@axel669/acheron/-/acheron-0.1.3.tgz","fileCount":22,"integrity":"sha512-864g04rUGG5R9QXRjFRPWmbaXmkjLCzZo1+dRTLZLtR70hQW7g83XLwmvGAjwqWpt9nivMTXc5/d5I+PbK2hSQ==","signatures":[{"sig":"MEUCICoXjdomDlv/6bxWc+ErrbcIqz+39e4iePcW2BAytzndAiEAvYSXBBYcZl9G0kACuwG3kUWn2dVWTGS60jXz6rEcDpY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44026},"main":"lib/main.js","type":"module","exports":{".":"./lib/main.js"},"gitHead":"ede3ee3979bb2c84750afff7b4a3b0ae665db9a0","scripts":{},"_npmUser":{"name":"axel669","email":"axel@axel669.net"},"repository":{"url":"git+https://github.com/axel669/lib.acheron-cf.git","type":"git"},"_npmVersion":"10.2.3","description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","directories":{},"_nodeVersion":"20.10.0","dependencies":{"execa":"^9.4.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acheron_0.1.3_1729207892162_0.9697840209286424","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@axel669/acheron","version":"0.1.4","description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","main":"lib/main.js","type":"module","repository":{"type":"git","url":"git+https://github.com/axel669/lib.acheron-cf.git"},"bin":{"ach-setup":"cli/install.js","ach-run":"cli/run.sh","ach-win-run":"cli/run.bat","ach-deploy":"cli/deploy.sh","ach-win-deploy":"cli/deploy.bat"},"scripts":{},"keywords":[],"author":{"name":"Axel"},"license":"MIT","exports":{".":"./lib/main.js"},"dependencies":{"execa":"^9.4.0"},"_id":"@axel669/acheron@0.1.4","gitHead":"4c996b19ef26b24e271a4cc8005414c4a11f6080","bugs":{"url":"https://github.com/axel669/lib.acheron-cf/issues"},"homepage":"https://github.com/axel669/lib.acheron-cf#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-qetXvqoP8xReE6YqCxc5HbK0ZMauR5QqjA6OJ/UTHShq+Gt0F8esaKWfihll1o15dj4MeCaCXeijCVtB59LTBA==","shasum":"e36c89fd93bfbacacaa7c621086a9ab8e6f06649","tarball":"https://registry.npmjs.org/@axel669/acheron/-/acheron-0.1.4.tgz","fileCount":23,"unpackedSize":44898,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvkIUfgqwVekgDwiCWs9An6pOPdudUqexeTZXVnXVDjwIhAOww5s4cPNdYkXthOaaM6enNYFIbhYXkuv98PJINnzyd"}]},"_npmUser":{"name":"axel669","email":"axel@axel669.net"},"directories":{},"maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/acheron_0.1.4_1729732709736_0.4401999444491784"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-03T00:55:22.402Z","modified":"2024-10-24T01:18:30.097Z","0.1.0":"2024-10-03T00:55:22.704Z","0.1.1":"2024-10-08T20:27:54.830Z","0.1.2":"2024-10-17T01:14:20.246Z","0.1.3":"2024-10-17T23:31:32.351Z","0.1.4":"2024-10-24T01:18:29.952Z"},"bugs":{"url":"https://github.com/axel669/lib.acheron-cf/issues"},"author":{"name":"Axel"},"license":"MIT","homepage":"https://github.com/axel669/lib.acheron-cf#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/axel669/lib.acheron-cf.git"},"description":"An auth system built for use with cloudflare workers and pages functions that does all of the annoying logic and validation for various authentication methods.","maintainers":[{"name":"axel669","email":"axel@axel669.net"}],"readme":"# Acheron\nAn auth system built for use with cloudflare workers and pages functions that\ndoes all of the annoying logic and validation for various authentication\nmethods.\n\n[Change Log](./changelog.md)\n\n## Installation\n```bash\npnpm add @axel669/acheron\n```\n\n### Installing the Worker\nIn order to use the auth functions provided in the library, there needs to be a\ncloudflare worker deployed to the same account that will be bound to the calling\ncode. The library ships with a copy of the worker (minus installed packages),\nbut the worker can also be pulled from the repo and deployed.\n\n> The worker can also be run locally to test things without deploying to CF.\n> The worker has a single env var (`log_level`) that can be set if more\n> information about the worker is required. Values are: `\"debug\", \"info\", \"warn\"\n> \"error\", \"none\"`. If not set, it will default to `\"error\"`. If set to\n> `\"debug\"` the worker will log auth config and token details without masking,\n> only use this option running locally if you are seeing errors.\n\nSteps:\n- Install the worker dependencies\n    - The library includes an npm bin script to install deps called `ach-setup`\n    > The worker has a package.json file that is ready to go for this\n- Check the wrangler configuration\n    - The library includes an npm bin script to run the worker. On windows\n        machines use `ach-win-run`, and for other systems use `ach-run`\n    > The worker wrangler.toml has a config that is ready to be deployed, but\n    > any of the settings can be changed if needed, just be sure to note what\n    > changes are made when binding to it\n- Deploy the worker using wrangler\n    - The library includes an npm bin script to deploy the worker. On windows\n        machines use `ach-win-deploy`, and for other systems use `ach-deploy`\n\n## Usage\nThe acheron worker is not made to be called directly, instead use one of the\nlibrary functions for the corresponding auth type, as the auth functions have\nadditional logic to handle being inside an application. The auth functions\nshould be used as middleware (run before route code) to ensure that auth is\nhandled before route code needs to use its results. To see specifics on how to\nuse the auth functions, check out the examples folder in the repo.\n\n> In order for acheron to route properly, your app will need to have a route for\n> the login methods to respond to (`/login/<auth type>`), as well as a logout\n> route (`/logout`).\n\n### Env Variables\nThese env vars need to be configured in the worker/pages func that is calling\nthe auth. That allows multiple applications to reuse the library worker, since\nit doesn't need to be configured for every application.\n\n_NOTE: All variables that deal with origins must include the protocol + domain\n(ex: https://company.okta.com, http://localhost:45067)._\n\n#### Required for All Auth\n- jwt_secret\n    > The secret that will be used to sign and verify the JWTs used\n    > by the library for auth\n\n#### Optional for All Auth\n- app_origin\n    > If set, the library will use this origin for building the redirect URLs\n    > that are required for the auth processes. If not set, the library will use\n    > the origin the application is deployed on. The main use of this is for\n    > testing workers locally that have cf routes set, as wrangler will use that\n    > origin internally for local dev, even though the code is running on\n    > the localhost domain.\n- login_dest\n    > If set, the library will redirect to this pathname on the app origin when\n    > a user successfully logs in (logging in and directing to a dashboard for\n    > example). If not set, the library will redirect to the top level of the\n    > app origin.\n\n#### Github Variables\n- github_client_id\n- github_client_secret\n#### Twitch Variables\n- twitch_client_id\n- twitch_client_secret\n#### Auth0 Variables\n- auth0_client_id\n- auth0_client_secret\n- auth0_origin\n#### Okta Variables\n- okta_client_id\n- okta_client_secret\n- okta_origin\n\n## Examples\nSee the examples folder of the repo for usage in a few scenarios.\n\nThe pages and worker examples show basic middlware usage, the hono-worker\nexample shows how the auth result can be used to customize where login is\nenforced in an app.\n","readmeFilename":"README.md"}