Skip to content

Commit

Permalink
Updated docs about signing mechanisms
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Feb 9, 2014
1 parent 1909577 commit 2599b6f
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
go-aws-auth
===========

Go-AWS-Auth aims to be a comprehensive, lightweight library for signing requests to Amazon Web Services.
Go-AWS-Auth is a comprehensive, lightweight library for signing requests to Amazon Web Services.

With Go-AWS-Auth, you need not take any thought about authenticating with AWS. Simply build your request however you need, then call `awsauth.Sign(req)` before sending your request over the wire.
It's easy to use: simply build your HTTP request, then call `awsauth.Sign(req)` before sending your request over the wire.

Go-AWS-Auth intends to keep the ball in your court when actually performing the request, and is concerned merely with tackling the (rather involved) process of signing the request with your credentials.

**[Documentation at GoDoc](http://godoc.org/github.com/smartystreets/go-aws-auth)**
**[GoDoc Documentation](http://godoc.org/github.com/smartystreets/go-aws-auth)**


### Supported signing mechanisms

- [Signed Signature Version 2](http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html)
- [Signed Signature Version 3](http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)
- [Signed Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
- Custom S3 Scheme
- [Custom S3 Authentication Scheme](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html)
- [Security Token Service](http://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html)
- Coming soon: [S3 Query String Authentication](http://docs.aws.amazon.com/AmazonS3/latest/dev/S3_QSAuth.html)
- Coming soon: IAM Role Authentication

For more info, see the [comprehensive docs](http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) at AWS.

Expand All @@ -38,18 +39,11 @@ You can do it two ways.
1. **Recommended:** Set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables with your credentials. The library will automatically detect and use them. You may also optionally set the `AWS_SECURITY_TOKEN` environment variable if you are using temporary credentials from [STS](http://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html).

2. You can set `awsauth.Keys` with hard-coded credentials (for testing or spike code):
```
awsauth.Keys = &awsauth.Credentials{
AccessKeyID: "Access Key ID",
SecretAccessKey: "Secret Access Key",
}
// You may include a security token
```go
awsauth.Keys = &awsauth.Credentials{
AccessKeyID: "Access Key ID",
SecretAccessKey: "Secret Access Key",
SecurityToken: "Security Token",
SecurityToken: "Security Token", // STS (optional)
}
```

Expand All @@ -59,7 +53,7 @@ Setting the credentials manually will override environment variables.

### Signing requests

Once your credentials are set up, simply make a plain request for AWS, have it signed, then perform the request as you desire.
Once your credentials are set up, just make the request, have it signed, and perform the request as usual.

```go
url := "https://iam.amazonaws.com/?Action=ListRoles&Version=2010-05-08"
Expand All @@ -76,4 +70,4 @@ resp, err := client.Do(req)

### Contributing

This library isn't quite complete (yet) but should work well for most common AWS interactions. Please feel free to contribute by forking, opening issues, submitting pull requests, etc.
This library isn't quite complete (yet) but should work well for most common AWS interactions. Please feel free to contribute by forking, opening issues, submitting pull requests, etc. Thanks to all contributors!

0 comments on commit 2599b6f

Please sign in to comment.