Repository navigation
Conversation
`spec.tiers` registers S3, RustFS and MinIO remote tiers through the RustFS tier admin API, so bucket lifecycle transitions can reference a tier managed by the same Tenant. Tiers are reconciled before buckets. Credentials come from `tiers[].credsSecret` (`accesskey`/`secretkey`). RustFS never returns a tier secret key, so the applied Secret resourceVersion is recorded in `status.provisioning.tiers`; a Secret change, a different Secret, or an access key listed by RustFS that differs from the Secret updates the credentials with the edit API. Type, endpoint, bucket, prefix and region cannot change on a registered tier: a live tier with the same name and other settings is reported as `TierConflict` without writes, and a matching one is adopted. RustFS rejects a remote prefix that already holds objects with 409; that is reported as `TierConflict` too, and `force: true` registers the tier anyway. Removed tiers are retained, like other provisioned items. Closes rustfs#280
Buckets accept `encryption` with `mode: SSE-S3` (S3 `AES256`) or `mode: SSE-KMS` (`aws:kms`, optional `kmsKeyId`), and `state: Absent` to remove the configuration. Ownership follows objectLockConfiguration and lifecycle: omission makes no encryption calls, a matching live configuration is adopted without a write, and a different one is replaced or removed only while its hash matches the configuration last recorded in status; otherwise the bucket reports BucketEncryptionConflict. SSE-KMS requires `spec.encryption.enabled`; without it RustFS answers PutBucketEncryption with 500 "KMS service not initialized", which would otherwise keep the bucket Pending forever. RustFS records its default KMS key when none is sent, so ownership is the hash of the verified live configuration, and SSE-KMS without `kmsKeyId` matches any key. RustFS answers GetBucketEncryption without a configuration with 400 ServerSideEncryptionConfigurationNotFoundError rather than 404; the client treats that code as absent. Closes rustfs#284
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.
Closes #284
Depends on #282 (this branch is stacked on it); only the last commit, 701d2df, belongs to this PR.
What
spec.buckets[].encryptiondeclares the bucket's default server-side encryption:Ownership follows
objectLockConfigurationandlifecycle:encryptionis omitted, the operator makes no encryption calls.Absent, only while its hash matchesencryptionLastAppliedHash. Otherwise the bucket reportsBucketEncryptionConflictand is left untouched.encryptionDesiredHashandencryptionLastAppliedHashare recorded in the bucket status.Validation:
Presentrequiresmode;AbsentforbidsmodeandkmsKeyId;kmsKeyIdrequiresSSE-KMS.kmsKeyIdis 1–1024 characters and must match^[A-Za-z0-9._:/+=@-]+$.SSE-KMSis rejected up front unlessspec.encryption.enabled. Without it, RustFS answers 500KMS service not initializedand the bucket would stay Pending.Default encryption only applies to objects written after it is set. Existing objects are not re-encrypted or rewritten.
RustFS behaviour handled (1.0.2-preview.2)
GET ?encryptionwithout a configuration returns 400ServerSideEncryptionConfigurationNotFoundError, not 404. The client treats it as absent.Rule, known elements only, entity references rejected.PUTwithaws:kmsand no key ID stores the default KMS key. Ownership is therefore the hash of the configuration read back after the PUT, andSSE-KMSwithoutkmsKeyIdmatches any live key.DELETE ?encryptionis idempotent (204).Changes
rustfs-admin:BucketEncryptionConfigurationwith XML encode and parse, plusget_bucket_encryption,put_bucket_encryptionanddelete_bucket_encryption.BucketEncryptionSpec, two status hashes, and the reasonsBucketEncryptionApplyFailedandBucketEncryptionConflict.reconcile_bucket_encryptionruns after the bucket policy and before lifecycle.Testing
make pre-commit: fmt, clippy, unit tests, e2e check, console test, lint, build and format.Absentremoves only an owned configuration;AES256with no PUT;BucketKeyEnabled) givesBucketEncryptionConflictand is not overwritten;state: Absentremoves the configuration.