Merge lp:~axwalk/juju-core/lp1216768-azure-public-storage-key into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1710 |
Proposed branch: | lp:~axwalk/juju-core/lp1216768-azure-public-storage-key |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
177 lines (+33/-18) 2 files modified
provider/azure/storage.go (+6/-3) provider/azure/storage_test.go (+27/-15) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1216768-azure-public-storage-key |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Juju Engineering | Pending | ||
Review via email: mp+182041@code.launchpad.net |
Commit message
azure: check storage key when generating URL
The Azure provider currently generates an anonymous
(shared access signature) URL for accessing storage
blobs, regardless of whether we're using public or
private storage. If we're using public storage, we
should not attempt to generate a shared access
signature, which requires the account key.
Fixes bug #1216768
Description of the change
azure: check storage key when generating URL
The Azure provider currently generates an anonymous
(shared access signature) URL for accessing storage
blobs, regardless of whether we're using public or
private storage. If we're using public storage, we
should not attempt to generate a shared access
signature, which requires the account key.
Fixes bug #1216768
Reviewers: mp+182041_ code.launchpad. net,
Message:
Please take a look.
Description:
azure: check storage key when generating URL
The Azure provider currently generates an anonymous
(shared access signature) URL for accessing storage
blobs, regardless of whether we're using public or
private storage. If we're using public storage, we
should not attempt to generate a shared access
signature, which requires the account key.
Fixes bug #1216768
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1216768- azure-public- storage- key/+merge/ 182041
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13220043/
Affected files: azure/storage. go azure/storage_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details] 20130825140921- 3o6xvqsc01lf9v7 q
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: provider/ azure/storage. go azure/storage. go' azure/storage. go 2013-08-05 04:06:09 +0000 azure/storage. go 2013-08-26 06:44:01 +0000 ).AddDate( 10, 0, 0) GetAnonymousFil eURL(storage. getContainer( ), name, ).AddDate( 10, 0, 0) GetAnonymousFil eURL(storage. getContainer( ), name, GetFileURL( storage. getContainer( ), name), nil
=== modified file 'provider/
--- provider/
+++ provider/
@@ -90,9 +90,12 @@
if err != nil {
return "", err
}
- // 10 years should be good enough.
- expires := time.Now(
- return context.
expires), nil
+ if context.Key != "" {
+ // 10 years should be good enough.
+ expires := time.Now(
+ return context.
expires), nil
+ }
+ return context.
}
// ConsistencyStrategy is specified in the StorageReader interface.
Index: provider/ azure/storage_ test.go azure/storage_ test.go' azure/storage_ test.go 2013-08-13 15:45:39 +0000 azure/storage_ test.go 2013-08-26 06:44:01 +0000 (container, account string) (azureStorage, (container, account, key string) (azureStorage, Transport: transport} orageContext( client) xt.Account = account text{container: container, storageContext: storageContext: context} blobListRespons e, http.StatusOK) (container, "account") (container, "account", "") AddExchange( response, nil)
=== modified file 'provider/
--- provider/
+++ provider/
@@ -83,11 +83,12 @@
// fake HTTP server set up to always return preconfigured http.Response
objects.
// The MockingTransport object can be used to check that the expected
query has
// been issued to the test server.
-func makeFakeStorage
*MockingTransport) {
+func makeFakeStorage
*MockingTransport) {
transport := &MockingTransport{}
client := &http.Client{
storageContext := gwacl.NewTestSt
storageConte
+ storageContext.Key = key
context := &testStorageCon
storageContext}
azStorage := azureStorage{
return azStorage, transport
@@ -124,7 +125,7 @@
func (*storageSuite) TestList(c *gc.C) {
container := "container"
response := makeResponse(
- azStorage, transport := makeFakeStorage
+ azStorage, transport := makeFakeStorage
transport.
prefix := "prefix"
@@ -143,7 +144,7 @@
// case the p...