TP-55555 | kafka fix

This commit is contained in:
varnit goyal
2024-10-22 13:04:56 +05:30
parent 396d28ed64
commit 2581c1b76a
7 changed files with 100 additions and 12 deletions

View File

@@ -1,10 +1,12 @@
package service
import (
"crypto/rand"
"cybertron/internal/client/aws"
"cybertron/models/db"
"cybertron/pkg/kafka/producer"
"cybertron/pkg/log"
"encoding/hex"
"math/big"
"net/http"
"strings"
@@ -46,6 +48,13 @@ func (pc *ProjectCreator) CreateProject(ctx *gin.Context) {
return
}
var uuidGenerated = uuid.New()
secret := make([]byte, 16)
_, err := rand.Read(secret)
if err != nil {
// handle error here
return
}
//converting uuid to all numbers since sentry only supports
//all digit project uuid
var i big.Int
@@ -58,6 +67,7 @@ func (pc *ProjectCreator) CreateProject(ctx *gin.Context) {
Team: projectBody.Team,
Icon: projectBody.Icon,
GithubUrl: projectBody.GithubUrl,
Secret: hex.EncodeToString(secret),
})
if result.Error != nil {