Skip to content

A dedicated authentication microservice in the BerryTracer system, responsible for managing user authentication and authorization securely, leveraging Go and gRPC for robust and efficient user access control.

Notifications You must be signed in to change notification settings

BerryTracer/auth-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth Service

Overview

Auth Service is a crucial microservice in the BerryTracer project, designed for handling authentication and authorization for IoT devices and users. It utilizes gRPC for secure and efficient inter-service communication.

Features

  • Secure authentication for users and devices.
  • Authorization management.
  • Reliable gRPC communication for inter-service interactions.
  • MongoDB integration for persistent data storage.

Prerequisites

  • Go (version 1.15 or later is recommended).
  • An active MongoDB instance.
  • Other dependent services (like device-service) should be running and accessible (configured via environment variables).

Installation

Clone the Auth Service repository:

git clone https://github.com/BerryTracer/auth-service.git
cd auth-service

Set up the environment variables in a .env file:

MONGODB_URI=mongodb://root:password@localhost:27017/berrytracer
DEVICE_SERVICE_URL=localhost:50051

Running the Service

To run the Auth Service locally:

go run main.go

Docker Compose

To start MongoDB using Docker Compose:

docker-compose -f docker-compose.dev.db.yml up -d

Ensure the MongoDB URI in the .env file matches the configuration in the Docker Compose file.

Project Structure

  • /grpc: gRPC service definitions and protocol buffers.
  • /model: Data models related to authentication and authorization.
  • /repository: Database operations and data access layer.
  • /service: Business logic and service handlers for authentication.
  • main.go: The main entry point for the Auth Service.

Development

Build the project:

go build -o auth-service

Run tests:

go test ./...

About

A dedicated authentication microservice in the BerryTracer system, responsible for managing user authentication and authorization securely, leveraging Go and gRPC for robust and efficient user access control.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages