-
Notifications
You must be signed in to change notification settings - Fork 1
Add shared B2 config JSON provider #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
goanpeca
wants to merge
8
commits into
main
Choose a base branch
from
feat/issue-103-config-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b8c7cea
feat: add shared B2 config provider
goanpeca 079d68a
fix: harden B2 config secrets
goanpeca 60fc9bc
fix: address config provider reviews
goanpeca 7ef6808
fix: align config JSON guards
goanpeca 4247ed9
fix: refine config provider snapshots
goanpeca 2a678ca
fix: parse config paths from descriptors
goanpeca f462e96
fix: refresh config cache expiry
goanpeca eba7103
fix: harden config writes
goanpeca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "vscode://schemas/b2-config/bucketInfo", | ||
| "title": "Backblaze B2 Bucket Info", | ||
| "description": "Custom key-value metadata stored on a Backblaze B2 bucket.", | ||
| "type": "object", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| }, | ||
| "default": {} | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "vscode://schemas/b2-config/cors", | ||
| "title": "Backblaze B2 CORS Rules", | ||
| "description": "CORS rules for browser access to a Backblaze B2 bucket.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "corsRuleName": { | ||
| "type": "string", | ||
| "description": "Unique name for this CORS rule." | ||
| }, | ||
| "allowedOrigins": { | ||
| "type": "array", | ||
| "description": "Origins allowed to make cross-origin requests.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "allowedOperations": { | ||
| "type": "array", | ||
| "description": "B2 or S3 operations permitted by this CORS rule.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "b2_download_file_by_id", | ||
| "b2_download_file_by_name", | ||
| "b2_upload_file", | ||
| "b2_upload_part", | ||
| "s3_delete", | ||
| "s3_get", | ||
| "s3_head", | ||
| "s3_post", | ||
| "s3_put" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| }, | ||
| "allowedHeaders": { | ||
| "description": "Request headers allowed in preflight requests, or null if none are allowed.", | ||
| "anyOf": [ | ||
| { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "exposeHeaders": { | ||
| "description": "Response headers exposed to browsers, or null if none are exposed.", | ||
| "anyOf": [ | ||
| { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "maxAgeSeconds": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "description": "Maximum time browsers may cache the preflight response." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "corsRuleName", | ||
| "allowedOrigins", | ||
| "allowedOperations", | ||
| "allowedHeaders", | ||
| "exposeHeaders", | ||
| "maxAgeSeconds" | ||
| ] | ||
| }, | ||
| "default": [] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "vscode://schemas/b2-config/lifecycle", | ||
| "title": "Backblaze B2 Lifecycle Rules", | ||
| "description": "Lifecycle rules for a Backblaze B2 bucket.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "fileNamePrefix": { | ||
| "type": "string", | ||
| "description": "File name prefix this lifecycle rule applies to. Use an empty string to match every object." | ||
| }, | ||
| "daysFromUploadingToHiding": { | ||
| "description": "Days after upload before B2 hides matching objects. Use null to disable automatic hiding.", | ||
| "anyOf": [ | ||
| { | ||
| "type": "integer", | ||
| "minimum": 1 | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "daysFromHidingToDeleting": { | ||
| "description": "Days after an object is hidden before B2 deletes it. Use null to keep hidden versions.", | ||
| "anyOf": [ | ||
| { | ||
| "type": "integer", | ||
| "minimum": 1 | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "required": ["fileNamePrefix", "daysFromUploadingToHiding", "daysFromHidingToDeleting"] | ||
| }, | ||
| "default": [] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "vscode://schemas/b2-config/notifications", | ||
| "title": "Backblaze B2 Event Notification Rules", | ||
| "description": "Event notification rules for a Backblaze B2 bucket. Masked secret values are preserved when left unchanged.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "name": { | ||
| "type": "string", | ||
| "description": "Unique name for this notification rule." | ||
| }, | ||
| "eventTypes": { | ||
| "type": "array", | ||
| "description": "B2 event types that trigger this rule.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "b2:ObjectCreated:*", | ||
| "b2:ObjectCreated:Upload", | ||
| "b2:ObjectCreated:MultipartUpload", | ||
| "b2:ObjectCreated:Copy", | ||
| "b2:ObjectCreated:Replica", | ||
| "b2:ObjectCreated:Hide", | ||
| "b2:ObjectDeleted:*", | ||
| "b2:ObjectDeleted:Delete", | ||
| "b2:ObjectDeleted:LifecycleRule" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| }, | ||
| "isEnabled": { | ||
| "type": "boolean", | ||
| "description": "Whether this rule is actively sending notifications." | ||
| }, | ||
| "isSuspended": { | ||
| "type": "boolean", | ||
| "description": "Whether B2 has suspended this rule due to delivery failures." | ||
| }, | ||
| "objectNamePrefix": { | ||
| "type": "string", | ||
| "description": "Only events for objects with this prefix trigger the rule. Use an empty string to match every object." | ||
| }, | ||
| "suspensionReason": { | ||
| "type": "string", | ||
| "description": "Reason for suspension, or an empty string if not suspended." | ||
| }, | ||
| "targetConfiguration": { | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "targetType": { | ||
| "type": "string", | ||
| "description": "Webhook target type, usually url." | ||
| }, | ||
| "url": { | ||
| "type": "string", | ||
| "format": "uri", | ||
| "description": "Webhook URL that receives event notifications." | ||
| }, | ||
| "hmacSha256SigningSecret": { | ||
| "type": "string", | ||
| "description": "Optional HMAC-SHA256 signing secret. Leave __B2_CONFIG_MASKED_SECRET__ unchanged to preserve the existing secret." | ||
| }, | ||
| "hmacSha256": { | ||
| "type": "string", | ||
| "description": "Optional HMAC-SHA256 signing secret. Leave __B2_CONFIG_MASKED_SECRET__ unchanged to preserve the existing secret." | ||
| }, | ||
| "customHeaders": { | ||
| "type": "object", | ||
| "description": "Optional custom webhook request headers. Header values are masked on read.", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "required": ["targetType", "url"] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "name", | ||
| "eventTypes", | ||
| "isEnabled", | ||
| "isSuspended", | ||
| "objectNamePrefix", | ||
| "suspensionReason", | ||
| "targetConfiguration" | ||
| ] | ||
| }, | ||
| "default": [] | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.