feat: add Azure Blob Storage provider#37
Open
jimjawn wants to merge 12 commits into
Open
Conversation
…ring - Add ProviderAzure constant and NewAzure function var to storage.go - Add AzureURL field to StorageConfig (yaml: azure_url) - Exclude ProviderAzure from bucket-required check in Validate() - Add validateAzure() enforcing non-empty https:// URL - Wire ProviderAzure into Validate() switch and New() factory - Add TestValidateAzure covering valid SAS URL, empty URL, http URL Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…rtions - Add three Azure cases to TestStorageConfig_Validate (valid, empty URL, http URL) with errMsg assertions, testing through the public Validate() entry point instead of the unexported validateAzure() - Remove standalone TestValidateAzure function - Replace hand-rolled contains/findSubstring helpers with strings.Contains in both config_test.go and storage_test.go (same package, shared helpers) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Implements the Storage interface using container-scoped SAS URLs via azblob v1.5.0. Includes constructor tests for valid URL, missing container, and invalid URL cases. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…bids GetContainerProperties
…avoid SAS token in shell history
… list and provider table
Add `claude-sync auto enable/disable/status` subcommands that install and remove claude-sync pull/push hooks in ~/.claude/settings.json, merging with existing hooks without clobbering them. Backed by new internal/claudesettings package that round-trips the full settings file via a raw JSON map. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.claude-sync/config.yamland works identically on macOS, Linux, and WindowsCLAUDE_SYNC_AZURE_URLenv var as an alternative to--azure-urlflag to keep the SAS token out of shell history andpsoutputImplementation notes
Auth design: container-scoped SAS URL (
sr=c). No Azure CLI, no managed identity, no account key stored — just a URL that can be generated once and reused across all devices. Long-lived SAS tokens (e.g. expiry 2099) are practical for personal sync use cases.One gotcha worth knowing:
GetContainerPropertiesis not authorized by a container-scoped SAS — it's a management-plane operation.BucketExistsusesListBlobs(authorized via thelpermission) instead. This is verified against the Azure SDK error codes.Windows relevance: this provider is pure Go with no OS-specific dependencies, so it works on
windows-amd64andwindows-arm64out of the box. For users on the Microsoft ecosystem (see #31), Azure is often already available — no new cloud account needed.Files changed
internal/storage/azure/azure.go— new provider implementing theStorageinterfaceinternal/storage/azure/azure_test.go— constructor testsinternal/storage/config.go—AzureURLfield,validateAzure(), bucket check exclusioninternal/storage/storage.go—ProviderAzureconstant,NewAzurevar, factory casecmd/claude-sync/main.go— wizard,--azure-urlflag,CLAUDE_SYNC_AZURE_URLenv var, blank importREADME.md— Azure setup section withaz storage container generate-sasinstructionsTest plan
go test ./...passesclaude-sync init→ select Azure → paste SAS URL → connection test succeedsclaude-sync pushuploads files to Azure containerclaude-sync pullon a second device restores filesCLAUDE_SYNC_AZURE_URL=<url> claude-sync init --provider azureworks without interactive prompt