Skip to content

Commit

Permalink
Merge branch 'master' into fix/gitops
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsoumya committed Jul 31, 2023
2 parents 2d4a452 + 28f9079 commit 63dfeb3
Show file tree
Hide file tree
Showing 7 changed files with 1,306 additions and 12 deletions.
10 changes: 5 additions & 5 deletions chaoscenter/authentication/api/handlers/rest/user_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ func LoginUser(service services.ApplicationService) gin.HandlerFunc {
}

c.JSON(200, gin.H{
"access_token": token,
"project_id": defaultProject,
"project_role": entities.RoleOwner,
"expires_in": expiryTime,
"type": "Bearer",
"accessToken": token,
"projectID": defaultProject,
"projectRole": entities.RoleOwner,
"expiresIn": expiryTime,
"type": "Bearer",
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/authentication/api/presenter/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/litmuschaos/litmus/chaoscenter/authentication/pkg/utils"
// ErrorResponseStruct defines the structure for error responses
type ErrorResponseStruct struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
ErrorDescription string `json:"errorDescription"`
}

// CreateErrorResponse is a helper function that creates a ErrorResponseStruct
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/authentication/api/routes/user_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func UserRouter(router *gin.Engine, service services.ApplicationService) {
router.Use(middleware.JwtMiddleware())
router.POST("/update/password", rest.UpdatePassword(service))
router.POST("/reset/password", rest.ResetPassword(service))
router.POST("/create", rest.CreateUser(service))
router.POST("/create_user", rest.CreateUser(service))
router.POST("/update/details", rest.UpdateUser(service))
router.GET("/getUser/:uid", rest.GetUser(service))
router.GET("/get_user/:uid", rest.GetUser(service))
router.GET("/users", rest.FetchUsers(service))
router.GET("/invite_users/:project_id", rest.InviteUsers(service))
router.POST("/update/state", rest.UpdateUserState(service))
Expand Down
3 changes: 3 additions & 0 deletions chaoscenter/authentication/pkg/project/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ func (r repository) GetProjectMembers(projectID string, state string) ([]*entiti
return nil, err
}

if len(res) <= 0 {
return nil, nil
}
return res[0].Members, nil
}

Expand Down
2 changes: 0 additions & 2 deletions chaoscenter/graphql/server/pkg/gitops/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,11 @@ func (c GitConfig) GetChanges() (string, map[string]int, error) {
}
}
visited := map[string]int{}
lastFile := ""

commitIter, err := r.Log(&git.LogOptions{
PathFilter: func(file string) bool {
if (strings.HasSuffix(path, "/") && strings.HasPrefix(file, path)) || (path == file) {
visited[file] += 1
lastFile = file
return true
}
return false
Expand Down
2 changes: 0 additions & 2 deletions litmus-portal/graphql-server/pkg/gitops/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,11 @@ func (c GitConfig) GetChanges() (string, map[string]int, error) {
}
}
visited := map[string]int{}
lastFile := ""

commitIter, err := r.Log(&git.LogOptions{
PathFilter: func(file string) bool {
if (strings.HasSuffix(path, "/") && strings.HasPrefix(file, path)) || (path == file) {
visited[file] += 1
lastFile = file
return true
}
return false
Expand Down
Loading

0 comments on commit 63dfeb3

Please sign in to comment.