Build a full pipeline and deploy a Quarkus application to different environments with GitLab-CI

Photo by Sigmund on Unsplash

Introduction

The main purpose of this tutorial is to create and deploy step by step a simple application with Quarkus using GitLab-CI Pipeline and Heroku fully managed data services.

Prerequisites

We will not cover GraalVM nor docker through this article in order to focus on the pipeline and its different stages. However…


How to store properly JWT token in a browser

Photo by Tim J on Unsplash

Problem statement

On several applications, I noticed that JWT token is stored in local storage, session storage or through unsecured cookie. These weak techniques are vulnerable to XSS attack and token stealing (cf. session hijacking attack for more information)

Application Proof Of Concept

The application is split into two parts: frontend and backend folders:


“multicolored stair cube on grass field” by Julian Howard on Unsplash

Through my previous article, we explored how to extract conditionals into functions using simple and convenient use cases. However, more complicated situations won’t be addressed by simple extractions.

Problem statement

First, as an example, we’ll focus on evaluating simple Algebraic Expressions such as “1 + (6 + 5) * 8” or in a more general manner by respecting associativity and Operator Precedence:

a OP b OP c
(a OP b) OP c
a OP (b OP c)
  • OP stands for operator and a, b, c for…


Most of the time, having several conditionals inside a function and many levels of nested indentation make the code source so tedious to maintain, difficult to read and rapidly unclear — the pyramid of doom.

Example 1: Introducing assertion function

Let’s dive into the first example and see how to change the code structure in…


“spiral concrete staircase” by Tine Ivanič on Unsplash

Let’s start by an example to explain our problem. Suppose we have the following static method — static just for this example purpose — :

Elie Nehmé

Lead Web Application Architect. Passionate about refactoring, clean code, and building scalable solutions with simplicity.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store