{"id":21654424,"url":"https://github.com/hvalfangst/gin-api","last_synced_at":"2026-05-07T20:05:16.179Z","repository":{"id":197976670,"uuid":"675410303","full_name":"hvalfangst/gin-api","owner":"hvalfangst","description":"API programmed in Golang with the Gin framework providing CRUD endpoints for the domain of wine. Authentication and authorization is being handled by middleware.","archived":false,"fork":false,"pushed_at":"2024-01-13T22:51:21.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T06:25:09.478Z","etag":null,"topics":["authentication","authorization","gin-gonic","go-pg","golang","jwt","jwt-tokens","middlware"],"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/hvalfangst.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}},"created_at":"2023-08-06T20:20:25.000Z","updated_at":"2024-10-14T21:39:04.000Z","dependencies_parsed_at":"2024-01-13T23:44:33.307Z","dependency_job_id":"1da0a6e6-2312-4990-8cc8-dc43a9341a14","html_url":"https://github.com/hvalfangst/gin-api","commit_stats":null,"previous_names":["hvalfangst/gin-api-with-auth","hvalfangst/gin-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvalfangst%2Fgin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvalfangst%2Fgin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvalfangst%2Fgin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvalfangst%2Fgin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hvalfangst","download_url":"https://codeload.github.com/hvalfangst/gin-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554119,"owners_count":20471172,"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":["authentication","authorization","gin-gonic","go-pg","golang","jwt","jwt-tokens","middlware"],"created_at":"2024-11-25T08:27:50.180Z","updated_at":"2026-05-07T20:05:16.109Z","avatar_url":"https://github.com/hvalfangst.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gin API with auth middleware\n\n## Abstract\n\nThis repository contains a Go-based API developed using the Gin web framework. \nThe API features robust authentication and authorization mechanisms, allowing secure access to various endpoints. \nUsers can create accounts, log in, and interact with wine-related data while adhering to specific access rights.\n\n\n## Middleware\n\nThe API utilizes the following middleware functions:\n\n* Authenticate: Validate users by querying DB with basic auth headers contained in request. Used before 'login' handler in user context.\n\n* Authorize: Manages user access control based on JWT token claims. Used before handlers in wine context.\n    \n* LogTokenActivity: Logs user activity by creating token activity records for auditing purposes. Used after handlers in wine context.\n\n\n## User deletion goroutine\n\nA goroutine will be launched on startup which periodically (every 10 seconds) checks for users in the database who have been designated for removal. \nThat is, users which has the 'for_deletion' flag set to 'true.' \nIf any such users are found, they are deleted from the database. \n\n## Requirements\n\n* x86-64\n* Linux/Unix\n* [Golang](https://go.dev/)\n* [Docker](https://www.docker.com/products/docker-desktop/)\n\n## Startup\n\nThe script \"up\" provisions resources and starts our application by executing the following:\n```\n1. docker-compose -f docker/db/docker-compose.yml up -d\n2. go build -o gin_api_with_auth src/main.go\n3. ./gin_api_with_auth\n```\n\n## Shutdown\n\nThe script \"down\" deletes our dev and test databases by executing the following:\n```\n1. docker-compose -f db/docker-compose.yml down\n```\n\n## Postman Collection\n\nThe repository includes a Postman collection in the 'postman' directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhvalfangst%2Fgin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhvalfangst%2Fgin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhvalfangst%2Fgin-api/lists"}