GithubHelp home page GithubHelp logo

devgalop / lrn.securelib Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 65 KB

Basic C# library to add security in API. This code allows to you add JWT token library, TOTP code and differents Encryption-Decryption methods.

License: MIT License

C# 98.91% Dockerfile 1.09%

lrn.securelib's Introduction

SecureLib

Github top language Github language count Repository size License Github issues Github forks Github stars

๐Ÿšง SecureLib ๐Ÿš€ Under construction... ๐Ÿšง


About ย  | ย  Features ย  | ย  Technologies ย  | ย  Requirements ย  | ย  Starting


๐ŸŽฏ About SecureLib

The Securelib is a simple C# library, developed with .Net 8 but fully compatible with .Net 6+, that provides you with the following features:

โœจ Features

โœ”๏ธ Aes Encryption/Decryption
โœ”๏ธ RSA Encryption/Decryption
โœ”๏ธ JWT Authentication tokens
โœ”๏ธ TOTP Code

๐Ÿš€ Technologies

The following tools were used in this project:

โœ… Requirements

Before starting ๐Ÿ, you need to have Git, DotNet 8 SDK and Docker installed.

๐Ÿ Starting

# Clone this project
$ git clone https://github.com/devgalop/lrn.securelib

# Access
$ cd {ROOT_FOLDER}

#Create own solution
dotnet new sln -n lrn.devgalop.securelib

# Assign projects to solution
dotnet sln add ./lrn.devgalop.securelib.Core/lrn.devgalop.securelib.Core.csproj
dotnet sln add ./lrn.devgalop.securelib.Infrastructure/lrn.devgalop.securelib.Infrastructure.csproj
dotnet sln add ./lrn.devgalop.securelib.Webapi/lrn.devgalop.securelib.Webapi.csproj
dotnet sln add ./lrn.devgalop.securelib.Tests/lrn.devgalop.securelib.Tests.csproj

# Install dependencies
$ dotnet restore ./lrn.devgalop.securelib.WebApi/lrn.devgalop.securelib.WebApi.csproj

# Build docker image
$ docker build -t securelib:development .

# Run docker-compose
$ docker-compose -f ./Docker/docker-compose-development.yml up -d

# The server will initialize in the <http://localhost:5200>

โ“ How to use it?

If you need to use any of the libraries in the project, follow the steps below:

  1. Select the folder(s) you want to use and import them into your code.
  2. Each library has an 'Extensions' folder where you can find all the necessary configurations for using the library. Call the method(s) you need in the Program.cs file.
  # Use Core Services
  builder.Services.AddCustomServices();
  
  # Use JWT Authentication tokens
  builder.Services.AddJwtSecurity();

  # Use Aes Encryption/Decryption methods
  builder.Services.AddAesEncryption();

  # Use Rsa Encryption/Decryption methods
  builder.Services.AddRSAEncryption();

  # Use TOTP codes
  # IMPORTANT: TOTP uses the AesEncryption library for encrypting its codes.
  builder.Services.AddTOTP();

  #IMPORTANT: If you need to use JWT tokens, configure the middleware as follows
  app.UseMiddleware<JwtAuthenticationMiddelware>();
  1. Every library uses environment variables. Add them to your project for correct library execution.For development enviroment you can use the launchSettings.json file.

Back to top

lrn.securelib's People

Contributors

devgalop avatar

Stargazers

Gio Arango avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.