Title: Proposal: protect docs with user authentication · Issue #2011 · docsifyjs/docsify · GitHub
Open Graph Title: Proposal: protect docs with user authentication · Issue #2011 · docsifyjs/docsify
X Title: Proposal: protect docs with user authentication · Issue #2011 · docsifyjs/docsify
Description: Feature request Protect docsify static pages with user authentication from any 3rd party identity provider (i.e. Github Auth). What problem does this feature solve? Store and serve static docs in free services like Github Pages, while ha...
Open Graph Description: Feature request Protect docsify static pages with user authentication from any 3rd party identity provider (i.e. Github Auth). What problem does this feature solve? Store and serve static docs in f...
X Description: Feature request Protect docsify static pages with user authentication from any 3rd party identity provider (i.e. Github Auth). What problem does this feature solve? Store and serve static docs in f...
Opengraph URL: https://github.com/docsifyjs/docsify/issues/2011
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: protect docs with user authentication","articleBody":"\u003c!-- Please don't delete this template or we'll close your issue -->\r\n\u003c!-- Please use English language -->\r\n\u003c!-- Before creating an issue please make sure you are using the latest version of Docsify. -->\r\n\u003c!-- Please ask questions on StackOverflow 👉 https://stackoverflow.com/questions/ask?tags=docsify -->\r\n\r\n## Feature request\r\nProtect docsify static pages with user authentication from any 3rd party identity provider (i.e. Github Auth).\r\n\r\n#### What problem does this feature solve?\r\nStore and serve static docs in free services like Github Pages, while having user authentication. Github only allows that in their paid layer. The proposed method would work with any hosting and identity provider.\r\n\r\n\r\n#### What does the proposed API look like?\r\n1) Create an auth.json file in your root folder with these contents:\r\n```\r\n{\r\n auth: \"github\",\r\n repo: \"private-repo-id\"\r\n}\r\n```\r\n\r\n2) In your docsify docs root folder, run `npx docsify-protect-docs`\r\n\r\n#### How should this be implemented in your opinion?\r\n\r\n1) **Initialization**:\r\nThe command `npx docsify-protect-docs`, when called without arguments, will create a git pre-push or pre-commit hook that will automatically call `npx docsify-protect-docs now` (notice argument **now**).\r\n\r\n2) **Automated workflow**:\r\nWith argument `now`, the script will create a \"./docs/protected\" folder, with all the encrypted markdown files and with a modified version of index.html that shows a Login form and connects to Github Auth for auth.\r\n\r\n3) **On-the-fly decryption**:\r\nThe decryption key is obtained from the private Github repo, where it was previously placed by `npx docsify-protect-docs now`. In order to access this key, we need to require read access to that repo. The user will grant it as part of his github auth login flow.\r\n\r\n**Security**:\r\nOnly users with access to the private repo would be able to able to read the docs. Which is fine since they can read the plain markdown anyway.\r\n\r\n**Utility**\r\nRight now the method would be specially useful for developers, as they would need a Github ID (easily extended for Gitlab and other git providers). For non-developers, other identity providers may be added, but they would need to somehow provide access to a shared decryption key. \r\n\r\n#### Are you willing to work on this yourself?\r\nMaybe, if I get support so that I don't have to learn all the Docsify codebase.\r\n\r\n","author":{"url":"https://github.com/jlcastillo","@type":"Person","name":"jlcastillo"},"datePublished":"2023-04-02T09:40:33Z","url":"https://github.com/docsifyjs/docsify/issues/2011"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d13ac8b-d44d-7eb1-7213-f1401a8e2150 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D0C:1DF231:2799A:35545:6AFD36F8 |
| html-safe-nonce | 3180a471d7738eb974c0ffcf4c8d7cff672ed56f82059de4dfa4db79f76d3f64 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDBDOjFERjIzMToyNzk5QTozNTU0NTo2QUZEMzZGOCIsInZpc2l0b3JfaWQiOiI0NDg0Nzk0ODgzNjU5MDg1NTYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b78bc6b36566ec39828548a36728f6db9a8339039c363a32a2398a19cab711f1 |
| hovercard-subject-tag | issue:1650879278 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docsifyjs/docsify/2011/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c581a477bcfc386bcd9624ce0a9c8ff5b3e9c5b44276e99694716d37223e662/docsifyjs/docsify/issues/2011 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c581a477bcfc386bcd9624ce0a9c8ff5b3e9c5b44276e99694716d37223e662/docsifyjs/docsify/issues/2011 |
| og:image:alt | Feature request Protect docsify static pages with user authentication from any 3rd party identity provider (i.e. Github Auth). What problem does this feature solve? Store and serve static docs in f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlcastillo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 |
| turbo-cache-control | no-preview |
| go-import | github.com/docsifyjs/docsify git https://github.com/docsifyjs/docsify.git |
| octolytics-dimension-user_id | 40133106 |
| octolytics-dimension-user_login | docsifyjs |
| octolytics-dimension-repository_id | 74260508 |
| octolytics-dimension-repository_nwo | docsifyjs/docsify |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 74260508 |
| octolytics-dimension-repository_network_root_nwo | docsifyjs/docsify |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 941021edf0c2ec58298f4a2c8f27ae507d129c92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width