{"id":27070294,"url":"https://github.com/michaelrodriguess/auth-service","last_synced_at":"2026-05-01T18:31:47.225Z","repository":{"id":286294491,"uuid":"960498469","full_name":"michaelrodriguess/auth-service","owner":"michaelrodriguess","description":"🔐 Application to handle with authentication of other applications","archived":false,"fork":false,"pushed_at":"2025-09-04T18:32:45.000Z","size":8804,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T05:46:15.981Z","etag":null,"topics":["authentication","bcrypt","gin","golang","jwt","oauth","oauth2"],"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/michaelrodriguess.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-04T14:37:28.000Z","updated_at":"2025-09-04T18:32:49.000Z","dependencies_parsed_at":"2025-04-09T19:58:39.596Z","dependency_job_id":"81e381d6-030b-4284-965b-23c09edab1e1","html_url":"https://github.com/michaelrodriguess/auth-service","commit_stats":null,"previous_names":["michaelrodriguess/auth_service","michaelrodriguess/auth-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelrodriguess/auth-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelrodriguess%2Fauth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelrodriguess%2Fauth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelrodriguess%2Fauth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelrodriguess%2Fauth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelrodriguess","download_url":"https://codeload.github.com/michaelrodriguess/auth-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelrodriguess%2Fauth-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["authentication","bcrypt","gin","golang","jwt","oauth","oauth2"],"created_at":"2025-04-05T22:20:21.687Z","updated_at":"2026-05-01T18:31:47.217Z","avatar_url":"https://github.com/michaelrodriguess.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Auth Service\n\nAn authentication service built with **Go (Golang)** that provides user registration, login, token validation, and JWT-based authentication. Ideal for applications that need a decoupled authentication module.\n\n## ✨ Features\n\n- ✅ User registration (`/register`)\n- ✅ User login (`/login`)\n- ✅ Authenticated user info (`/me`)\n- ✅ JWT generation and validation\n- ✅ Secure credential hashing\n- ✅ Middleware for protected routes\n- ✅ Docker and Makefile for easy setup\n- ✅ Password reset flow\n\n---\n\n## 🛍 Available Routes\n\n### `POST /register`\nRegisters a new user.\n\n**Example Body:**\n```json\n{\n  \"email\": \"email@domain.com\",\n  \"password\": \"123456\",\n  \"role\": \"admin\" or \"user\"\n}\n```\n\n**Response:**\n```json\n{\n  \"token\": \"0CT0LHOIvqzmRTY3aTU5-kkvkeukFiFjoqG5N9FOcFM......\",\n  \"email\": \"email@domain.com\",\n  \"role\": \"admin\" or \"user\"\n}\n```\n\n---\n\n### `POST /login`\nAuthenticates a user and returns a JWT.\n\n**Example Body:**\n```json\n{\n  \"email\": \"candango@dev.com\",\n  \"password\": \"123456\"\n}\n```\n\n**Response:**\n```json\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6...\"\n}\n```\n\n---\n\n### `GET /me`\nReturns authenticated user data.\n\n**Required Header:**\n```http\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n**Response:**\n```json\n{\n  \"id\": \"id\",\n  \"email\": \"email@domain.com\",\n  \"role\": \"admin\" or \"user\",\n  \"created_at\": timestamp,\n  \"updated_at\": timestamp\n}\n```\n\n---\n\n## Installation\n\n### Requirements\n\n- Go 1.18 or higher\n- Docker\n- Make (optional, for ease of use)\n\n\n## 🐳 Running MongoDB on Docker\n\n```bash\ndocker-compose up --build -d\n```\n\n---\n\n## 🛠️ Makefile Commands\n\nUseful commands for development:\n\n```bash\nmake run       # Run the app locally\nmake build     # Build the project\nmake test      # Run tests (when added)\nmake lint      # Run linter (when configured)\n```\n\n## Running the Go Server\n\n```bash\nmake run\n```\n\n---\n\n## ⚙️ Environment Variables\n\nCreate a `.env` file with the following content:\n\n```env\nPORT=8080\nDB_URI=mongodb://mongo:27017/authdb\nJWT_SECRET=your_secure_secret_key\n```\n\n---\n\n## 📌 Future Roadmap\n\n- [ ] Refresh token support\n- [ ] RBAC (Role-based access control)\n\n---\n\n## Developed by\n\nMichael Araujo Rodrigues — [@michaelrodriguess](https://github.com/michaelrodriguess)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelrodriguess%2Fauth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelrodriguess%2Fauth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelrodriguess%2Fauth-service/lists"}