Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support temporary security credentials #327

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Classes/S3/ASIS3Request.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ typedef enum _ASIS3ErrorType {

// The access policy to use when PUTting a file (see the string constants at the top ASIS3Request.h for details on what the possible options are)
NSString *accessPolicy;

// The session token used by Temporary Security Credentials
NSString *sessionToken;

// Internally used while parsing errors
NSString *currentXMLElementContent;
Expand Down Expand Up @@ -106,4 +109,5 @@ typedef enum _ASIS3ErrorType {
@property (retain) NSString *currentXMLElementContent;
@property (retain) NSMutableArray *currentXMLElementStack;
@property (retain) NSString *requestScheme;
@property (retain) NSString *sessionToken;
@end
5 changes: 5 additions & 0 deletions Classes/S3/ASIS3Request.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ - (void)dealloc
[secretAccessKey release];
[accessPolicy release];
[requestScheme release];
[sessionToken release];
[super dealloc];
}

Expand All @@ -71,6 +72,9 @@ - (NSMutableDictionary *)S3Headers
if ([self accessPolicy]) {
[headers setObject:[self accessPolicy] forKey:@"x-amz-acl"];
}
if (self.sessionToken) {
[headers setObject:[self sessionToken] forKey:@"x-amz-security-token"];
}
return headers;
}

Expand Down Expand Up @@ -309,4 +313,5 @@ - (void)buildURL
@synthesize currentXMLElementStack;
@synthesize accessPolicy;
@synthesize requestScheme;
@synthesize sessionToken;
@end