Skip to content

feat: Add binary data support for secrets#154

Open
freeznet wants to merge 4 commits into
mainfrom
freeznet/binary-secret-support
Open

feat: Add binary data support for secrets#154
freeznet wants to merge 4 commits into
mainfrom
freeznet/binary-secret-support

Conversation

@freeznet
Copy link
Copy Markdown
Member

No description provided.

@freeznet freeznet self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 14:45
@freeznet freeznet requested a review from a team as a code owner May 18, 2026 14:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Terraform provider support for supplying write-only base64-encoded binary secret data, backed by updated StreamNative API dependencies.

Changes:

  • Adds binary_data schema, validation, state preservation, and secret payload construction.
  • Updates docs and examples to show binary secret usage.
  • Updates related dependencies and adds unit coverage for binary secret behavior.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cloud/resource_secret.go Adds binary_data resource support and duplicate key validation.
cloud/provider.go Adds the binary_data attribute description.
cloud/secret_state_test.go Adds unit tests for binary data schema, validation, and state behavior.
docs/resources/secret.md Documents the new binary_data resource attribute.
examples/secrets/main.tf Updates the secret example to use string_data and binary_data.
go.mod Updates API/operator dependencies needed for binary secret support.
go.sum Updates checksums for dependency changes.
.gitignore Ignores root-level PLAN.md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/secrets/main.tf Outdated
Comment on lines +42 to +43
binary_data = {
"cert.p12" = filebase64("./cert.p12")
Comment thread cloud/resource_secret.go Outdated
Comment on lines +227 to +239
seen := make(map[string]string)
for _, field := range []string{"data", "string_data", "binary_data"} {
keys, configured := configuredSecretDataKeys(diff, field)
if !configured {
continue
}
for key := range keys {
if existingField, ok := seen[key]; ok {
return fmt.Errorf("secret data key %q is configured in both %q and %q", key, existingField, field)
}
seen[key] = field
}
}
Comment thread cloud/resource_secret.go
Comment on lines +337 to +340
if includeUnset || d.HasChange("binary_data") {
if binaryDataRaw, ok := d.GetOk("binary_data"); ok {
secret.BinaryData = convertToStringMap(binaryDataRaw.(map[string]interface{}))
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants