Comments (5)
Which global map are you talking about, exactly?
from go-aws-auth.
awsauth.go: awsSignVersion has a mutex that protects it in the sign v3/v4 functions.
from go-aws-auth.
Ah, I see what you're talking about. The mutex doesn't protect that map, it protects the Keys variable. The Keys variable may be mutated on any call to any of the Sign functions. If your program has concurrent calls to Sign, there could be trouble.
Before locking this library into 1.0, I think we'll look for a better way to manage credentials.
from go-aws-auth.
Then I'm not sure that mutex is doing what you think. If I provide credentials that the chooseKeys function picks, holding that mutex does nothing to protect against the credentials being changed in some goroutine outside the context of your signing functions. If you are trying to protect against that specific case, you would need to stick a mutex on each credentials object and lock access there.
That said, as a user of the library I would be fine if the credentials struct was readonly once created and if I wanted new credentials (from say, an IAM or config file change) then it would be my responsibility to provide a new credentials struct instance and not modify an existing one that could be in-use -- or it would be my responsibility to mutex protect calls to any functions using them.
from go-aws-auth.
According to my reading of the code, the mutex was protecting a package-level (exported) Keys
variable, which has since been removed. Let me know if I've unknowingly done something rash...
from go-aws-auth.
Related Issues (20)
- Broken S3 sign HOT 14
- Suggestion: Make http request signing safe from multiple goroutines HOT 7
- Credentials need to be thread-safe HOT 2
- Cannot find package? HOT 1
- Signature invalid when using for "Product Advertising API"
- Does not support API Gateway with custom host names HOT 4
- URL needs double-encoding for non-S3 endpoints HOT 7
- serviceAndRegion logic is incorrect
- Implement Route 53 authentication HOT 1
- request.Host may include port, causes incorrect signature
- SigV4 query-string URI-signing for AWS IoT Data service
- tag a release
- unable to use EC2 service
- master (2043e6d0bb7e4c18464a7bba562acbe482e3cabd) does not pass tests!
- Rename the `awsauth.Keys` variable? HOT 2
- can't override service/region magic
- MissingAuthenticationTokenException
- Warning: go-aws-auth is no longer maintained and will soon be removed! HOT 2
- Support S3 query string URLs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-aws-auth.