Skip to content

Commit 15a0d09

Browse files
committed
Added stub s3 client so we can check the example signature calculation
1 parent c876ef5 commit 15a0d09

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/common/AmazonS3Client.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "AmazonS3Client.h"
2+
#include "AWSFoundationalTypes.h"
3+
#include <stdlib.h>
4+
#include "Utils.h"
5+
6+
// stub for verifying if the signature actually works, needs to get some more love :)
7+
8+
AmazonS3Client::AmazonS3Client() : AWSClient4() {
9+
this->awsService = "s3";
10+
this->signedHeaders = "host;range;x-amz-content-sha256;x-amz-date";
11+
this->queryString = "";
12+
this->httpS = true;
13+
}
14+
15+
char* AmazonS3Client::get(MinimalString uri, ActionError& actionError) {
16+
actionError = NONE_ACTIONERROR;
17+
18+
this->method = "GET";
19+
setAWSPath(uri.getCStr());
20+
MinimalString foo = "";
21+
char* request = createRequest(foo);
22+
// char* response = sendData(request);
23+
return request;
24+
}

src/common/AmazonS3Client.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef AMAZONS3CLIENT_H_
2+
#define AMAZONS3CLIENT_H_
3+
#include "AWSClient4.h"
4+
5+
class AmazonS3Client : public AWSClient4 {
6+
public:
7+
AmazonS3Client();
8+
char* get(MinimalString uri, ActionError& actionError);
9+
};
10+
11+
#endif /* AMAZONS3CLIENT_H_ */

0 commit comments

Comments
 (0)