Repository navigation
feat(s3): S3アドオンにSigV4署名を追加 #746
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
Open
tishin-endou
wants to merge
10
commits into
RCOSDP:develop
Choose a base branch
from
tishin-endou:feature/s3-sigv4-clean
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a3325d0
feat(s3): sign S3 addon requests with SigV4
tishin-endou 2f451dc
fix(s3): reuse the existing external account when the access key is a…
tishin-endou f70e7f0
test(s3): drop nose remnants and update the node addons mock to the S…
tishin-endou 578a9eb
test(s3): cover folder_id formats, provider_id dedup and error paths
tishin-endou b684350
fix(s3): preserve bucket names as given and tolerate a missing owner …
tishin-endou abb5a78
test(s3): run the folder_id cases in a loop instead of pytest.mark.pa…
tishin-endou 2a4e715
Merge RCOSDP develop into feature/s3-sigv4-clean
tishin-endou 14a8027
Report us-east-1 as the empty-string bucket location
tishin-endou 10873ee
Translate list_objects failures into HTTPError in get_bucket_prefixes
tishin-endou 94d57ea
Catch BotoCoreError when creating a bucket
tishin-endou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| boto==2.38.0 | ||
| # boto (v2) was removed as part of SigV4 migration. | ||
| # boto3/botocore are declared in the root requirements.txt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,46 @@ | ||
| var Rubeus = require('rubeus'); | ||
| var Rubeus = require('rubeus'); | ||
|
|
||
| Rubeus.cfg.s3 = { | ||
| Rubeus.cfg.s3 = { | ||
|
|
||
| uploadMethod: 'PUT', | ||
| uploadUrl: null, | ||
| uploadAdded: function(file, item) { | ||
| var self = this; | ||
| var parent = self.getByID(item.parentID); | ||
| var name = file.name; | ||
| // Make it possible to upload into subfolders | ||
| while (parent.depth > 1 && !parent.isAddonRoot) { | ||
| name = parent.name + '/' + name; | ||
| parent = self.getByID(parent.parentID); | ||
| } | ||
| file.destination = name; | ||
| file.signedUrlFrom = parent.urls.upload; | ||
| }, | ||
| uploadMethod: 'PUT', | ||
| uploadUrl: null, | ||
| uploadAdded: function (file, item) { | ||
| var self = this; | ||
| var parent = self.getByID(item.parentID); | ||
| var name = file.name; | ||
| // Make it possible to upload into subfolders | ||
| while (parent.depth > 1 && !parent.isAddonRoot) { | ||
| name = parent.name + '/' + name; | ||
| parent = self.getByID(parent.parentID); | ||
| } | ||
| file.destination = name; | ||
| file.signedUrlFrom = parent.urls.upload; | ||
| }, | ||
|
|
||
| uploadSending: function(file, formData, xhr) { | ||
| xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream'); | ||
| xhr.setRequestHeader('x-amz-acl', 'private'); | ||
| }, | ||
| uploadSending: function (file, formData, xhr) { | ||
| xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream'); | ||
| xhr.setRequestHeader('x-amz-acl', 'private'); | ||
| }, | ||
|
|
||
| uploadSuccess: function(file, row) { | ||
| var self = this; | ||
| var parent = this.getByID(row.parentID); | ||
| row.urls = { | ||
| 'delete': parent.nodeApiUrl + 's3/' + file.destination + '/', | ||
| 'download': parent.nodeUrl + 's3/' + file.destination + '/download/', | ||
| 'view': parent.nodeUrl + 's3/' + file.destination + '/' | ||
| }; | ||
| row.permissions = parent.permissions; | ||
| this.updateItem(row); | ||
| var updated = Rubeus.Utils.itemUpdated(row, parent); | ||
| if (updated) { | ||
| self.changeStatus(row, Rubeus.Status.UPDATED); | ||
| self.delayRemoveRow(row); | ||
| } else { | ||
| self.changeStatus(row, Rubeus.Status.UPLOAD_SUCCESS, null, 2000, | ||
| function(row) { | ||
| self.showButtons(row); | ||
| }); | ||
| } | ||
| uploadSuccess: function (file, row) { | ||
| var self = this; | ||
| var parent = this.getByID(row.parentID); | ||
| row.urls = { | ||
| 'delete': parent.nodeApiUrl + 's3/' + file.destination + '/', | ||
| 'download': parent.nodeUrl + 's3/' + file.destination + '/download/', | ||
| 'view': parent.nodeUrl + 's3/' + file.destination + '/' | ||
| }; | ||
| row.permissions = parent.permissions; | ||
| this.updateItem(row); | ||
| var updated = Rubeus.Utils.itemUpdated(row, parent); | ||
| if (updated) { | ||
| self.changeStatus(row, Rubeus.Status.UPDATED); | ||
| self.delayRemoveRow(row); | ||
| } else { | ||
| self.changeStatus(row, Rubeus.Status.UPLOAD_SUCCESS, null, 2000, | ||
| function (row) { | ||
| self.showButtons(row); | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| { | ||
| "s3_bucket_linked" : "A user linked an Amazon S3 bucket to a project", | ||
| "s3_bucket_unlinked" : "A user unselected an Amazon S3 bucket in a project", | ||
| "s3_file_added" : "A user added a file to an Amazon S3 bucket in a project", | ||
| "s3_file_removed" : "A user removed a file in an Amazon S3 bucket in a project", | ||
| "s3_file_updated" : "A user updated a file in an Amazon S3 bucket in a project", | ||
| "s3_folder_created" : "A user created a folder in an Amazon S3 in a project", | ||
| "s3_node_authorized" : "A user authorized the Amazon S3 addon for a project", | ||
| "s3_node_deauthorized" : "A user deauthorized the Amazon S3 addon for a project", | ||
| "s3_node_deauthorized_no_user" : "Amazon S3 addon for a project deauthorized" | ||
| } | ||
| "s3_bucket_linked": "A user linked an Amazon S3 bucket to a project", | ||
| "s3_bucket_unlinked": "A user unselected an Amazon S3 bucket in a project", | ||
| "s3_file_added": "A user added a file to an Amazon S3 bucket in a project", | ||
| "s3_file_removed": "A user removed a file in an Amazon S3 bucket in a project", | ||
| "s3_file_updated": "A user updated a file in an Amazon S3 bucket in a project", | ||
| "s3_folder_created": "A user created a folder in an Amazon S3 in a project", | ||
| "s3_node_authorized": "A user authorized the Amazon S3 addon for a project", | ||
| "s3_node_deauthorized": "A user deauthorized the Amazon S3 addon for a project", | ||
| "s3_node_deauthorized_no_user": "Amazon S3 addon for a project deauthorized" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| { | ||
| "s3_bucket_linked" : "${user} linked the Amazon S3 bucket ${bucket} to ${node}", | ||
| "s3_bucket_unlinked" : "${user} unselected the Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_added" : "${user} added file ${path} to Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_removed" : "${user} removed ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_updated" : "${user} updated file ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_folder_created" : "${user} created folder ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_node_authorized" : "${user} authorized the Amazon S3 addon for ${node}", | ||
| "s3_node_deauthorized" : "${user} deauthorized the Amazon S3 addon for ${node}", | ||
| "s3_node_deauthorized_no_user" : "Amazon S3 addon for ${node} deauthorized" | ||
| } | ||
| "s3_bucket_linked": "${user} linked the Amazon S3 bucket ${bucket} to ${node}", | ||
| "s3_bucket_unlinked": "${user} unselected the Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_added": "${user} added file ${path} to Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_removed": "${user} removed ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_file_updated": "${user} updated file ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_folder_created": "${user} created folder ${path} in Amazon S3 bucket ${bucket} in ${node}", | ||
| "s3_node_authorized": "${user} authorized the Amazon S3 addon for ${node}", | ||
| "s3_node_deauthorized": "${user} deauthorized the Amazon S3 addon for ${node}", | ||
| "s3_node_deauthorized_no_user": "Amazon S3 addon for ${node} deauthorized" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.