{"id":17309994,"url":"https://github.com/metafates/auth-jwt-server-task","last_synced_at":"2025-06-22T05:33:48.665Z","repository":{"id":188472736,"uuid":"678589771","full_name":"metafates/auth-jwt-server-task","owner":"metafates","description":"🔑 Simple jwt go server (test task)","archived":false,"fork":false,"pushed_at":"2023-08-15T12:34:29.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-08-15T14:10:47.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/metafates.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,"governance":null}},"created_at":"2023-08-14T23:00:35.000Z","updated_at":"2023-08-15T14:10:52.171Z","dependencies_parsed_at":"2023-08-15T14:22:30.347Z","dependency_job_id":null,"html_url":"https://github.com/metafates/auth-jwt-server-task","commit_stats":null,"previous_names":["metafates/auth-jwt-server-task"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/metafates/auth-jwt-server-task","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafates%2Fauth-jwt-server-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafates%2Fauth-jwt-server-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafates%2Fauth-jwt-server-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafates%2Fauth-jwt-server-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metafates","download_url":"https://codeload.github.com/metafates/auth-jwt-server-task/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafates%2Fauth-jwt-server-task/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261243140,"owners_count":23129585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-10-15T12:34:18.293Z","updated_at":"2025-06-22T05:33:43.653Z","avatar_url":"https://github.com/metafates.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go + JWT + Mongo\n\nAn example JWT auth server in Go with MongoDB.\n\n## Config\n\nThe server is configured via environment variables and with `.env` file.\nPredefined env variables has more priority than those from `.env` file (consider it as a sensible defaults).\n\nRefer to [`template.env`](./template.env) for more.\n\n```bash\n# Use this template like this\ncp template.env .env\n```\n\n## Run\n\n`docker-compose.yml` contains sensible env variables (such as `SERVER_JWT_SECRET`) just for demonstration purposes. You can run it without configuring anything.\n\n```bash\ndocker compose up\n```\n\n**It will spin up a...**\n\n- [mongo](https://hub.docker.com/_/mongo) - port `27017`; root username `root`; root password `example`\n- [mongo-express](https://hub.docker.com/_/mongo-express) (web ui for mongo) - port `8081` **Disabled**\n- JWT (from [Dockerfile](./Dockerfile)) server - port `1234`\n\n## Libraries used\n\n- [koanf](https://github.com/knadh/koanf) - for configuration management\n- [echo](https://github.com/labstack/echo) - web framework \n- [mongo-go-driver](https://github.com/mongodb/mongo-go-driver) - mongodb driver\n- [jwt-go](https://github.com/golang-jwt/jwt)\n\nAnd...\n\n- [oapi-codegen](https://github.com/deepmap/oapi-codegen) - generates server boilerplate from [openapi schema](./openapi.yaml).\n\n\n## Notes\n\nThe task requires hashing refresh tokens in DB with `bcrypt` but it can't operate\non passwords longer that 72 bytes which makes it unsuitable for JWT tokens, so\nI used `sha512` for that purpose\n\nhttps://stackoverflow.com/questions/64860460/store-the-hashed-jwt-token-in-the-database\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafates%2Fauth-jwt-server-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetafates%2Fauth-jwt-server-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafates%2Fauth-jwt-server-task/lists"}