Skip to content

feat(cosi): foundation admin client + CAS grant ownership - #219

Open
BenjaminFuentesEviden wants to merge 6 commits into
rustfs:mainfrom
BenjaminFuentesEviden:feat/cosi-foundation-ownership
Open

feat(cosi): foundation admin client + CAS grant ownership#219
BenjaminFuentesEviden wants to merge 6 commits into
rustfs:mainfrom
BenjaminFuentesEviden:feat/cosi-foundation-ownership

Conversation

@BenjaminFuentesEviden

Copy link
Copy Markdown

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Summary of Changes

Foundation PR A (COSI+Helm / sidecar pin stay in PR B):

  1. Extract crates/rustfs-admin — kube-agnostic HTTP/admin/S3/STS client shared by operator and rustfs-cosi-driver (operator keeps Tenant credential loading wrappers).
  2. Durable random credentials — 40+ char random secret persisted in namespaced Secret cosi-cred-{grant} before add_user; retries reuse the Secret (never re-derive from access key).
  3. CAS grant ownership — ConfigMap rustfs-cosi-ownership checkpoints PendingCreateReady (proof: grant_name, account_id, access_key_hash, cred_secret_name, state). Concurrent preferredAccessKey conflicts; orphan RustFS users are not adopted.
  4. Unique policies — generated cosi-pol-{grant}; BAC policy param is validate/attach only (never add_canned_policy replace).
  5. Split driver state machine — thin gRPC adapters over grant / bucket modules; static bucketName/buckets deletes return FailedPrecondition.

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (if user-visible change)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: COSI driver grant/secret ownership model changes; Helm Deployment remains PR B

Verification

cargo test -p rustfs-admin
cargo test -p rustfs-cosi-driver --bins
cargo clippy -p rustfs-admin -p rustfs-cosi-driver -- -D warnings
make fmt-check

Additional Notes


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

BenjaminFuentesEviden and others added 6 commits August 3, 2026 17:48
Extract shared rustfs-admin client, ship a tonic COSI driver with Helm
toggle, and document BucketClass parameters for Tenant-backed S3.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align DriverGrantBucketAccess with Ceph-style isolation: deterministic
secrets, never rotate existing users, and return AlreadyExists when
preferredAccessKey is claimed by another BucketAccess.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace derivable secrets and marker-based IAM ownership with durable
random credentials plus PendingCreate/Ready checkpoints so concurrent
preferredAccessKey grants conflict safely and external BAC policies are
never overwritten. Split the COSI driver into thin gRPC adapters over
testable grant/bucket state machines.

Co-authored-by: Cursor <cursoragent@cursor.com>
Existence probes and test fixtures often return an empty 200; treat that
as an existing user with no policies instead of failing the parse.

Co-authored-by: Cursor <cursoragent@cursor.com>
@BenjaminFuentesEviden

Copy link
Copy Markdown
Author

@GatewayJ I applied the first PR here that is mainly impacting the code split you asked, once validated, I will add the extras on a next PR B

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.

1 participant