Skip to content

Commit b56506d

Browse files
changes to integration test, changes to test proxy to toggle v4 auth
1 parent 4157e75 commit b56506d

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

adminapi_integration_test.go

+12-11
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,6 @@ func (is *IntegrationsSuite) Test05Bucket() {
153153
Fix: true,
154154
})
155155

156-
// see if we can now get stats.
157-
158-
ui, err := is.aa.UserInfo(context.Background(), is.ic.Integration.TestUID, true)
159-
160-
is.NoError(err)
161-
is.NotNil(ui.Stats)
162-
163-
is.T().Logf("%#v", ui)
164156
bucketnames, err := is.aa.BucketList(context.Background(), "")
165157
is.NoError(err, "Got error fetching bucket names")
166158
is.T().Logf("bucket names: %#v\n", bucketnames)
@@ -184,6 +176,15 @@ func (is *IntegrationsSuite) Test05Bucket() {
184176
bucketindresp, err := is.aa.BucketIndex(context.Background(), bireq)
185177
is.NoError(err, "Got error from BucketIndex()")
186178
is.T().Logf(spew.Sdump(bucketindresp))
179+
180+
// see if we can now get stats.
181+
182+
ui, err := is.aa.UserInfo(context.Background(), is.ic.Integration.TestUID, true)
183+
184+
is.NoError(err)
185+
is.NotNil(ui.Stats)
186+
187+
is.T().Log(spew.Sdump(ui))
187188
}
188189

189190
func (is *IntegrationsSuite) Test06Caps() {
@@ -362,9 +363,9 @@ func (is *IntegrationsSuite) writeRandomFile(path string, sizekb int) {
362363
}
363364

364365
type RandoReader struct {
365-
r *rand.Rand
366-
max int64
367-
read int64
366+
r *rand.Rand
367+
max int64
368+
read int64
368369
}
369370

370371
func NewRandoReader(seed int64, bytes int64) *RandoReader {

testradosgwproxy/config/config.toml.example

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
ServicePort = 8080
44
Readtimeout = "120s"
55
WriteTimeout = "120s"
6+
UseV4Auth = false
67

78
[rgw]
89
ClientTimeout = "120s"

testradosgwproxy/main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ func (p *proxy) director(req *http.Request) {
8787
req.Host = target.Host
8888
req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
8989
req.Header.Set("Host", target.Host)
90-
_ = awsauth.SignS3(req, p.creds)
90+
if p.cfg.Server.UseV4Auth {
91+
_ = awsauth.Sign4(req, p.creds)
92+
} else {
93+
_ = awsauth.SignS3(req, p.creds)
94+
}
9195
if targetQuery == "" || req.URL.RawQuery == "" {
9296
req.URL.RawQuery = targetQuery + req.URL.RawQuery
9397
} else {
@@ -123,6 +127,7 @@ type serverConfig struct {
123127
ServicePort int
124128
ReadTimeout rgw.Duration
125129
WriteTimeout rgw.Duration
130+
UseV4Auth bool
126131
}
127132

128133
func init() {

user.go

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ type UserInfoResponse struct {
6464
Stats *UserStats `json:"stats"`
6565
}
6666

67-
6867
//UserStats - statistics for a user
6968
type UserStats struct {
7069
Size int `json:"size"`

0 commit comments

Comments
 (0)