{"id":15192138,"url":"https://github.com/martishin/auth-server","last_synced_at":"2026-02-07T01:31:55.528Z","repository":{"id":214708837,"uuid":"737173817","full_name":"martishin/auth-server","owner":"martishin","description":"Production-ready Go microservice example. Provides gRPC endpoints for managing JWT tokens and user's data","archived":false,"fork":false,"pushed_at":"2024-11-22T11:10:48.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-26T04:48:52.972Z","etag":null,"topics":["docker-compose","dockerfile","example-project","go","golang","golang-migrate","grpc","jwt","makefile","microservice","pgx","postgresql","protobuf","protocol-buffers","testcontainers","testify"],"latest_commit_sha":null,"homepage":"https://martishin.com/posts/project-auth-service","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/martishin.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-12-30T04:17:30.000Z","updated_at":"2024-11-22T11:10:52.000Z","dependencies_parsed_at":"2023-12-30T05:24:06.041Z","dependency_job_id":"8cc5e752-67a8-41ec-b25a-e28788f002c9","html_url":"https://github.com/martishin/auth-server","commit_stats":null,"previous_names":["tty-monkey/auth-server","data-tinker/auth-server","martishin/auth-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/martishin/auth-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martishin%2Fauth-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martishin%2Fauth-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martishin%2Fauth-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martishin%2Fauth-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martishin","download_url":"https://codeload.github.com/martishin/auth-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martishin%2Fauth-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29183964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"ssl_error","status_checked_at":"2026-02-07T00:35:01.758Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker-compose","dockerfile","example-project","go","golang","golang-migrate","grpc","jwt","makefile","microservice","pgx","postgresql","protobuf","protocol-buffers","testcontainers","testify"],"created_at":"2024-09-27T21:05:18.324Z","updated_at":"2026-02-07T01:31:55.495Z","avatar_url":"https://github.com/martishin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth Server\nAuthentication/Authorization microservice written in Go, provides gRPC endpoints for managing JWT tokens and user's data.\n\n## Running Locally\n* To run the server and PostgreSQL locally you can execute:   \n  `make run`\n* To stop them, run:  \n `make down`\n* **Alternatively** you can start the database and apply migrations by running:  \n  `make run-postgres DETACHED=true \u0026\u0026 make migrate`\n* And then start a server:   \n`go run cmd/sso/main.go --config=./configs/local.yaml`\n* API will be available at http://localhost:8080/\n\n## Testing\n* Run tests: `make test`\n\n## How to Connect From Another Service  \n* Fetch schemas from the [auth-server-schemas](https://github.com/tty-monkey/auth-server-schemas) repo:  \n  `go get github.com/tty-monkey/auth-server-schemas`\n* Create a client connection:\n```go\ncc, err := grpc.DialContext(context.Background(),\n\tnet.JoinHostPort(grpcHost, grpcPort),\n\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n)\n```\n* Initialize a client:\n```go\nauthClient := ssov1.NewAuthClient(cc)\n```\n* Make requests using the client:\n```go\nresp, err := authClient.Register(ctx, \u0026ssov1.RegisterRequest{\n  Email:    email,\n  Password: password,\n})\n```\n* Usage examples can be found in [e2e tests](https://github.com/tty-monkey/auth-server/blob/d6b9a6ddf5d998fc11b75273124f8597fc4bc1ae/tests/auth_register_login_test.go#L24-L24)\n\n## Endpoints\ngRPC protobuf schemas can be found [here](https://github.com/tty-monkey/auth-server-schemas).\nYou can import the schema file into [Postman](https://blog.postman.com/postman-now-supports-grpc/) and send requests from it.\n\n### Register\nRegisters a new user.\n\n- **Request: `RegisterRequest`**\n  - `email` (string): User's email address.\n  - `password` (string): User's password.\n\n- **Response: `RegisterResponse`**\n  - `user_id` (int64): Unique identifier of the registered user.\n\n### Login\nAuthenticates a user and provides a token.\n\n- **Request: `LoginRequest`**\n  - `email` (string): User's email address.\n  - `password` (string): User's password.\n  - `app_id` (int32): Application identifier.\n\n- **Response: `LoginResponse`**\n  - `token` (string): Authentication token for the user.\n\n### IsAdmin\nChecks if the user is an admin.\n\n- **Request**: `IsAdminRequest`\n  - `user_id` (int64): Unique identifier of the user.\n \n- **Response**: `IsAdminResponse`\n  - `is_admin` (bool): Indicates whether the user is an admin.\n\n## Technologies/Packages Used\n* [Go](https://go.dev/)\n* [PostgreSQL](https://www.postgresql.org/)\n* [Protocol Buffers](https://protobuf.dev/getting-started/gotutorial/)\n* [Docker](https://www.docker.com/)\n* [pgx](https://pkg.go.dev/github.com/jackc/pgx/v5)\n* [jwt](https://pkg.go.dev/github.com/golang-jwt/jwt)\n* [golang-migrate](https://pkg.go.dev/github.com/golang-migrate/migrate/v4)\n* [crypto](https://pkg.go.dev/golang.org/x/crypto)\n* [validator](https://pkg.go.dev/github.com/go-playground/validator/v10)\n* [testcontainers-go](https://pkg.go.dev/github.com/testcontainers/testcontainers-go)\n* [testify](https://pkg.go.dev/github.com/stretchr/testify)\n* [gofakeit](https://pkg.go.dev/github.com/brianvoe/gofakeit)\n* [cleanenv](https://pkg.go.dev/github.com/ilyakaznacheev/cleanenv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartishin%2Fauth-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartishin%2Fauth-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartishin%2Fauth-server/lists"}