From 4aee694caadb6a336b9206d7450add6e82adb6be Mon Sep 17 00:00:00 2001 From: Itamar Yuran Date: Mon, 6 Jan 2025 09:32:45 +0100 Subject: [PATCH] changes, working --- docs/reference/auditing.md | 5 +---- pkg/api/helpers/upload.go | 17 +++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/reference/auditing.md b/docs/reference/auditing.md index cfebd88fbfd..bcf7ad1a3f6 100644 --- a/docs/reference/auditing.md +++ b/docs/reference/auditing.md @@ -17,10 +17,7 @@ lakeFS Enterprise {: .label .label-purple } {: .note} -> Auditing is only available for [lakeFS Cloud]({% link cloud/index.md %}). - -{: .warning } -> Please note, as of Jan 2024, the queryable interface within the lakeFS Cloud UI has been removed in favor of direct access to lakeFS audit logs. This document now describes how to set up and query this information using [AWS Glue](https://aws.amazon.com/glue/) as a reference. +> Auditing is only available for [lakeFS Cloud]({% link cloud/index.md %}) and [lakeFS Enterprise]({% link enterprise/index.md %}). The lakeFS audit log allows you to view all relevant user action information in a clear and organized table, including when the action was performed, by whom, and what it was they did. diff --git a/pkg/api/helpers/upload.go b/pkg/api/helpers/upload.go index 9ccbccd5d0e..59f1dcedce0 100644 --- a/pkg/api/helpers/upload.go +++ b/pkg/api/helpers/upload.go @@ -20,7 +20,6 @@ import ( "github.com/treeverse/lakefs/pkg/api/apigen" "github.com/treeverse/lakefs/pkg/api/apiutil" "github.com/treeverse/lakefs/pkg/block/azure" - "github.com/treeverse/lakefs/pkg/graveler" "github.com/treeverse/lakefs/pkg/httputil" "golang.org/x/sync/errgroup" ) @@ -384,16 +383,18 @@ func (u *presignUpload) uploadObject(ctx context.Context) (*apigen.ObjectStats, if err != nil { return nil, fmt.Errorf("link object to backing store: %w", err) } + if linkResp.JSON200 != nil { return linkResp.JSON200, nil } - if linkResp.JSON403 != nil { - return nil, graveler.ErrWriteToProtectedBranch - } - if linkResp.JSON409 != nil { - return nil, ErrConflict - } - return nil, fmt.Errorf("link object to backing store: %w (%s)", ErrRequestFailed, linkResp.Status()) + return nil, ResponseAsError(linkResp) + // if linkResp.JSON403 != nil { + // return nil, graveler.ErrWriteToProtectedBranch + // } + // if linkResp.JSON409 != nil { + // return nil, ErrConflict + // } + // return nil, fmt.Errorf("link object to backing store: %w (%s)", ErrRequestFailed, linkResp.Status()) } func (u *presignUpload) Upload(ctx context.Context) (*apigen.ObjectStats, error) {