Skip to content

Add safeguard against S3 overwrites #12

@zstumgoren

Description

@zstumgoren

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions