#Not-Allowed

6 articles

16 Building HMAC Authentication Middleware Using `httprouter` in Golang

16 Building HMAC Authentication Middleware Using `httprouter` in Golang

In this article, we will discuss how to build an HMAC (Hash-based Message Authentication Code) authentication middleware using Go and the httprouter library. This middleware functions to authenticate HTTP requests based on an HMAC signature, ensuring data integrity and verifying that the data originates from a trusted source.

15 Creating Session-based Authentication Middleware Using `httprouter` in Golang

15 Creating Session-based Authentication Middleware Using `httprouter` in Golang

In this article, we will walk through the steps of building Session-based Authentication Middleware using Golang and the httprouter library. This middleware will help verify user sessions for incoming HTTP requests.

14 How to Build API Key Authentication Middleware with Unit Tests Using `httprouter` in Golang

14 How to Build API Key Authentication Middleware with Unit Tests Using `httprouter` in Golang

APIs (Application Programming Interfaces) play a crucial role in connecting various applications or services. To ensure your application remains secure and protected from unauthorized access, implementing authentication methods such as API Key Authentication is essential. In this article, we will go through a step-by-step guide on how to create API Key Authentication middleware using httprouter in Golang, along with unit tests for each function to ensure reliability.

12 Creating Static File Handler

12 Creating Static File Handler

In web applications, serving static files such as images, CSS files, or JavaScript from a public directory is often necessary. By using the julienschmidt/httprouter library, you can easily create a handler to serve static files. This article will walk you through the complete steps to implement a static file handler in a simple and efficient way using Golang.

11 Membuat Middleware Basic Authentication HTTP Router pada Golang

11 Membuat Middleware Basic Authentication HTTP Router pada Golang

Basic Authentication is a simple authentication method where the client sends credentials (username and password) in the header of each HTTP request. In this article, we will learn how to create Basic Authentication middleware in Golang using the httprouter library.

07 Handle Not Allowed Method

07 Handle Not Allowed Method

Understanding Method Not Allowed

When we use ServerMux, we cannot determine what HTTP Method we will use in the Handler. However, on the router that we are using, we can determine what HTTP method we want to use so that the client will send the appropriate method to the router that we have specified. If it does not comply with the provisions on the Router, a Method Not Allowed error will occur.