No description
Find a file
Nicolas Boufidjeline 2e35c300e6 Merge branch '2-issue' into 'main'
make use of minicurl

Closes #2

See merge request h6n/users!2
2024-03-16 20:55:20 +00:00
cmd v1.0.0: health: add a simple healthcheck 2024-03-16 12:59:09 +01:00
config v1.0.0: dev: add dev and test conseil 2024-03-15 18:09:33 +01:00
internal v1.0.0: lint: fix lint error 2024-03-15 18:09:32 +01:00
lib v1.0.0: lint: remove io/utils 2024-03-15 18:09:33 +01:00
scripts v1.0.0: ci: add test 2024-03-15 18:09:30 +01:00
.gitignore v1.0.0: docker: add docker compose element 2024-03-15 18:09:29 +01:00
.gitlab-ci.yml v1.0.0: test: add lint 2024-03-15 18:09:31 +01:00
Dockerfile v1.0.0: health: add a simple healthcheck 2024-03-16 12:59:09 +01:00
go.mod v1.0.0: import: import code from accounts 2024-03-15 18:09:27 +01:00
go.sum v1.0.0: import: import code from accounts 2024-03-15 18:09:27 +01:00
LICENCE add LICENCE 2024-03-13 13:54:24 +01:00
README.md v1.0.0: dev: add dev and test conseil 2024-03-15 18:09:33 +01:00

User api management

The purpose to this project is permit the auth, register and settings of users.

This project is exclusevli develop in go, and validation lib are provided for go only.

Has this project is in H6N global project his requirement will first meet H6N needs.

Version

v0.0.0: version

Developpement

  • Golang
  • Docker

with docker compose

cat <<ENDFILE > docker-compose.yml
version: '3.1'

services:
  postgres:
    image: postgres:15.2-alpine3.17
    restart: unless-stopped
    environment:
      POSTGRES_USER: 'acc'
      POSTGRES_PASSWORD: 'totor'
      POSTGRES_DB: 'accounts'
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5
  users:
    build:
      context: .
      target: develop
    ports:
      - 127.0.0.1:2300:1222
    volumes:
      - .:/app:ro
      - ./docker/keys:/keys
    depends_on:
      postgres:
        condition: service_healthy
ENDFILE

cat config/db.sql|  docker compose exec -T postgres psql -U acc accounts

curl -s http://127.0.0.1:2300/ -H "Content-Type: application/json" -d "{\"username\":\"root@root.fr\",\"password\":\"root\"}" | jq -r '.token'