Skip to content

Commit 4a552ae

Browse files
authored
Fixes (#1264)
1 parent ded7b95 commit 4a552ae

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

gateway/modules/crud/crud.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func splitConnectionString(connection string) (string, bool) {
205205
func (m *Module) GetDBType(dbAlias string) (string, error) {
206206
dbAlias = strings.TrimPrefix(dbAlias, "sql-")
207207
if dbAlias != m.alias {
208-
return "", helpers.Logger.LogError(helpers.GetRequestID(context.TODO()), fmt.Sprintf("Cannot get db type as invalid db alias (%s) provided", dbAlias), nil, nil)
208+
return "", fmt.Errorf("cannot get db type as invalid db alias (%s) provided", dbAlias)
209209
}
210210
return m.dbType, nil
211211
}

gateway/modules/filestore/amazons3/read.go

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ func (a *AmazonS3) ListDir(ctx context.Context, req *model.ListFilesRequest) ([]
4141
return []*model.ListFilesResponse{}, nil
4242
}
4343

44-
if req.Path != "" {
45-
resp.Contents = resp.Contents[1:]
46-
}
4744
result := make([]*model.ListFilesResponse, 0)
4845

4946
for _, key := range resp.Contents {

gateway/server/handlers/config_auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func HandleGetUserManagement(adminMan *admin.Manager, syncMan *syncman.Manager)
7272
defer cancel()
7373

7474
// Check if the request is authorised
75-
reqParams, err := adminMan.IsTokenValid(ctx, token, "auth-provider", "modify", map[string]string{"project": projectID, "id": providerID})
75+
reqParams, err := adminMan.IsTokenValid(ctx, token, "auth-provider", "read", map[string]string{"project": projectID, "id": providerID})
7676
if err != nil {
7777
_ = helpers.Response.SendErrorResponse(ctx, w, http.StatusUnauthorized, err.Error())
7878
return

gateway/server/handlers/config_crud.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ func HandleInspectCollectionSchema(adminMan *admin.Manager, modules *modules.Mod
557557
defer cancel()
558558

559559
// Check if the request is authorised
560-
reqParams, err := adminMan.IsTokenValid(ctx, token, "db-schema", "read", map[string]string{"project": projectID, "db": dbAlias, "col": col})
560+
reqParams, err := adminMan.IsTokenValid(ctx, token, "db-schema", "modify", map[string]string{"project": projectID, "db": dbAlias, "col": col})
561561
if err != nil {
562562
_ = helpers.Response.SendErrorResponse(ctx, w, http.StatusUnauthorized, err.Error())
563563
return

0 commit comments

Comments
 (0)