Goodnessuc / AuthSystem

Some sort of auth (authentication and authorization) systems rollouts since I'd use them often

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AuthSystem 🥷🏽🔐 (WIP)

made-with-Go GoReportCard Go.mod version LICENSE

A Complete Backend Service with User Authentication and Authorization

Table of Contents

Description

This repository contains a backend service developed in GoLang that handles user authentication and authorization.

It includes functionalities like user registration, login, password reset, social authentication (e.g., GitHub, Google), and JWT authentication.

The service is designed with security in mind, implementing measures to prevent common attacks such as SQL injection, CSRF attacks, and brute force attacks.

Features

  • User Management
  • User Authentication
    • User Registration: Allows new users to create an account.
    • User Login: Allows existing users to log in.
    • User Logout: Allows users to log out.
    • RBAC: Implements Role-Based Access Control (RBAC) for users.
  • Session Management
    • Create Session: Creates a session when a user logs in.
    • Destroy Session: Destroys the session when a user logs out.
  • Password Management
    • Password Reset: Allows users to reset their password.
    • Password Hashing: Hashes passwords before storing them in the database.
  • Social Authentication: Allows users to log in using their social media accounts.
    • GitHub Authentication: Allows users to log in through GitHub
    • Google Authentication: Allows users to log in through Google
  • JWT Authentication: Uses JSON Web Tokens (JWT) for secure information transmission.
  • Security Measures
    • SQL Injection Prevention: Prevents SQL injection attacks.
    • CSRF Prevention: Prevents Cross-Site Request Forgery (CSRF) attacks.
    • Slowloris Prevention: Prevents Slowloris Attacks

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Go (version 1.15 or later)
  • Make

Installation and Setup

  1. Clone the repository
git clone https://github.com/goodnessuc/authsystem.git
  1. Change directory to the project folder
cd authsystem
  1. Install dependencies
make install
  1. Build the application
make build
  1. Run the application
./cmd/server/main.go

Docker Deployment

Prerequisites

Running with Docker Compose

  1. Ensure that Docker and Docker Compose are installed on your machine.
  2. Navigate to the project directory:
cd authsystem
  1. Build and run the application and its services using Docker Compose:
docker-compose up --build

To stop the services, simply run:

docker-compose down

Testing

To run the tests, run the following command:

make test

Technologies and Tools

Contributions

Contributions, issues, and feature requests are welcome!

License

MIT

About

Some sort of auth (authentication and authorization) systems rollouts since I'd use them often

License:MIT License


Languages

Language:Go 94.7%Language:HTML 2.8%Language:Makefile 1.2%Language:Dockerfile 1.2%