Categorygithub.com/n0bode/go-cognito
modulepackage
1.0.4
Repository: https://github.com/n0bode/go-cognito.git
Documentation: pkg.go.dev

# README

Middleware cognito para apis(golang)

Uso

Para utilizar o middleware basta coloca-lo antes de chamar a função da rota

package main

import (
	cognito "github.com/n0bode/cognito-golang"
	"net/http"
	"log"
)

func main(){
	cog := cognito.New(
		Region:     "us-west-2",
		UserPoolID: "",
		AppID:      "",
	)
	
	http.HandleFunc("/", cog.Handler(func(w http.ResponseWriter, r *http.Request){
		w.Write([]byte("Hello World"))
	})

	log.Println("Ouvindo na porta :8000")
	if err := http.ListenAndServe(":8000", nil); err != nil{
		log.Error(err)
	}
}

# Functions

GetAuthHeader gets from header authorization field.
No description provided by the author
New creates a cognito middleware.

# Variables

No description provided by the author

# Structs

Cognito struct contains AWS info for cognito.
Config struct for config for Cognito AWS.
RespCognito struct refers cognito list KIDs.

# Type aliases

No description provided by the author
No description provided by the author