bugfix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-04 13:04:17 +10:00
parent 747487b764
commit bf235cdebe
2 changed files with 8 additions and 8 deletions

View File

@@ -1,10 +1,10 @@
package controllers
import (
"smt/models"
"errors"
"log"
"net/http"
"smt/models"
"github.com/gin-gonic/gin"
)
@@ -23,7 +23,7 @@ func StoreSecret(c *gin.Context) {
var input StoreInput
if err := c.ShouldBindJSON(&input); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid JSON received : " + err.Error()})
return
}

12
main.go
View File

@@ -1,10 +1,6 @@
package main
import (
"smt/controllers"
"smt/middlewares"
"smt/models"
"smt/utils"
"context"
"crypto/tls"
"fmt"
@@ -12,6 +8,10 @@ import (
"net/http"
"os"
"os/signal"
"smt/controllers"
"smt/middlewares"
"smt/models"
"smt/utils"
"syscall"
"time"
@@ -147,8 +147,8 @@ func main() {
// Get secrets
protected := router.Group("/api/secret")
protected.Use(middlewares.JwtAuthMiddleware())
protected.GET("/retrieve", controllers.RetrieveSecret)
protected.GET("/retrieveMultiple", controllers.RetrieveMultpleSecrets)
protected.POST("/retrieve", controllers.RetrieveSecret)
protected.POST("/retrieveMultiple", controllers.RetrieveMultpleSecrets)
protected.POST("/store", controllers.StoreSecret)
protected.POST("/update", controllers.UpdateSecret)