-
-
Notifications
You must be signed in to change notification settings - Fork 276
feat: support unicode in object names #875
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
ferhatelmas
wants to merge
40
commits into
master
Choose a base branch
from
ferhat/name
base: master
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
40 commits
Select commit
Hold shift + click to select a range
8a4ec22
fix: allow Unicode object names
mlatief 4b7f534
test: add unicode key and xml entity edge-case coverage
ferhatelmas 4b95b1b
fix: more tests and edge case handling
ferhatelmas c36b32f
fix: make migration idempotent
ferhatelmas 0cfa647
fix: more tests for gaps
ferhatelmas 67636fc
fix: oriole compat
ferhatelmas 42639c3
fix: lint
ferhatelmas 7a0d66e
fix: add delete many test
ferhatelmas fed0dd7
fix: decode logic in xml
ferhatelmas c5484c2
fix: make delete many example more complex
ferhatelmas 0849e86
fix: more tests for gaps
ferhatelmas 19a6b38
fix: invalid key surrogates
ferhatelmas 0b61d36
fix: sign and more coverage
ferhatelmas a7e728c
fix: more batch sign coverage
ferhatelmas 56e72ee
fix: cleanup data after run
ferhatelmas a66ef7c
fix: add tests for webhooks
ferhatelmas 7a0862b
fix: drop dead param for sign
ferhatelmas df1b661
fix: s3 copy source
ferhatelmas 835d8ab
fix: backward compat for list continuation
ferhatelmas e72d008
fix: backward compat for s3 continuation
ferhatelmas 609e871
fix: control chars in migration
ferhatelmas 57b8e72
fix: explicit decoding
ferhatelmas 0209a8f
fix: more test coverage
ferhatelmas 4a563c7
fix: post rebase
ferhatelmas 9628e54
fix: test data dependence
ferhatelmas c6a0740
fix: error shape
ferhatelmas ce03d4a
fix: inflight pagination
ferhatelmas 3f4b711
fix: backup compat
ferhatelmas 545465c
fix: sign upload canonical raw validation
ferhatelmas ccd1c28
fix: list url encoding type prefixes
ferhatelmas a86d443
fix: more cover for list v1 pagination
ferhatelmas f110ad9
fix: strict path verification for sign
ferhatelmas a72f6fa
fix: encoder dedupe
ferhatelmas 8135290
fix: more gaps
ferhatelmas 3b468c6
fix: extend migration for multipart tables
ferhatelmas 84931e7
fix: improve migration locking and tests
ferhatelmas bd80e2c
fix: name check constraint as 400
ferhatelmas 136aff1
fix: copy source with query param
ferhatelmas 2564e3f
fix: path traversal with relaxed key in file backend
ferhatelmas 3d56e91
fix: address review comments
ferhatelmas 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| DO $$ | ||
| DECLARE | ||
| -- SQL_ASCII databases do not have reliable Unicode code point semantics, so | ||
| -- the migration needs a byte-pattern branch instead of U&'' character checks. | ||
| -- This is the case for OrioleDB and/or --locale=C databases. | ||
| server_encoding text := current_setting('server_encoding'); | ||
| BEGIN | ||
| IF NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 'objects_name_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 'objects' | ||
| ) THEN | ||
| IF server_encoding = 'SQL_ASCII' THEN | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."objects" | ||
| ADD CONSTRAINT objects_name_check | ||
| CHECK ( | ||
| name !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND name !~ E'\\xED[\\xA0-\\xBF][\\x80-\\xBF]' | ||
| AND name !~ E'\\xEF\\xBF\\xBE|\\xEF\\xBF\\xBF' | ||
| ) NOT VALID | ||
| $ddl$; | ||
| ELSE | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."objects" | ||
| ADD CONSTRAINT objects_name_check | ||
| CHECK ( | ||
| name !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND POSITION(U&'\FFFE' IN name) = 0 | ||
| AND POSITION(U&'\FFFF' IN name) = 0 | ||
| ) NOT VALID | ||
| $ddl$; | ||
| END IF; | ||
| END IF; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 'objects_name_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 'objects' | ||
| AND c.convalidated = false | ||
| ) THEN | ||
| EXECUTE 'ALTER TABLE "storage"."objects" VALIDATE CONSTRAINT objects_name_check'; | ||
| END IF; | ||
|
|
||
| IF NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 's3_multipart_uploads_key_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 's3_multipart_uploads' | ||
| ) THEN | ||
| IF server_encoding = 'SQL_ASCII' THEN | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."s3_multipart_uploads" | ||
| ADD CONSTRAINT s3_multipart_uploads_key_check | ||
| CHECK ( | ||
| key !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND key !~ E'\\xED[\\xA0-\\xBF][\\x80-\\xBF]' | ||
| AND key !~ E'\\xEF\\xBF\\xBE|\\xEF\\xBF\\xBF' | ||
| ) NOT VALID | ||
| $ddl$; | ||
| ELSE | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."s3_multipart_uploads" | ||
| ADD CONSTRAINT s3_multipart_uploads_key_check | ||
| CHECK ( | ||
| key !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND POSITION(U&'\FFFE' IN key) = 0 | ||
| AND POSITION(U&'\FFFF' IN key) = 0 | ||
| ) NOT VALID | ||
| $ddl$; | ||
| END IF; | ||
| END IF; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 's3_multipart_uploads_key_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 's3_multipart_uploads' | ||
| AND c.convalidated = false | ||
| ) THEN | ||
| EXECUTE 'ALTER TABLE "storage"."s3_multipart_uploads" VALIDATE CONSTRAINT s3_multipart_uploads_key_check'; | ||
| END IF; | ||
|
|
||
| IF NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 's3_multipart_uploads_parts_key_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 's3_multipart_uploads_parts' | ||
| ) THEN | ||
| IF server_encoding = 'SQL_ASCII' THEN | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."s3_multipart_uploads_parts" | ||
| ADD CONSTRAINT s3_multipart_uploads_parts_key_check | ||
| CHECK ( | ||
| key !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND key !~ E'\\xED[\\xA0-\\xBF][\\x80-\\xBF]' | ||
| AND key !~ E'\\xEF\\xBF\\xBE|\\xEF\\xBF\\xBF' | ||
| ) NOT VALID | ||
| $ddl$; | ||
| ELSE | ||
| EXECUTE $ddl$ | ||
| ALTER TABLE "storage"."s3_multipart_uploads_parts" | ||
| ADD CONSTRAINT s3_multipart_uploads_parts_key_check | ||
| CHECK ( | ||
| key !~ E'[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]' | ||
| AND POSITION(U&'\FFFE' IN key) = 0 | ||
| AND POSITION(U&'\FFFF' IN key) = 0 | ||
| ) NOT VALID | ||
| $ddl$; | ||
| END IF; | ||
| END IF; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_constraint c | ||
| JOIN pg_class t ON t.oid = c.conrelid | ||
| JOIN pg_namespace n ON n.oid = t.relnamespace | ||
| WHERE c.conname = 's3_multipart_uploads_parts_key_check' | ||
| AND n.nspname = 'storage' | ||
| AND t.relname = 's3_multipart_uploads_parts' | ||
| AND c.convalidated = false | ||
| ) THEN | ||
| EXECUTE 'ALTER TABLE "storage"."s3_multipart_uploads_parts" VALIDATE CONSTRAINT s3_multipart_uploads_parts_key_check'; | ||
| END IF; | ||
| END | ||
| $$; | ||
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
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
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
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
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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './agent' | ||
| export * from './url' |
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.