Skip to content

Commit

Permalink
*: Add partial support for GetBucketLifecycle operation
Browse files Browse the repository at this point in the history
Closes #1049.

Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Jan 27, 2025
1 parent 2e8ec06 commit e7921e2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This document outlines major changes between releases.
### Added

### Changed
- GetBucketLifecycle operation now partially supported. It always returns NoSuchLifecycleConfiguration error (#1049)

### Fixed

Expand Down
17 changes: 17 additions & 0 deletions api/handler/lifecycle.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package handler

import (
"net/http"

"github.com/nspcc-dev/neofs-s3-gw/api"
"github.com/nspcc-dev/neofs-s3-gw/api/s3errors"
)

func (h *handler) GetBucketLifecycleHandler(w http.ResponseWriter, r *http.Request) {
h.logAndSendError(
w,
"The lifecycle configuration does not exist",
api.GetReqInfo(r.Context()),
s3errors.GetAPIError(s3errors.ErrNoSuchLifecycleConfiguration),
)
}
4 changes: 0 additions & 4 deletions api/handler/unimplemented.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ func (h *handler) SelectObjectContentHandler(w http.ResponseWriter, r *http.Requ
h.logAndSendError(w, "not implemented", api.GetReqInfo(r.Context()), s3errors.GetAPIError(s3errors.ErrNotImplemented))
}

func (h *handler) GetBucketLifecycleHandler(w http.ResponseWriter, r *http.Request) {
h.logAndSendError(w, "not implemented", api.GetReqInfo(r.Context()), s3errors.GetAPIError(s3errors.ErrNotImplemented))
}

func (h *handler) GetBucketEncryptionHandler(w http.ResponseWriter, r *http.Request) {
h.logAndSendError(w, "not implemented", api.GetReqInfo(r.Context()), s3errors.GetAPIError(s3errors.ErrNotImplemented))
}
Expand Down
14 changes: 7 additions & 7 deletions docs/aws_s3_compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ See [Ownership](./aws_s3_compat.md#ownership-controls) section for details.
## Lifecycle
| | Method | Comments |
|----|---------------------------------|----------|
| πŸ”΅ | DeleteBucketLifecycle | |
| πŸ”΅ | GetBucketLifecycle | |
| πŸ”΅ | GetBucketLifecycleConfiguration | |
| πŸ”΅ | PutBucketLifecycle | |
| πŸ”΅ | PutBucketLifecycleConfiguration | |
| | Method | Comments |
|----|---------------------------------|------------------------------------------------------|
| πŸ”΅ | DeleteBucketLifecycle | |
| 🟑 | GetBucketLifecycle | It always returns NoSuchLifecycleConfiguration error |
| πŸ”΅ | GetBucketLifecycleConfiguration | |
| πŸ”΅ | PutBucketLifecycle | |
| πŸ”΅ | PutBucketLifecycleConfiguration | |
## Logging
Expand Down

0 comments on commit e7921e2

Please sign in to comment.