{"id":20463540,"url":"https://github.com/goniszewski/zdlnjs","last_synced_at":"2026-06-08T10:01:43.723Z","repository":{"id":48590612,"uuid":"386896894","full_name":"goniszewski/zdlnjs","owner":"goniszewski","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-19T09:28:48.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-09T12:26:58.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goniszewski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-17T09:40:33.000Z","updated_at":"2021-07-19T09:28:51.000Z","dependencies_parsed_at":"2022-09-04T11:42:44.810Z","dependency_job_id":null,"html_url":"https://github.com/goniszewski/zdlnjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goniszewski/zdlnjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goniszewski%2Fzdlnjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goniszewski%2Fzdlnjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goniszewski%2Fzdlnjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goniszewski%2Fzdlnjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goniszewski","download_url":"https://codeload.github.com/goniszewski/zdlnjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goniszewski%2Fzdlnjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34057158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T13:11:54.207Z","updated_at":"2026-06-08T10:01:43.707Z","avatar_url":"https://github.com/goniszewski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zdlnjs\n\nThis repository contains a **Node.js** server created with **Express** which allows mocked users to authorize, generate keypair, and encrypt requested (or default) file.\n\n## Prerequisites\n\n- Node.js =\u003e 12\n- npm (with yarn)\n\n## Setup\n\nFollow the below steps.\n\n### Clone the repo\n\n`git clone https://github.com/goniszewski/zdlnjs.git`\n\n`cd zdlnj`\n\n### Install required packages\n\nIn terminal execute `yarn` and wait for it to finalize the installation process.\n\n### Run server\n\nExecute command `yarn start`. `Server has started on port \u003cNUMBER\u003e` message should appear.\n\n## Endpoints\n\n### [POST] `/api/sign-in`\n\nAccepts JSON with user credentials (example below) and returns token.\n\n```json\n{\n  \"email\": \"\u003cEMAIL\u003e\",\n  \"password\": \"\u003cPASSWORD\u003e\"\n}\n```\n\nOutput:\n\n```json\n{\n  \"authToken\": \"\u003cTOKEN\u003e\"\n}\n```\n\n### [GET] `/api/generate-key-pair`\n\nReturns JSON response with pair of public and private keys (example below).\n\n```json\n{\n  \"privKey\": \"-----BEGIN ENCRYPTED PRIVATE KEY----- ...\",\n  \"pubKey\": \"-----BEGIN PUBLIC KEY---- ...\"\n}\n```\n\n### [GET] `/api/encrypt` (use above request first)\n\nReturns encrypted file's details (encrypted file and encrypted key) needed to decrypt the file (with `privKey`). Needs the keys to be previously generated for the user using `/api/generate-key-pair` endpoint.\n\n#### Optional\n\nThis endpoint accepts optional URL parameter `?url=` which requires a `http://...` link to a choosen (and publicly available) file.\n\n**NOTE:** if not used, the sample file's URL will be used (`http://www.africau.edu/images/default/sample.pdf` by default).\n\n## Config files\n\nUse default configuration (check `src/env/env.js`) or specify your own by creating a `.env` file based on provided `.env_sample` (located in `src/env/`).\n\n## Mocked users\n\nFor purpose of this server a mocked users data is provided. Head to `src/mockup-data/index.js` to see user defails (passwords are hashed).\n\nTo sign in to server use [POST] `/api/sign-in` endpoint, and use credentials for one of the users:\n\n#### User 1\n\n```json\n{\n  \"email\": \"test@test.pl\",\n  \"password\": \"test1\"\n}\n```\n\n#### User 2\n\n```json\n{\n  \"email\": \"test2@test.pl\",\n  \"password\": \"test2\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoniszewski%2Fzdlnjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoniszewski%2Fzdlnjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoniszewski%2Fzdlnjs/lists"}