Skip to content

Commit 3305457

Browse files
authored
Merge branch 'master' into support-replicate-ilm-expiry
2 parents 33c0467 + 3c3b954 commit 3305457

File tree

441 files changed

+125441
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

441 files changed

+125441
-1204
lines changed

.github/workflows/jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ jobs:
12661266
- uses: actions/checkout@v3
12671267
- uses: actions/setup-node@v3
12681268
with:
1269-
node-version: 16
1269+
node-version: 18
12701270

12711271
- name: Install dependencies
12721272
run: |

.github/workflows/vulncheck.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v3
2424
with:
25-
go-version: 1.21.4
25+
go-version: 1.21.5
2626
check-latest: true
2727
- name: Get official govulncheck
2828
run: go install golang.org/x/vuln/cmd/govulncheck@latest
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
strategy:
3838
matrix:
39-
go-version: [ 1.21.4 ]
39+
go-version: [ 1.21.5 ]
4040
os: [ ubuntu-latest ]
4141
steps:
4242
- name: Check out code

CHANGELOG.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,50 @@
22

33
# Changelog
44

5+
## Release v0.43.0
6+
7+
Features:
8+
9+
- Updated PDF preview method
10+
11+
Bug Fix:
12+
13+
- Fixed vulnerabilities
14+
- Prevented non-necessary metadata calls in object browser
15+
16+
## Release v0.42.2
17+
18+
Bug Fix:
19+
20+
- Hidden Prometheus metrics if URL is empty
21+
22+
## Release v0.42.1
23+
24+
Bug Fix:
25+
26+
- Reset go version to 1.19
27+
28+
## Release v0.42.0
29+
30+
Features:
31+
32+
- Introducing Dark Mode
33+
34+
Bug Fix:
35+
36+
- Fixed vulnerabilities
37+
- Changes on Upload and Delete object urls
38+
- Fixed blocking subpath creation if not enough permissions
39+
- Removed share object option at prefix level
40+
- Updated allowed actions for a deleted object
41+
542
## Release v0.41.0
643

744
Features:
845

946
- Updated pages to use mds components
1047
- support for resolving IPv4/IPv6
1148

12-
1349
Bug Fix:
1450

1551
- Remove cache for ClientIP
@@ -23,7 +59,6 @@ Features:
2359
- Updated OpenID page
2460
- Added New bucket event types support
2561

26-
2762
Bug Fix:
2863

2964
- Fixed crash in access keys page
@@ -37,7 +72,6 @@ Features:
3772
- Migrated metrics page to mds
3873
- Migrated Register page to mds
3974

40-
4175
Bug Fix:
4276

4377
- Fixed LDAP configuration page issues

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ A graphical user interface for [MinIO](https://github.com/minio/minio)
1212
**Table of Contents**
1313

1414
- [MinIO Console](#minio-console)
15-
- [Install](#install)
16-
- [Build from source](#build-from-source)
17-
- [Setup](#setup)
18-
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
19-
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
20-
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
21-
- [Start Console service:](#start-console-service)
22-
- [Start Console service with TLS:](#start-console-service-with-tls)
23-
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
15+
- [Install](#install)
16+
- [Build from source](#build-from-source)
17+
- [Setup](#setup)
18+
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
19+
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
20+
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
21+
- [Start Console service:](#start-console-service)
22+
- [Start Console service with TLS:](#start-console-service-with-tls)
23+
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
2424
- [Contribute to console Project](#contribute-to-console-project)
2525

2626
<!-- markdown-toc end -->

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/minio/console
22

3-
go 1.21
3+
go 1.19
44

55
require (
66
github.com/blang/semver/v4 v4.0.0
@@ -32,12 +32,12 @@ require (
3232
github.com/stretchr/testify v1.8.4
3333
github.com/tidwall/gjson v1.16.0
3434
github.com/unrolled/secure v1.13.0
35-
golang.org/x/crypto v0.14.0
35+
golang.org/x/crypto v0.16.0
3636
golang.org/x/net v0.17.0
3737
golang.org/x/oauth2 v0.12.0
3838
// Added to include security fix for
3939
// https://github.com/golang/go/issues/56152
40-
golang.org/x/text v0.13.0 // indirect
40+
golang.org/x/text v0.14.0 // indirect
4141
gopkg.in/yaml.v2 v2.4.0 // indirect
4242
)
4343

@@ -85,10 +85,10 @@ require (
8585
github.com/juju/ratelimit v1.0.2 // indirect
8686
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
8787
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
88-
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
88+
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
8989
github.com/lestrrat-go/httpcc v1.0.1 // indirect
9090
github.com/lestrrat-go/iter v1.0.2 // indirect
91-
github.com/lestrrat-go/jwx v1.2.26 // indirect
91+
github.com/lestrrat-go/jwx v1.2.27 // indirect
9292
github.com/lestrrat-go/option v1.0.1 // indirect
9393
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
9494
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
@@ -145,8 +145,8 @@ require (
145145
go.uber.org/multierr v1.11.0 // indirect
146146
go.uber.org/zap v1.25.0 // indirect
147147
golang.org/x/sync v0.3.0 // indirect
148-
golang.org/x/sys v0.13.0 // indirect
149-
golang.org/x/term v0.13.0 // indirect
148+
golang.org/x/sys v0.15.0 // indirect
149+
golang.org/x/term v0.15.0 // indirect
150150
google.golang.org/appengine v1.6.8 // indirect
151151
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
152152
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect

go.sum

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:W
1515
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
1616
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
1717
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
18-
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
1918
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
2019
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
2120
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
@@ -184,21 +183,20 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv
184183
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
185184
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
186185
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
187-
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
188186
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
189187
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
190188
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
191189
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
192190
github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A=
193191
github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y=
194-
github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80=
195-
github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
192+
github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=
193+
github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
196194
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
197195
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
198196
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
199197
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
200-
github.com/lestrrat-go/jwx v1.2.26 h1:4iFo8FPRZGDYe1t19mQP0zTRqA7n8HnJ5lkIiDvJcB0=
201-
github.com/lestrrat-go/jwx v1.2.26/go.mod h1:MaiCdGbn3/cckbOFSCluJlJMmp9dmZm5hDuIkx8ftpQ=
198+
github.com/lestrrat-go/jwx v1.2.27 h1:cvnTnda/YzdyFuWdEAMkI6BsLtItSrASEVCI3C/IUEQ=
199+
github.com/lestrrat-go/jwx v1.2.27/go.mod h1:Stob9LjSqR3lOmNdxF0/TvZo60V3hUGv8Fr7Bwzla3k=
202200
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
203201
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
204202
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
@@ -254,7 +252,6 @@ github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEp
254252
github.com/minio/minio-go/v7 v7.0.64-0.20230920204636-e783c9ba11b3 h1:0DtfDxg67S/IRcGnIBKgzyjZ0GXyk3jN1Fy5/+8CQlM=
255253
github.com/minio/minio-go/v7 v7.0.64-0.20230920204636-e783c9ba11b3/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4=
256254
github.com/minio/mux v1.9.0 h1:dWafQFyEfGhJvK6AwLOt83bIG5bxKxKJnKMCi0XAaoA=
257-
github.com/minio/mux v1.9.0/go.mod h1:1pAare17ZRL5GpmNL+9YmqHoWnLmMZF9C/ioUCfy0BQ=
258255
github.com/minio/pkg/v2 v2.0.2 h1:cytXmC21fBNS+0NVKEE5FuYmQfY+HFTqis6Kkj3U9ac=
259256
github.com/minio/pkg/v2 v2.0.2/go.mod h1:6xTAr5M9yobpUroXAAaTrGJ9fhOZIqKYOT0I87u2yZ4=
260257
github.com/minio/selfupdate v0.6.0 h1:i76PgT0K5xO9+hjzKcacQtO7+MjJ4JKA8Ak8XQ9DDwU=
@@ -333,7 +330,6 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
333330
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
334331
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
335332
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
336-
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
337333
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
338334
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
339335
github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=
@@ -411,7 +407,6 @@ go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAV
411407
go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE=
412408
go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ=
413409
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
414-
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
415410
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
416411
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
417412
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
@@ -426,9 +421,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP
426421
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
427422
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
428423
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
429-
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
430-
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
431-
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
424+
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
425+
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
432426
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
433427
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
434428
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -493,16 +487,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
493487
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
494488
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
495489
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
496-
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
497-
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
490+
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
491+
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
498492
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
499493
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
500494
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
501495
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
502496
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
503497
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
504-
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
505-
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
498+
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
499+
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
506500
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
507501
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
508502
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -512,8 +506,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
512506
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
513507
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
514508
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
515-
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
516-
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
509+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
510+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
517511
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
518512
golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
519513
golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=

integration/user_api_bucket_test.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package integration
2121
import (
2222
"bytes"
2323
"context"
24+
"encoding/base64"
2425
"encoding/json"
2526
"errors"
2627
"fmt"
@@ -395,9 +396,10 @@ func UploadAnObject(bucketName, fileName string) (*http.Response, error) {
395396
contentType + boundaryEnd
396397
arrayOfBytes := []byte(file)
397398
requestDataBody := bytes.NewReader(arrayOfBytes)
399+
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/upload" + "?prefix=" + base64.StdEncoding.EncodeToString([]byte(fileName))
398400
request, err := http.NewRequest(
399401
"POST",
400-
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/upload",
402+
apiURL,
401403
requestDataBody,
402404
)
403405
if err != nil {
@@ -421,8 +423,9 @@ func DeleteObject(bucketName, path string, recursive, allVersions bool) (*http.R
421423
DELETE:
422424
{{baseUrl}}/buckets/bucketName/objects?path=Y2VzYXJpby50eHQ=&recursive=false&all_versions=false
423425
*/
424-
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?path=" +
425-
path + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
426+
prefixEncoded := base64.StdEncoding.EncodeToString([]byte(path))
427+
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?prefix=" +
428+
prefixEncoded + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
426429
strconv.FormatBool(allVersions)
427430
request, err := http.NewRequest(
428431
"DELETE",
@@ -488,9 +491,11 @@ func PutObjectsRetentionStatus(bucketName, prefix, versionID, mode, expires stri
488491
}
489492
requestDataJSON, _ := json.Marshal(requestDataAdd)
490493
requestDataBody := bytes.NewReader(requestDataJSON)
494+
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/retention?prefix=" + prefix + "&version_id=" + versionID
495+
491496
request, err := http.NewRequest(
492497
"PUT",
493-
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/retention?prefix="+prefix+"&version_id="+versionID,
498+
apiURL,
494499
requestDataBody,
495500
)
496501
if err != nil {
@@ -726,9 +731,10 @@ func PutObjectsLegalholdStatus(bucketName, prefix, status, versionID string) (*h
726731
}
727732
requestDataJSON, _ := json.Marshal(requestDataAdd)
728733
requestDataBody := bytes.NewReader(requestDataJSON)
734+
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/legalhold?prefix=" + prefix + "&version_id=" + versionID
729735
request, err := http.NewRequest(
730736
"PUT",
731-
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/legalhold?prefix="+prefix+"&version_id="+versionID,
737+
apiURL,
732738
requestDataBody,
733739
)
734740
if err != nil {
@@ -747,8 +753,8 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
747753
// Variables
748754
assert := assert.New(t)
749755
bucketName := "testputobjectslegalholdstatus"
750-
fileName := "testputobjectslegalholdstatus.txt"
751-
prefix := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0" // encoded base64
756+
objName := "testputobjectslegalholdstatus.txt" // // encoded base64 of testputobjectslegalholdstatus.txt = dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0
757+
objectNameEncoded := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0"
752758
status := "enabled"
753759

754760
// 1. Create bucket
@@ -759,7 +765,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
759765
// 2. Add object
760766
uploadResponse, uploadError := UploadAnObject(
761767
bucketName,
762-
fileName,
768+
objName,
763769
)
764770
assert.Nil(uploadError)
765771
if uploadError != nil {
@@ -776,7 +782,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
776782
}
777783

778784
// Get versionID
779-
listResponse, _ := ListObjects(bucketName, prefix, "true")
785+
listResponse, _ := ListObjects(bucketName, "", "true")
780786
bodyBytes, _ := io.ReadAll(listResponse.Body)
781787
listObjs := models.ListObjectsResponse{}
782788
err := json.Unmarshal(bodyBytes, &listObjs)
@@ -814,7 +820,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
814820
// 3. Put Objects Legal Status
815821
putResponse, putError := PutObjectsLegalholdStatus(
816822
bucketName,
817-
prefix,
823+
objectNameEncoded,
818824
status,
819825
tt.args.versionID,
820826
)
@@ -1634,7 +1640,6 @@ func TestDeleteObject(t *testing.T) {
16341640
assert := assert.New(t)
16351641
bucketName := "testdeleteobjectbucket1"
16361642
fileName := "testdeleteobjectfile"
1637-
path := "dGVzdGRlbGV0ZW9iamVjdGZpbGUxLnR4dA==" // fileName encoded base64
16381643
numberOfFiles := 2
16391644

16401645
// 1. Create bucket
@@ -1657,8 +1662,9 @@ func TestDeleteObject(t *testing.T) {
16571662
}
16581663
}
16591664

1665+
objPathFull := fileName + "1.txt" // would be encoded in DeleteObject util method.
16601666
// 3. Delete only one object from the bucket.
1661-
deleteResponse, deleteError := DeleteObject(bucketName, path, false, false)
1667+
deleteResponse, deleteError := DeleteObject(bucketName, objPathFull, false, false)
16621668
assert.Nil(deleteError)
16631669
if deleteError != nil {
16641670
log.Println(deleteError)

0 commit comments

Comments
 (0)