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

Add safeguard against S3 overwrites #12

Open
zstumgoren opened this issue Mar 14, 2017 · 1 comment
Open

Add safeguard against S3 overwrites #12

zstumgoren opened this issue Mar 14, 2017 · 1 comment
Assignees
Milestone

Comments

@zstumgoren
Copy link
Contributor

zstumgoren commented Mar 14, 2017

Add safeguard against accidental overwriting of a previously created project on S3.

Implementation

Some initial thoughts on implementation

Create S3 integration code

Create lib-level code and related data:s3:integrate command that:

  • Generates a unique hash
  • Checks if bucket@s3_path/.project_id exists
  • If exists, errors out
  • If not exists:
    • Stores hash as project_id setting in config/datakit-data.json
    • Creates bucket@s3_path/.project_id with the unique hash

Initialization

  • Triggers data:s3:integrate
  • If bucket@s3_path/.project_id exists:
    • Store config/datakit-data.json without the project_id setting
    • Warn user that the s3_path already exists, that they should update the setting and run data:s3:integrate
  • If the hidden file does not exist, proceed with the actions of data:s3:integrate:
    • Stores hash as project_id setting in config/datakit-data.json
    • Creates bucket@s3_path/.project_id with the unique hash

Push/Pull

Update data push and pull to always run a preliminary check of project_id from local config against bucket@s3_path/.project_id

  • If hashes match, proceed with operation
  • If hashes don't match, exit with a warning
@zstumgoren zstumgoren added this to the 0.2 milestone Mar 14, 2017
@zstumgoren zstumgoren self-assigned this Mar 14, 2017
@zstumgoren zstumgoren added ready and removed ready labels Mar 16, 2017
@zstumgoren
Copy link
Contributor Author

Agreed we should do this for v0.2.0. Removing Question label

@zstumgoren zstumgoren changed the title Add safeguard against S3 overwrites? Add safeguard against S3 overwrites Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant