Sign inSign up

accent/grpc-service-auth

By accent

Updated 1 day ago

Image
2

8.0K

accent/grpc-service-auth repository overview

Auth Service

Public repo can be found here.

An authentication service that implements:

  • BearerToken
  • RevokeBearerToken
  • Register
  • ResetPassword
  • ResetPasswordToken
  • User
  • UpdateUser
  • VerifyUser
  • VerifyUserToken
  • UserTypes
  • Scopes

Example user:

{
  "id": "3f4b2b87-d7b1-4b9f-b207-ae00b112382f",
  "email": "[email protected]",
  "first_name": "Some",
  "last_name": "One",
  "user_type": {
    "name": "user",
    "scopes": [
      "write",
      "read"
    ]
  },
  "is_active": true,
  "is_verified": true
}

Arguments

Command line arguments the service accepts:

ArgumentDescription
-h, --helpShow help message and exit
-reflection, --reflectionUsed to allow gRPC Web UI tools to connect
-port, --portPort to bind to
-bearer-duration, --bearer-durationDuration of bearer tokens (e.g. 8h)
-reset-duration, --reset-durationDuration of reset tokens (e.g. 1h)
-verify-duration, --verify-durationDuration of verify tokens (e.g. 1h)
-migrations, --migrationsMigrations, "on", "dry-run" or "off", dry run will exit, default "on"

Environment

A list of the environment variables:

VariableDescription
DB_DNSPostgres dns url e.g. postgresql://user:pass@host:5432/db?sslmode=disable

Usage

pull:

docker pull accent/grpc-service-auth:latest

compose:

version: '3.9'

services:
  auth:
    image: accent/grpc-service-auth:latest
    environment:
      DB_DNS: postgresql://postgres:password@db:5432/appdb
    command:
      - -bearer-duration=8h

health check Is only available from v0.0.5:

version: '3.9'

services:
  ...
  auth:
    image: accent/grpc-service-auth:latest
    environment:
      DB_DNS: postgresql://postgres:password@db:5432/appdb
  app:
    depends_on:
      auth:
        condition: service_healthy

if you specify a different port other than 50051 change the health check:

version: '3.9'

services:
  ...
  auth:
    image: accent/grpc-service-auth:latest
    environment:
      DB_DNS: postgresql://postgres:password@db:5432/appdb
    healthcheck:
      test: [ "CMD", "/usr/local/bin/grpc_health_probe", "-addr=:50052" ]
      interval: 2s
      timeout: 2s
      retries: 10
    command:
      - -port=50052

Tag summary

Content type

Image

Digest

sha256:6afcff07f

Size

90.5 MB

Last updated

1 day ago

docker pull accent/grpc-service-auth