Msg is gRPC-based backend for messaging written in golang.

Msg

Msg is gRPC-based backend for messaging written in golang.

Goals

Future goals:

  • Implement message service which will allow users to send messages to chat rooms
  • Unit tests and github workflow

Already achieved:

  • Authentication and authorization with JWT and refresh tokens
  • PostgreSQL as persistance storage
  • gRPC and protobuf service creation with help of Makefile and well-prepared code organization

Compiling proto messages

Run

make proto-c

For that to work you need to install

go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

Env variables

Create .env file and put it in a project root

.env file has to contain

HOST="192.168.0.2:1234"

JWT_SECRET="s3cr3t"
JWT_DURATION_MIN=15
REFRESH_DURATION_DAYS=90


POSTGRES_DB="dbname"
POSTGRES_USER="dbuser"
POSTGRES_PASSWORD="dbuserpassword"

PGADMIN_DEFAULT_EMAIL="email"
PGADMIN_DEFAULT_PASSWORD="password"
PGADMIN_CONFIG_SERVER_MODE="False"

Run

$ docker-compose up -d
Similar Resources

Example of a simple application which is powered by a third-party oAuth 2.0 server for it's authentication / authorization. Written in Golang.

go mod init github.com/bartmika/osin-thirdparty-example go get github.com/spf13/cobra go get github.com/openshift/osin go get github.com/openshift/osi

Jan 4, 2022

A Go library for doing header-based OAuth over HTTP or HTTPS.

Installation goinstall github.com/alloy-d/goauth Usage import ( "github.com/alloy-d/goauth" "os" ) func someFuncThatDoesStuffWithOAuth() (er

Sep 2, 2020

Provides AWS STS credentials based on Google Apps SAML SSO auth with interactive GUI support

Provides AWS STS credentials based on Google Apps SAML SSO auth with interactive GUI support

What's this This command-line tool allows you to acquire AWS temporary (STS) credentials using Google Apps as a federated (Single Sign-On, or SSO) pro

Sep 29, 2022

RBAC scaffolding based on Gin + Gorm+ Casbin + Wire

RBAC scaffolding based on Gin + Gorm+ Casbin + Wire

Gin Admin 基于 GIN + GORM + CASBIN + WIRE 实现的RBAC权限管理脚手架,目的是提供一套轻量的中后台开发框架,方便、快速的完成业务需求的开发。 特性 遵循 RESTful API 设计规范 & 基于接口的编程规范 基于 GIN 框架,提供了丰富的中间件支持(JWT

Dec 28, 2022

Role Based Access Control (RBAC) with database persistence

Authority Role Based Access Control (RBAC) Go package with database persistence Install First get authority go get github.com/harranali/authority Next

Dec 8, 2022

Small Lambda function which performs a Aws:Sts:AssumeRole based on the presented JWT-Token

About This implements a AWS Lambda handler which takes a JWT-Token, validates it and then performs a Aws:Sts:AssumeRole based on preconfigured rules.

Aug 8, 2022

Generate K8s RBAC policies based on e2e test runs

rbac-audit Have you ever wondered whether your controller actually needs all the permissions it has granted to it? Wonder no more! This repo contains

Aug 2, 2021

Casdoor is a UI-first centralized authentication / Single-Sign-On (SSO) platform based on OAuth 2.0 / OIDC.

A UI-first centralized authentication / Single-Sign-On (SSO) platform based on OAuth 2.0 / OIDC

Dec 29, 2022

BK-IAM is a centralized permission management service provided by The Tencent BlueKing; based on ABAC

(English Documents Available) Overview 蓝鲸权限中心(BK-IAM)是蓝鲸智云提供的集中权限管理服务,支持基于蓝鲸开发框架的SaaS和企业第三方系统的权限控制接入,以及支持细粒度的权限管理。 架构设计 代码目录 Features 蓝鲸权限中心是基于 ABAC 强

Nov 16, 2022
Comments
  • Unable to test requests via Postman-like software

    Unable to test requests via Postman-like software

    Hi, there's a problem with BloomRPC, Insomnia and other Postman-like software with grpc support

    Main problem is that such soft doesn't know how to resolve external imports, as a result of which it swears at the lack of models from the model.proto file

    Error message:

    Error while importing protos
    no such Type or Enum 'model.Message' in Type .message.MessageDelivery
    
  • [Question] Fate of this project

    [Question] Fate of this project

    Hi, thanks for such a cool example, it really helps to learn a lot

    I see that the maintainer responds to issues fairly quickly

    Unfortunately, there have been no commits to the project for three months and I am interested in the fate of this project - is it frozen or completely abandoned?

    I really hope that the development hasn't been abandoned, cuz it really cool project

    Thank you for your reply!

  • [Question] Expired JWT on active GetMessages stream

    [Question] Expired JWT on active GetMessages stream

    Hi, what we should do if our message.MessageService.GetMessage stream returned 16 UNAUTHENTICATED: JWT is expired

    I mean, if we need reconnect to stream every ${JWT_DURATION_MIN} minutes, then that means that we will lose one message every 15 minutes when our stream will signal us that our token has expired? And we will send auth.AuthService.Refresh request, and then reconnect to stream?

    Doesn't this's overhead solution? I mean, i can't understand this algorithm well, cuz that means we will have a lot of requests to our server

    Will be glad to hear your opinion to that question.

Identity - An OAuth2 identity provider that operates over gRPC

Otter Social > Identity Provider An OAuth2 identity provider that operates over

May 2, 2022
backend implementation demonstration in go with JWT, MongoDB and etc.

backend implementation demonstration in go with JWT, MongoDB and etc.

Nov 19, 2022
Backend Development Rest Api Project for book management system. Used Features like redis, jwt token,validation and authorization.

Golang-restapi-project Simple Rest Api Project with Authentication, Autherization,Validation and Connection with redis File Structure ├── cache │ ├──

May 25, 2022
Time-Based One-Time Password (TOTP) and HMAC-Based One-Time Password (HOTP) library for Go.

otpgo HMAC-Based and Time-Based One-Time Password (HOTP and TOTP) library for Go. Implements RFC 4226 and RFC 6238. Contents Supported Operations Read

Dec 19, 2022
Go based HTTP server with 2FA based on OTP (One-Time Password) manager like Google Authenticator

Go based HTTP server with 2FA based on OTP (One-Time Password) manager like Goog

Aug 21, 2022
HMAC-based JWT written in Go

JWT JSON Web Tokens JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. Usage of jwt:

Nov 16, 2021
goRBAC provides a lightweight role-based access control (RBAC) implementation in Golang.

goRBAC goRBAC provides a lightweight role-based access control implementation in Golang. For the purposes of this package: * an identity has one or mo

Dec 29, 2022
Golang based User creation and Management application. GORM, Fiber, JWT

User Creation and Management app (BACK-END) Auth Features: Create Clients (regular password + 6 one-time passwords + (optional) QR code and Secret for

Dec 2, 2022
A standalone, specification-compliant, OAuth2 server written in Golang.
A standalone, specification-compliant,  OAuth2 server written in Golang.

Go OAuth2 Server This service implements OAuth 2.0 specification. Excerpts from the specification are included in this README file to describe differe

Dec 28, 2022
Example App written in Golang for provide AuthZ/N using JWT

RCK Auth Application Example App written in Golang for provide Authentication & Authorization using Json Web Tokens. Run with Docker / Podman Run a Po

Feb 25, 2022