From dba7d8dca2c24ccbdbe6b8d0c478248e140ac0e7 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 9 Sep 2022 10:36:41 -0500 Subject: [PATCH 01/15] Add more hash outputs of file content Closes #137 --- internal/provider/data_source_local_file.go | 47 +++++++++++++++++++ .../provider/data_source_local_file_test.go | 15 ++++++ .../data_source_local_sensitive_file.go | 30 ++++++++++++ 3 files changed, 92 insertions(+) diff --git a/internal/provider/data_source_local_file.go b/internal/provider/data_source_local_file.go index 9c4a3423..430a5fcf 100644 --- a/internal/provider/data_source_local_file.go +++ b/internal/provider/data_source_local_file.go @@ -1,7 +1,10 @@ package provider import ( + "crypto/md5" "crypto/sha1" + "crypto/sha256" + "crypto/sha512" "encoding/base64" "encoding/hex" "io/ioutil" @@ -32,6 +35,36 @@ func dataSourceLocalFile() *schema.Resource { Description: "Base64 encoded version of the file content (use this when dealing with binary data).", Computed: true, }, + "content_md5": { + Type: schema.TypeString, + Description: "MD5 checksum of file content.", + Computed: true, + }, + "content_sha1": { + Type: schema.TypeString, + Description: "SHA1 checksum of file content.", + Computed: true, + }, + "content_sha256": { + Type: schema.TypeString, + Description: "SHA256 checksum of file content.", + Computed: true, + }, + "content_base64sha256": { + Type: schema.TypeString, + Description: "Base64 encoded SHA256 checksum of file content.", + Computed: true, + }, + "content_sha512": { + Type: schema.TypeString, + Description: "SHA512 checksum of file content.", + Computed: true, + }, + "content_base64sha512": { + Type: schema.TypeString, + Description: "Base64 encoded SHA512 checksum of file content.", + Computed: true, + }, }, } } @@ -48,6 +81,20 @@ func dataSourceLocalFileRead(d *schema.ResourceData, _ interface{}) error { d.Set("content", string(content)) d.Set("content_base64", base64.StdEncoding.EncodeToString(content)) + md5Sum := md5.Sum(content) + d.Set("content_md5", hex.EncodeToString(md5Sum[:])) + + sha1Sum := sha1.Sum(content) + d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) + + sha256Sum := sha256.Sum256(content) + d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) + d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) + + sha512Sum := sha512.Sum512(content) + d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) + d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) + // Use the hexadecimal encoding of the checksum of the file content as ID checksum := sha1.Sum(content) d.SetId(hex.EncodeToString(checksum[:])) diff --git a/internal/provider/data_source_local_file_test.go b/internal/provider/data_source_local_file_test.go index d478f58e..cada7ebf 100644 --- a/internal/provider/data_source_local_file_test.go +++ b/internal/provider/data_source_local_file_test.go @@ -1,7 +1,12 @@ package provider import ( + "crypto/md5" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" "encoding/base64" + "encoding/hex" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -9,6 +14,10 @@ import ( func TestLocalFileDataSource(t *testing.T) { content := "This is some content" + md5Sum := md5.Sum([]byte(content)) + sha1Sum := sha1.Sum([]byte(content)) + sha256Sum := sha256.Sum256([]byte(content)) + sha512Sum := sha512.Sum512([]byte(content)) config := ` data "local_file" "file" { @@ -24,6 +33,12 @@ func TestLocalFileDataSource(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("data.local_file.file", "content", content), resource.TestCheckResourceAttr("data.local_file.file", "content_base64", base64.StdEncoding.EncodeToString([]byte(content))), + resource.TestCheckResourceAttr("data.local_file.file", "content_md5", hex.EncodeToString(md5Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha1", hex.EncodeToString(sha1Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha256", hex.EncodeToString(sha256Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha512", hex.EncodeToString(sha512Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])), ), }, }, diff --git a/internal/provider/data_source_local_sensitive_file.go b/internal/provider/data_source_local_sensitive_file.go index 4c8017cf..23f6ccd9 100644 --- a/internal/provider/data_source_local_sensitive_file.go +++ b/internal/provider/data_source_local_sensitive_file.go @@ -29,6 +29,36 @@ func dataSourceLocalSensitiveFile() *schema.Resource { Sensitive: true, Computed: true, }, + "content_md5": { + Type: schema.TypeString, + Description: "MD5 checksum of file content.", + Computed: true, + }, + "content_sha1": { + Type: schema.TypeString, + Description: "SHA1 checksum of file content.", + Computed: true, + }, + "content_sha256": { + Type: schema.TypeString, + Description: "SHA256 checksum of file content.", + Computed: true, + }, + "content_base64sha256": { + Type: schema.TypeString, + Description: "Base64 encoded SHA256 checksum of file content.", + Computed: true, + }, + "content_sha512": { + Type: schema.TypeString, + Description: "SHA512 checksum of file content.", + Computed: true, + }, + "content_base64sha512": { + Type: schema.TypeString, + Description: "Base64 encoded SHA512 checksum of file content.", + Computed: true, + }, }, } } From b898e37aef9faaca598346e8128afb24e1bbeda1 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 9 Sep 2022 13:34:18 -0500 Subject: [PATCH 02/15] Add hash outputs to resource --- internal/provider/resource_local_file.go | 61 +++++++++++++++++++ .../provider/resource_local_sensitive_file.go | 30 +++++++++ 2 files changed, 91 insertions(+) diff --git a/internal/provider/resource_local_file.go b/internal/provider/resource_local_file.go index 4f69a71a..e8cba353 100644 --- a/internal/provider/resource_local_file.go +++ b/internal/provider/resource_local_file.go @@ -1,7 +1,10 @@ package provider import ( + "crypto/md5" "crypto/sha1" + "crypto/sha256" + "crypto/sha512" "encoding/base64" "encoding/hex" "io/ioutil" @@ -77,6 +80,36 @@ func resourceLocalFile() *schema.Resource { ValidateFunc: validateModePermission, Description: "Permissions to set for directories created (in numeric notation).", }, + "content_md5": { + Type: schema.TypeString, + Description: "MD5 checksum of file content.", + Computed: true, + }, + "content_sha1": { + Type: schema.TypeString, + Description: "SHA1 checksum of file content.", + Computed: true, + }, + "content_sha256": { + Type: schema.TypeString, + Description: "SHA256 checksum of file content.", + Computed: true, + }, + "content_base64sha256": { + Type: schema.TypeString, + Description: "Base64 encoded SHA256 checksum of file content.", + Computed: true, + }, + "content_sha512": { + Type: schema.TypeString, + Description: "SHA512 checksum of file content.", + Computed: true, + }, + "content_base64sha512": { + Type: schema.TypeString, + Description: "Base64 encoded SHA512 checksum of file content.", + Computed: true, + }, }, } } @@ -97,6 +130,20 @@ func resourceLocalFileRead(d *schema.ResourceData, _ interface{}) error { return err } + md5Sum := md5.Sum(outputContent) + d.Set("content_md5", hex.EncodeToString(md5Sum[:])) + + sha1Sum := sha1.Sum(outputContent) + d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) + + sha256Sum := sha256.Sum256(outputContent) + d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) + d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) + + sha512Sum := sha512.Sum512(outputContent) + d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) + d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) + outputChecksum := sha1.Sum(outputContent) if hex.EncodeToString(outputChecksum[:]) != d.Id() { d.SetId("") @@ -148,6 +195,20 @@ func resourceLocalFileCreate(d *schema.ResourceData, _ interface{}) error { return err } + md5Sum := md5.Sum(content) + d.Set("content_md5", hex.EncodeToString(md5Sum[:])) + + sha1Sum := sha1.Sum(content) + d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) + + sha256Sum := sha256.Sum256(content) + d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) + d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) + + sha512Sum := sha512.Sum512(content) + d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) + d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) + checksum := sha1.Sum(content) d.SetId(hex.EncodeToString(checksum[:])) diff --git a/internal/provider/resource_local_sensitive_file.go b/internal/provider/resource_local_sensitive_file.go index b42ccf4e..9e80bba5 100644 --- a/internal/provider/resource_local_sensitive_file.go +++ b/internal/provider/resource_local_sensitive_file.go @@ -62,6 +62,36 @@ func resourceLocalSensitiveFile() *schema.Resource { ValidateFunc: validateModePermission, Description: "Permissions to set for directories created (in numeric notation).", }, + "content_md5": { + Type: schema.TypeString, + Description: "MD5 checksum of file content.", + Computed: true, + }, + "content_sha1": { + Type: schema.TypeString, + Description: "SHA1 checksum of file content.", + Computed: true, + }, + "content_sha256": { + Type: schema.TypeString, + Description: "SHA256 checksum of file content.", + Computed: true, + }, + "content_base64sha256": { + Type: schema.TypeString, + Description: "Base64 encoded SHA256 checksum of file content.", + Computed: true, + }, + "content_sha512": { + Type: schema.TypeString, + Description: "SHA512 checksum of file content.", + Computed: true, + }, + "content_base64sha512": { + Type: schema.TypeString, + Description: "Base64 encoded SHA512 checksum of file content.", + Computed: true, + }, }, } } From ea7a773a41eaf8f3e257974a9fbbd4ca7eecbe35 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Tue, 13 Sep 2022 15:46:49 -0500 Subject: [PATCH 03/15] Incapsulate Sum functions inside function --- internal/provider/data_source_local_file.go | 28 +++----- internal/provider/resource_local_file.go | 77 ++++++++++++--------- 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/internal/provider/data_source_local_file.go b/internal/provider/data_source_local_file.go index 430a5fcf..1de3a7d4 100644 --- a/internal/provider/data_source_local_file.go +++ b/internal/provider/data_source_local_file.go @@ -1,12 +1,7 @@ package provider import ( - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" "encoding/base64" - "encoding/hex" "io/ioutil" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -81,23 +76,16 @@ func dataSourceLocalFileRead(d *schema.ResourceData, _ interface{}) error { d.Set("content", string(content)) d.Set("content_base64", base64.StdEncoding.EncodeToString(content)) - md5Sum := md5.Sum(content) - d.Set("content_md5", hex.EncodeToString(md5Sum[:])) - - sha1Sum := sha1.Sum(content) - d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) - - sha256Sum := sha256.Sum256(content) - d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) - d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) - - sha512Sum := sha512.Sum512(content) - d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) - d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) + checksums := genFileChecksums(content) + d.Set("content_md5", checksums.md5Hex) + d.Set("content_sha1", checksums.sha1Hex) + d.Set("content_sha256", checksums.sha256Hex) + d.Set("content_base64sha256", checksums.sha256Base64) + d.Set("content_sha512", checksums.sha512Hex) + d.Set("content_base64sha512", checksums.sha512Base64) // Use the hexadecimal encoding of the checksum of the file content as ID - checksum := sha1.Sum(content) - d.SetId(hex.EncodeToString(checksum[:])) + d.SetId(checksums.sha1Hex) return nil } diff --git a/internal/provider/resource_local_file.go b/internal/provider/resource_local_file.go index e8cba353..d1d8efbf 100644 --- a/internal/provider/resource_local_file.go +++ b/internal/provider/resource_local_file.go @@ -130,22 +130,15 @@ func resourceLocalFileRead(d *schema.ResourceData, _ interface{}) error { return err } - md5Sum := md5.Sum(outputContent) - d.Set("content_md5", hex.EncodeToString(md5Sum[:])) - - sha1Sum := sha1.Sum(outputContent) - d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) - - sha256Sum := sha256.Sum256(outputContent) - d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) - d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) - - sha512Sum := sha512.Sum512(outputContent) - d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) - d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) - - outputChecksum := sha1.Sum(outputContent) - if hex.EncodeToString(outputChecksum[:]) != d.Id() { + checksums := genFileChecksums(outputContent) + d.Set("content_md5", checksums.md5Hex) + d.Set("content_sha1", checksums.sha1Hex) + d.Set("content_sha256", checksums.sha256Hex) + d.Set("content_base64sha256", checksums.sha256Base64) + d.Set("content_sha512", checksums.sha512Hex) + d.Set("content_base64sha512", checksums.sha512Base64) + + if checksums.sha1Hex != d.Id() { d.SetId("") return nil } @@ -195,22 +188,15 @@ func resourceLocalFileCreate(d *schema.ResourceData, _ interface{}) error { return err } - md5Sum := md5.Sum(content) - d.Set("content_md5", hex.EncodeToString(md5Sum[:])) + checksums := genFileChecksums(content) + d.Set("content_md5", checksums.md5Hex) + d.Set("content_sha1", checksums.sha1Hex) + d.Set("content_sha256", checksums.sha256Hex) + d.Set("content_base64sha256", checksums.sha256Base64) + d.Set("content_sha512", checksums.sha512Hex) + d.Set("content_base64sha512", checksums.sha512Base64) - sha1Sum := sha1.Sum(content) - d.Set("content_sha1", hex.EncodeToString(sha1Sum[:])) - - sha256Sum := sha256.Sum256(content) - d.Set("content_sha256", hex.EncodeToString(sha256Sum[:])) - d.Set("content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])) - - sha512Sum := sha512.Sum512(content) - d.Set("content_sha512", hex.EncodeToString(sha512Sum[:])) - d.Set("content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])) - - checksum := sha1.Sum(content) - d.SetId(hex.EncodeToString(checksum[:])) + d.SetId(checksums.sha1Hex) return nil } @@ -219,3 +205,32 @@ func resourceLocalFileDelete(d *schema.ResourceData, _ interface{}) error { os.Remove(d.Get("filename").(string)) return nil } + +type fileChecksums struct { + md5Hex string + sha1Hex string + sha256Hex string + sha256Base64 string + sha512Hex string + sha512Base64 string +} + +func genFileChecksums(data []byte) fileChecksums { + checksums := fileChecksums{} + + md5Sum := md5.Sum(data) + checksums.md5Hex = hex.EncodeToString(md5Sum[:]) + + sha1Sum := sha1.Sum(data) + checksums.sha1Hex = hex.EncodeToString(sha1Sum[:]) + + sha256Sum := sha256.Sum256(data) + checksums.sha256Hex = hex.EncodeToString(sha256Sum[:]) + checksums.sha256Base64 = base64.StdEncoding.EncodeToString(sha256Sum[:]) + + sha512Sum := sha512.Sum512(data) + checksums.sha512Hex = hex.EncodeToString(sha512Sum[:]) + checksums.sha512Base64 = base64.StdEncoding.EncodeToString(sha512Sum[:]) + + return checksums +} From 58c70cae72e44a7f751727d06c5ac39890b76909 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Wed, 14 Sep 2022 08:56:22 -0500 Subject: [PATCH 04/15] update docs --- website/docs/d/file.html.md | 14 +++++++++++++- website/docs/d/sensitive_file.html.md | 14 +++++++++++++- website/docs/r/file.html.md | 16 ++++++++++++++++ website/docs/r/sensitive_file.html.md | 16 ++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/website/docs/d/file.html.md b/website/docs/d/file.html.md index e74b2099..a23a89a7 100644 --- a/website/docs/d/file.html.md +++ b/website/docs/d/file.html.md @@ -32,7 +32,7 @@ The following arguments are supported: ## Attributes Exported -The following attribute is exported: +The following attributes are exported: * `content` - Raw content of the file that was read, assumed by Terraform to be UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in `content` @@ -40,3 +40,15 @@ The following attribute is exported: * `content_base64` - Base64 encoded version of the file content. Use this when dealing with binary data. + +* `content_md5` - MD5 checksum of file content. + +* `content_sha1` - SHA1 checksum of file content. + +* `content_sha256` - SHA256 checksum of file content. + +* `content_base64sha256` - Base64 encoded SHA256 checksum of file content. + +* `content_sha512` - SHA512 checksum of file content. + +* `content_base64sha512` - Base64 encoded SHA512 checksum of file content. diff --git a/website/docs/d/sensitive_file.html.md b/website/docs/d/sensitive_file.html.md index 5c0c8968..696ce529 100644 --- a/website/docs/d/sensitive_file.html.md +++ b/website/docs/d/sensitive_file.html.md @@ -34,7 +34,7 @@ The following arguments are supported: ## Attributes Exported -The following attribute is exported: +The following attributes are exported: * `content` - Raw content of the file that was read, assumed by Terraform to be UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in `content` @@ -42,3 +42,15 @@ The following attribute is exported: * `content_base64` - Base64 encoded version of the file content. Use this when dealing with binary data. + +* `content_md5` - MD5 checksum of file content. + +* `content_sha1` - SHA1 checksum of file content. + +* `content_sha256` - SHA256 checksum of file content. + +* `content_base64sha256` - Base64 encoded SHA256 checksum of file content. + +* `content_sha512` - SHA512 checksum of file content. + +* `content_base64sha512` - Base64 encoded SHA512 checksum of file content. diff --git a/website/docs/r/file.html.md b/website/docs/r/file.html.md index ac777805..fb20937c 100644 --- a/website/docs/r/file.html.md +++ b/website/docs/r/file.html.md @@ -66,3 +66,19 @@ The following arguments are supported: * `directory_permission` - (Optional) Permissions to set for directories created, expressed as string in [numeric notation](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation). Default value is `"0777"`. + +## Attributes Exported + +The following attributes are exported: + +* `content_md5` - MD5 checksum of file content. + +* `content_sha1` - SHA1 checksum of file content. + +* `content_sha256` - SHA256 checksum of file content. + +* `content_base64sha256` - Base64 encoded SHA256 checksum of file content. + +* `content_sha512` - SHA512 checksum of file content. + +* `content_base64sha512` - Base64 encoded SHA512 checksum of file content. diff --git a/website/docs/r/sensitive_file.html.md b/website/docs/r/sensitive_file.html.md index bc6eed01..42c79422 100644 --- a/website/docs/r/sensitive_file.html.md +++ b/website/docs/r/sensitive_file.html.md @@ -58,3 +58,19 @@ The following arguments are supported: * `directory_permission` - (Optional) Permissions to set for directories created, expressed as string in [numeric notation](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation). Default value is `"0700"`. + +## Attributes Exported + +The following attributes are exported: + +* `content_md5` - MD5 checksum of file content. + +* `content_sha1` - SHA1 checksum of file content. + +* `content_sha256` - SHA256 checksum of file content. + +* `content_base64sha256` - Base64 encoded SHA256 checksum of file content. + +* `content_sha512` - SHA512 checksum of file content. + +* `content_base64sha512` - Base64 encoded SHA512 checksum of file content. From 9898b3a8ce089eaaf909a99220a7fa553c6caaa3 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 16 Sep 2022 14:09:27 -0500 Subject: [PATCH 05/15] Use actual values in testing instead of generating values --- .../provider/data_source_local_file_test.go | 24 +++++---------- internal/provider/resource_local_file_test.go | 30 +++++++++++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/internal/provider/data_source_local_file_test.go b/internal/provider/data_source_local_file_test.go index cada7ebf..ea8ac32f 100644 --- a/internal/provider/data_source_local_file_test.go +++ b/internal/provider/data_source_local_file_test.go @@ -1,12 +1,6 @@ package provider import ( - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "encoding/base64" - "encoding/hex" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -14,10 +8,6 @@ import ( func TestLocalFileDataSource(t *testing.T) { content := "This is some content" - md5Sum := md5.Sum([]byte(content)) - sha1Sum := sha1.Sum([]byte(content)) - sha256Sum := sha256.Sum256([]byte(content)) - sha512Sum := sha512.Sum512([]byte(content)) config := ` data "local_file" "file" { @@ -32,13 +22,13 @@ func TestLocalFileDataSource(t *testing.T) { Config: config, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("data.local_file.file", "content", content), - resource.TestCheckResourceAttr("data.local_file.file", "content_base64", base64.StdEncoding.EncodeToString([]byte(content))), - resource.TestCheckResourceAttr("data.local_file.file", "content_md5", hex.EncodeToString(md5Sum[:])), - resource.TestCheckResourceAttr("data.local_file.file", "content_sha1", hex.EncodeToString(sha1Sum[:])), - resource.TestCheckResourceAttr("data.local_file.file", "content_sha256", hex.EncodeToString(sha256Sum[:])), - resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha256", base64.StdEncoding.EncodeToString(sha256Sum[:])), - resource.TestCheckResourceAttr("data.local_file.file", "content_sha512", hex.EncodeToString(sha512Sum[:])), - resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha512", base64.StdEncoding.EncodeToString(sha512Sum[:])), + resource.TestCheckResourceAttr("data.local_file.file", "content_base64", "VGhpcyBpcyBzb21lIGNvbnRlbnQ="), + resource.TestCheckResourceAttr("data.local_file.file", "content_md5", "ee428920507e39e8d89c2cabe6641b67"), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha1", "f3705a38abd5d2bd1f4fecda606d216216c536b1"), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha256", "d68e560efbe6f20c31504b2fc1c6d3afa1f58b8ee293ad3311939a5fd5059a12"), + resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha256", "1o5WDvvm8gwxUEsvwcbTr6H1i47ik60zEZOaX9UFmhI="), + resource.TestCheckResourceAttr("data.local_file.file", "content_sha512", "217150cec0dac8ba2d640eeb80f12407c3b9362650e716bc568fcd2cca0fd951db25fd4aa0aefa6454803697ecb74fd3dc8b36bd2c2e5a3a3ac2456e3017728d"), + resource.TestCheckResourceAttr("data.local_file.file", "content_base64sha512", "IXFQzsDayLotZA7rgPEkB8O5NiZQ5xa8Vo/NLMoP2VHbJf1KoK76ZFSANpfst0/T3Is2vSwuWjo6wkVuMBdyjQ=="), ), }, }, diff --git a/internal/provider/resource_local_file_test.go b/internal/provider/resource_local_file_test.go index ba4d61ed..8f3c88e3 100644 --- a/internal/provider/resource_local_file_test.go +++ b/internal/provider/resource_local_file_test.go @@ -183,3 +183,33 @@ func TestLocalFile_Permissions(t *testing.T) { CheckDestroy: checkFileDeleted(destinationFilePath), }) } + +func TestLocalFile_checksums(t *testing.T) { + content := "This is some content" + filename := filepath.Join(t.TempDir(), "local_file") + filename = strings.ReplaceAll(filename, `\`, `\\`) + + config := fmt.Sprintf(` + resource "local_file" "file" { + content = "%s" + filename = "%s" + }`, content, filename) + + r.UnitTest(t, r.TestCase{ + Providers: testProviders, + Steps: []r.TestStep{ + { + Config: config, + Check: r.ComposeAggregateTestCheckFunc( + r.TestCheckResourceAttr("local_file.file", "content_md5", "ee428920507e39e8d89c2cabe6641b67"), + r.TestCheckResourceAttr("local_file.file", "content_sha1", "f3705a38abd5d2bd1f4fecda606d216216c536b1"), + r.TestCheckResourceAttr("local_file.file", "content_sha256", "d68e560efbe6f20c31504b2fc1c6d3afa1f58b8ee293ad3311939a5fd5059a12"), + r.TestCheckResourceAttr("local_file.file", "content_base64sha256", "1o5WDvvm8gwxUEsvwcbTr6H1i47ik60zEZOaX9UFmhI="), + r.TestCheckResourceAttr("local_file.file", "content_sha512", "217150cec0dac8ba2d640eeb80f12407c3b9362650e716bc568fcd2cca0fd951db25fd4aa0aefa6454803697ecb74fd3dc8b36bd2c2e5a3a3ac2456e3017728d"), + r.TestCheckResourceAttr("local_file.file", "content_base64sha512", "IXFQzsDayLotZA7rgPEkB8O5NiZQ5xa8Vo/NLMoP2VHbJf1KoK76ZFSANpfst0/T3Is2vSwuWjo6wkVuMBdyjQ=="), + ), + }, + }, + CheckDestroy: checkFileDeleted(filename), + }) +} From ff8835725381b83473c4750b4c060c0cfbd46548 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Tue, 17 Jan 2023 09:19:57 -0600 Subject: [PATCH 06/15] generate docs --- docs/data-sources/file.md | 6 ++++++ docs/data-sources/sensitive_file.md | 6 ++++++ docs/resources/file.md | 6 ++++++ docs/resources/sensitive_file.md | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index bf43ca5a..842d9287 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -35,4 +35,10 @@ resource "aws_s3_object" "shared_zip" { - `content` (String) Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in `content` replaced with the Unicode replacement character. - `content_base64` (String) Base64 encoded version of the file content (use this when dealing with binary data). +- `content_base64sha256` (String) Base64 encoded SHA256 checksum of file content. +- `content_base64sha512` (String) Base64 encoded SHA512 checksum of file content. +- `content_md5` (String) MD5 checksum of file content. +- `content_sha1` (String) SHA1 checksum of file content. +- `content_sha256` (String) SHA256 checksum of file content. +- `content_sha512` (String) SHA512 checksum of file content. - `id` (String) The hexadecimal encoding of the checksum of the file content. \ No newline at end of file diff --git a/docs/data-sources/sensitive_file.md b/docs/data-sources/sensitive_file.md index a727606a..850f9120 100644 --- a/docs/data-sources/sensitive_file.md +++ b/docs/data-sources/sensitive_file.md @@ -38,4 +38,10 @@ resource "aws_s3_object" "shared_zip" { - `content` (String, Sensitive) Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in `content` replaced with the Unicode replacement character. - `content_base64` (String, Sensitive) Base64 encoded version of the file content (use this when dealing with binary data). +- `content_base64sha256` (String) Base64 encoded SHA256 checksum of file content. +- `content_base64sha512` (String) Base64 encoded SHA512 checksum of file content. +- `content_md5` (String) MD5 checksum of file content. +- `content_sha1` (String) SHA1 checksum of file content. +- `content_sha256` (String) SHA256 checksum of file content. +- `content_sha512` (String) SHA512 checksum of file content. - `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file diff --git a/docs/resources/file.md b/docs/resources/file.md index d9094f46..6f244d09 100644 --- a/docs/resources/file.md +++ b/docs/resources/file.md @@ -67,4 +67,10 @@ resource "local_file" "foo" { ### Read-Only +- `content_base64sha256` (String) Base64 encoded SHA256 checksum of file content. +- `content_base64sha512` (String) Base64 encoded SHA512 checksum of file content. +- `content_md5` (String) MD5 checksum of file content. +- `content_sha1` (String) SHA1 checksum of file content. +- `content_sha256` (String) SHA256 checksum of file content. +- `content_sha512` (String) SHA512 checksum of file content. - `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file diff --git a/docs/resources/sensitive_file.md b/docs/resources/sensitive_file.md index 1f19a57f..58248e08 100644 --- a/docs/resources/sensitive_file.md +++ b/docs/resources/sensitive_file.md @@ -61,4 +61,10 @@ resource "local_sensitive_file" "foo" { ### Read-Only +- `content_base64sha256` (String) Base64 encoded SHA256 checksum of file content. +- `content_base64sha512` (String) Base64 encoded SHA512 checksum of file content. +- `content_md5` (String) MD5 checksum of file content. +- `content_sha1` (String) SHA1 checksum of file content. +- `content_sha256` (String) SHA256 checksum of file content. +- `content_sha512` (String) SHA512 checksum of file content. - `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file From ef5261a6703769e68e799ea1067c0cf7da9b753b Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:20:18 -0600 Subject: [PATCH 07/15] Apply suggestions from code review Co-authored-by: Selena Goods --- internal/provider/data_source_local_file.go | 2 +- internal/provider/data_source_local_sensitive_file.go | 2 +- internal/provider/resource_local_sensitive_file.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/provider/data_source_local_file.go b/internal/provider/data_source_local_file.go index f8c8fd4a..1c4db19c 100644 --- a/internal/provider/data_source_local_file.go +++ b/internal/provider/data_source_local_file.go @@ -39,7 +39,7 @@ func (n *localFileDataSource) Schema(ctx context.Context, req datasource.SchemaR Computed: true, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the checksum of the file content.", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content.", Computed: true, }, "content_md5": schema.StringAttribute{ diff --git a/internal/provider/data_source_local_sensitive_file.go b/internal/provider/data_source_local_sensitive_file.go index e4b98967..b9cc8bb8 100644 --- a/internal/provider/data_source_local_sensitive_file.go +++ b/internal/provider/data_source_local_sensitive_file.go @@ -45,7 +45,7 @@ func (n *localSensitiveFileDataSource) Schema(ctx context.Context, req datasourc Computed: true, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the checksum of the file content", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content", Computed: true, }, "content_md5": schema.StringAttribute{ diff --git a/internal/provider/resource_local_sensitive_file.go b/internal/provider/resource_local_sensitive_file.go index 026d3fcc..e143d6d7 100644 --- a/internal/provider/resource_local_sensitive_file.go +++ b/internal/provider/resource_local_sensitive_file.go @@ -115,7 +115,7 @@ func (n *localSensitiveFileResource) Schema(ctx context.Context, req resource.Sc }, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the checksum of the file content", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content", Computed: true, }, "content_md5": schema.StringAttribute{ From b7cb1f045b6c70f973645b549321f6662c2ff580 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:21:47 -0600 Subject: [PATCH 08/15] Review suggestion --- internal/provider/resource_local_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_local_file.go b/internal/provider/resource_local_file.go index 3045cbcc..1b2590d2 100644 --- a/internal/provider/resource_local_file.go +++ b/internal/provider/resource_local_file.go @@ -114,7 +114,7 @@ func (n *localFileResource) Schema(ctx context.Context, req resource.SchemaReque }, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the checksum of the file content", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content.", Computed: true, }, "sensitive_content": schema.StringAttribute{ From 3a0c45bcf594a3d761d978ce54272222e656b545 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:22:00 -0600 Subject: [PATCH 09/15] generate docs --- docs/data-sources/file.md | 2 +- docs/data-sources/sensitive_file.md | 2 +- docs/resources/file.md | 2 +- docs/resources/sensitive_file.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index 842d9287..ce9a064e 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -41,4 +41,4 @@ resource "aws_s3_object" "shared_zip" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the checksum of the file content. \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content. \ No newline at end of file diff --git a/docs/data-sources/sensitive_file.md b/docs/data-sources/sensitive_file.md index 850f9120..8b238800 100644 --- a/docs/data-sources/sensitive_file.md +++ b/docs/data-sources/sensitive_file.md @@ -44,4 +44,4 @@ resource "aws_s3_object" "shared_zip" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content \ No newline at end of file diff --git a/docs/resources/file.md b/docs/resources/file.md index 6f244d09..c7a340a4 100644 --- a/docs/resources/file.md +++ b/docs/resources/file.md @@ -73,4 +73,4 @@ resource "local_file" "foo" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content. \ No newline at end of file diff --git a/docs/resources/sensitive_file.md b/docs/resources/sensitive_file.md index 58248e08..facea615 100644 --- a/docs/resources/sensitive_file.md +++ b/docs/resources/sensitive_file.md @@ -67,4 +67,4 @@ resource "local_sensitive_file" "foo" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the checksum of the file content \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content \ No newline at end of file From db94aa1f2280b73068ad26fc106361a82069d2f1 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:23:54 -0600 Subject: [PATCH 10/15] Remove hashes from resource_local_file.Read function --- internal/provider/resource_local_file.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/internal/provider/resource_local_file.go b/internal/provider/resource_local_file.go index 1b2590d2..88aaf909 100644 --- a/internal/provider/resource_local_file.go +++ b/internal/provider/resource_local_file.go @@ -2,7 +2,9 @@ package provider import ( "context" + "crypto/sha1" "encoding/base64" + "encoding/hex" "fmt" "os" "path/filepath" @@ -260,15 +262,8 @@ func (n *localFileResource) Read(ctx context.Context, req resource.ReadRequest, return } - checksums := genFileChecksums(outputContent) - state.ContentMd5 = types.StringValue(checksums.md5Hex) - state.ContentSha1 = types.StringValue(checksums.sha1Hex) - state.ContentSha256 = types.StringValue(checksums.sha256Hex) - state.ContentBase64sha256 = types.StringValue(checksums.sha256Base64) - state.ContentSha512 = types.StringValue(checksums.sha512Hex) - state.ContentBase64sha512 = types.StringValue(checksums.sha512Base64) - - if checksums.sha1Hex != state.ID.ValueString() { + outputChecksum := sha1.Sum(outputContent) + if hex.EncodeToString(outputChecksum[:]) != state.ID.ValueString() { resp.State.RemoveResource(ctx) return } From a7e61f9a9857f04523fa38a0efe5b10925e74d70 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:31:17 -0600 Subject: [PATCH 11/15] declare empty struct with var --- internal/provider/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index e2188356..a89319cb 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -61,7 +61,7 @@ type fileChecksums struct { } func genFileChecksums(data []byte) fileChecksums { - checksums := fileChecksums{} + var checksums fileChecksums md5Sum := md5.Sum(data) checksums.md5Hex = hex.EncodeToString(md5Sum[:]) From 3677dc324fadf03df6fa2bf3c07ee7fdd1f150e7 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Fri, 27 Jan 2023 08:38:12 -0600 Subject: [PATCH 12/15] forgot period --- docs/data-sources/sensitive_file.md | 2 +- docs/resources/sensitive_file.md | 2 +- internal/provider/data_source_local_sensitive_file.go | 2 +- internal/provider/resource_local_sensitive_file.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/data-sources/sensitive_file.md b/docs/data-sources/sensitive_file.md index 8b238800..83da4be7 100644 --- a/docs/data-sources/sensitive_file.md +++ b/docs/data-sources/sensitive_file.md @@ -44,4 +44,4 @@ resource "aws_s3_object" "shared_zip" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content. \ No newline at end of file diff --git a/docs/resources/sensitive_file.md b/docs/resources/sensitive_file.md index facea615..8f211dfe 100644 --- a/docs/resources/sensitive_file.md +++ b/docs/resources/sensitive_file.md @@ -67,4 +67,4 @@ resource "local_sensitive_file" "foo" { - `content_sha1` (String) SHA1 checksum of file content. - `content_sha256` (String) SHA256 checksum of file content. - `content_sha512` (String) SHA512 checksum of file content. -- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content \ No newline at end of file +- `id` (String) The hexadecimal encoding of the SHA1 checksum of the file content. \ No newline at end of file diff --git a/internal/provider/data_source_local_sensitive_file.go b/internal/provider/data_source_local_sensitive_file.go index b9cc8bb8..cb2f5d92 100644 --- a/internal/provider/data_source_local_sensitive_file.go +++ b/internal/provider/data_source_local_sensitive_file.go @@ -45,7 +45,7 @@ func (n *localSensitiveFileDataSource) Schema(ctx context.Context, req datasourc Computed: true, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the SHA1 checksum of the file content", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content.", Computed: true, }, "content_md5": schema.StringAttribute{ diff --git a/internal/provider/resource_local_sensitive_file.go b/internal/provider/resource_local_sensitive_file.go index e143d6d7..99270920 100644 --- a/internal/provider/resource_local_sensitive_file.go +++ b/internal/provider/resource_local_sensitive_file.go @@ -115,7 +115,7 @@ func (n *localSensitiveFileResource) Schema(ctx context.Context, req resource.Sc }, }, "id": schema.StringAttribute{ - Description: "The hexadecimal encoding of the SHA1 checksum of the file content", + Description: "The hexadecimal encoding of the SHA1 checksum of the file content.", Computed: true, }, "content_md5": schema.StringAttribute{ From 7e7d4611eafb0e3e716216dabe7f2871211b5f40 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Wed, 8 Feb 2023 10:00:20 -0600 Subject: [PATCH 13/15] add missing tests --- internal/provider/data_source_local_sensitive_file_test.go | 7 +++++++ internal/provider/provider_test.go | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/internal/provider/data_source_local_sensitive_file_test.go b/internal/provider/data_source_local_sensitive_file_test.go index 58780e9a..5517a141 100644 --- a/internal/provider/data_source_local_sensitive_file_test.go +++ b/internal/provider/data_source_local_sensitive_file_test.go @@ -11,6 +11,7 @@ import ( func TestLocalFileSensitiveDataSource(t *testing.T) { testFileContent := "This is some content" + checkSums := genFileChecksums([]byte(testFileContent)) config := ` data "local_sensitive_file" "file" { @@ -26,6 +27,12 @@ func TestLocalFileSensitiveDataSource(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content", testFileContent), resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_base64", base64.StdEncoding.EncodeToString([]byte(testFileContent))), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_md5", checkSums.md5Hex), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_sha1", checkSums.sha1Hex), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_sha256", checkSums.sha256Hex), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_base64sha256", checkSums.sha256Base64), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_sha512", checkSums.sha512Hex), + resource.TestCheckResourceAttr("data.local_sensitive_file.file", "content_base64sha512", checkSums.sha512Base64), ), }, }, diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 44c4e4b2..95d2a367 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -42,8 +42,15 @@ func checkFileCreation(resourceName, path string) resource.TestCheckFunc { if err != nil { return fmt.Errorf("Error occurred while reading file at path: %s\n, error: %s\n", path, err) } + checkSums := genFileChecksums([]byte(resultContent)) resource.TestCheckResourceAttr(resourceName, "content", string(resultContent)) + resource.TestCheckResourceAttr(resourceName, "content_md5", checkSums.md5Hex) + resource.TestCheckResourceAttr(resourceName, "content_sha1", checkSums.sha1Hex) + resource.TestCheckResourceAttr(resourceName, "content_sha256", checkSums.sha256Hex) + resource.TestCheckResourceAttr(resourceName, "content_base64sha256", checkSums.sha256Base64) + resource.TestCheckResourceAttr(resourceName, "content_sha512", checkSums.sha512Hex) + resource.TestCheckResourceAttr(resourceName, "content_base64sha512", checkSums.sha512Base64) return nil } From 5d559cf74ead5d4786e21fb3d7c24ce188be5136 Mon Sep 17 00:00:00 2001 From: Zachary Whaley Date: Wed, 8 Feb 2023 14:23:27 -0600 Subject: [PATCH 14/15] Fix lint error --- internal/provider/provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 95d2a367..9517c5f0 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -42,7 +42,7 @@ func checkFileCreation(resourceName, path string) resource.TestCheckFunc { if err != nil { return fmt.Errorf("Error occurred while reading file at path: %s\n, error: %s\n", path, err) } - checkSums := genFileChecksums([]byte(resultContent)) + checkSums := genFileChecksums(resultContent) resource.TestCheckResourceAttr(resourceName, "content", string(resultContent)) resource.TestCheckResourceAttr(resourceName, "content_md5", checkSums.md5Hex) From 4a605b9e0015bf66efd4e282870fae583b98f2b9 Mon Sep 17 00:00:00 2001 From: SBGoods Date: Thu, 9 Feb 2023 11:14:58 -0500 Subject: [PATCH 15/15] Add Changelog entries --- .changes/unreleased/FEATURES-20230209-110755.yaml | 6 ++++++ .changes/unreleased/FEATURES-20230209-110940.yaml | 6 ++++++ .changes/unreleased/FEATURES-20230209-111044.yaml | 6 ++++++ .changes/unreleased/FEATURES-20230209-111108.yaml | 6 ++++++ 4 files changed, 24 insertions(+) create mode 100644 .changes/unreleased/FEATURES-20230209-110755.yaml create mode 100644 .changes/unreleased/FEATURES-20230209-110940.yaml create mode 100644 .changes/unreleased/FEATURES-20230209-111044.yaml create mode 100644 .changes/unreleased/FEATURES-20230209-111108.yaml diff --git a/.changes/unreleased/FEATURES-20230209-110755.yaml b/.changes/unreleased/FEATURES-20230209-110755.yaml new file mode 100644 index 00000000..dd785ea9 --- /dev/null +++ b/.changes/unreleased/FEATURES-20230209-110755.yaml @@ -0,0 +1,6 @@ +kind: FEATURES +body: 'resource/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` + checksum outputs.' +time: 2023-02-09T11:07:55.67622-05:00 +custom: + Issue: "142" diff --git a/.changes/unreleased/FEATURES-20230209-110940.yaml b/.changes/unreleased/FEATURES-20230209-110940.yaml new file mode 100644 index 00000000..26bf9278 --- /dev/null +++ b/.changes/unreleased/FEATURES-20230209-110940.yaml @@ -0,0 +1,6 @@ +kind: FEATURES +body: 'resource/local_sensitive_file: added support for `MD5`, `SHA1`, `SHA256`, and + `SHA512` checksum outputs.' +time: 2023-02-09T11:09:40.757015-05:00 +custom: + Issue: "142" diff --git a/.changes/unreleased/FEATURES-20230209-111044.yaml b/.changes/unreleased/FEATURES-20230209-111044.yaml new file mode 100644 index 00000000..b199192a --- /dev/null +++ b/.changes/unreleased/FEATURES-20230209-111044.yaml @@ -0,0 +1,6 @@ +kind: FEATURES +body: 'data-source/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` + checksum outputs.' +time: 2023-02-09T11:10:44.260895-05:00 +custom: + Issue: "142" diff --git a/.changes/unreleased/FEATURES-20230209-111108.yaml b/.changes/unreleased/FEATURES-20230209-111108.yaml new file mode 100644 index 00000000..8ca8a6ce --- /dev/null +++ b/.changes/unreleased/FEATURES-20230209-111108.yaml @@ -0,0 +1,6 @@ +kind: FEATURES +body: 'data-source/local_sensitive-file: added support for `MD5`, `SHA1`, `SHA256`, + and `SHA512` checksum outputs.' +time: 2023-02-09T11:11:08.992066-05:00 +custom: + Issue: "142"