New setting delegated_qa to store QA managers

This commit is contained in:
nemunaire 2023-07-25 09:04:31 +02:00
parent e000778696
commit d2f409db7a
11 changed files with 148 additions and 20 deletions

View file

@ -37,6 +37,7 @@ func declareTeamsRoutes(router *gin.RouterGroup) {
c.JSON(http.StatusOK, teams)
})
router.GET("/teams-associations.json", allAssociations)
router.GET("/teams-binding", bindingTeams)
router.GET("/teams-nginx", nginxGenTeams)
router.POST("/disableinactiveteams", disableInactiveTeams)
@ -282,6 +283,31 @@ func bindingTeams(c *gin.Context) {
c.String(http.StatusOK, ret)
}
func allAssociations(c *gin.Context) {
teams, err := fic.GetTeams()
if err != nil {
log.Println("Unable to GetTeams:", err.Error())
c.AbortWithError(http.StatusInternalServerError, err)
return
}
var ret []string
for _, team := range teams {
assocs, err := pki.GetTeamAssociations(TeamsDir, team.Id)
if err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
}
for _, a := range assocs {
ret = append(ret, a)
}
}
c.JSON(http.StatusOK, ret)
}
func createTeam(c *gin.Context) {
var ut fic.Team
err := c.ShouldBindJSON(&ut)