Skip to content

feat: add file public prekey directory - #25

Merged
intel352 merged 1 commit into
mainfrom
feat/signal-public-directory-file
Jul 3, 2026
Merged

intel352 merged 1 commit into
mainfrom
feat/signal-public-directory-file

Conversation

@intel352

@intel352 intel352 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an explicit file backend to signal.public_prekey_directory with storage_path and allow_file_backend contract fields.
  • Persists public pre-key directory entries as a schema-versioned checksum JSON snapshot using temp-file replacement.
  • Bumps release metadata to v0.16.0 and validates a file-backed public pre-key pipeline fixture.

Design

See workspace: docs/plans/2026-07-03-signal-public-directory-file-design.md

Implementation Plan

See workspace: docs/plans/2026-07-03-signal-public-directory-file.md

Scope Manifest

PR Count: 5
Tasks: 5
Status: Locked 2026-07-03T19:30:23Z
This PR row: 2 | Add Signal public directory file backend and release v0.16.0 | Task 2 | feat/signal-public-directory-file

Verification

  • go test ./internal -run 'PublicPreKey|ProviderDeclares|PluginJSONCapabilities' -count=1
  • go test ./... -count=1
  • make pipeline-test
  • wfctl plugin validate-contract --for-publish --tag v0.16.0 .
  • goreleaser check
  • git diff --check HEAD~1..HEAD

Regression Proof

With fix reverted:

  • go test ./internal -run 'PublicPreKey.*File|PublicPreKeyDirectoryRejectsCorrupt' -count=1 failed to build because StoragePath and AllowFileBackend were unknown fields on PublicPreKeyDirectoryConfig.

With fix restored:

  • go test ./internal -run 'PublicPreKey.*File|PublicPreKeyDirectoryRejectsCorrupt' -count=1 passed.

Doc-reconciliation: clean
Runtime launch validation: not triggered; plugin contract/code release path validated by tests and contract checks.
Secret hygiene: checked; no credential literals included.

Generated by the implementing agent.

Copilot AI review requested due to automatic review settings July 3, 2026 19:41
@intel352
intel352 merged commit 17c764e into main Jul 3, 2026
4 checks passed
@intel352
intel352 deleted the feat/signal-public-directory-file branch July 3, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a durable (opt-in) file backend for the Signal public pre-key directory module, including contract/schema updates, persistence/reload behavior, and version bumping for the upcoming release.

Changes:

  • Introduces file backend support for signal.public_prekey_directory with storage_path and allow_file_backend contract fields, plus load/persist logic.
  • Adds tests and a pipeline fixture covering file-backed publish/resolve and snapshot corruption handling.
  • Bumps release metadata/versioning to v0.16.0 across plugin metadata and build tooling.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/pipelines/signal-public-prekeys.yaml Adds a file-backed public pre-key directory module and a file-backed publish/resolve pipeline fixture.
README.md Documents the new explicit file backend requirements and production policy behavior.
plugin.json Updates plugin version and release artifact URLs to v0.16.0.
Makefile Bumps VERSION to 0.16.0 for builds and pipeline tests.
internal/public_prekey_directory.go Implements file backend: schema/checksum snapshot persistence, reload on init, and config validation.
internal/public_prekey_directory_test.go Adds persistence/reload, unsafe config, corruption rejection, and temp-file behavior tests for the file backend.
internal/contracts/signal.proto Extends PublicPreKeyDirectoryConfig with storage_path and allow_file_backend.
internal/contracts/signal.pb.go Regenerates Go bindings for the updated contract.
Files not reviewed (1)
  • internal/contracts/signal.pb.go: Generated file

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

Comment on lines +359 to +366
tmp := d.storagePath + ".tmp"
if err := os.WriteFile(tmp, raw, 0o600); err != nil {
return fmt.Errorf("write public directory temp file: %w", err)
}
if err := os.Rename(tmp, d.storagePath); err != nil {
return fmt.Errorf("replace public directory file: %w", err)
}
return nil
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