Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Differences between `rc` and `mc` for the `anonymous set` command

Aperta
#378 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia con gli entry point rc anonymous set e rc anonymous set-json, insieme all’avviso sulla sostituzione della bucket policy. Confronta le policy prodotte da comandi sequenziali per entrambi i prefissi, quindi verifica che le dichiarazioni esistenti rimangano intatte e che la policy risultante mantenga l’accesso a entrambi i percorsi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Our team used a workflow similar to this for MinIO mc:

mc alias set local http://localhost:9001 root rootroot
mc mb local/my-bucket
mc anonymous set public "local/my-bucket/persons/music/**"
mc anonymous set public "local/my-bucket/profiles/images/**"
mc anonymous get-json local/my-bucket

Result json policy:

{
 "Statement": [
  {
   "Action": [
    "s3:GetBucketLocation",
    "s3:ListBucketMultipartUploads"
   ],
   "Effect": "Allow",
   "Principal": {
    "AWS": [
     "*"
    ]
   },
   "Resource": [
    "arn:aws:s3:::my-bucket"
   ]
  },
  {
   "Action": [
    "s3:ListBucket"
   ],
   "Condition": {
    "StringEquals": {
     "s3:prefix": [
      "persons/music/**",
      "profiles/images/**"
     ]
    }
   },
   "Effect": "Allow",
   "Principal": {
    "AWS": [
     "*"
    ]
   },
   "Resource": [
    "arn:aws:s3:::my-bucket"
   ]
  },
  {
   "Action": [
    "s3:AbortMultipartUpload",
    "s3:DeleteObject",
    "s3:GetObject",
    "s3:ListMultipartUploadParts",
    "s3:PutObject"
   ],
   "Effect": "Allow",
   "Principal": {
    "AWS": [
     "*"
    ]
   },
   "Resource": [
    "arn:aws:s3:::my-bucket/persons/music/***",
    "arn:aws:s3:::my-bucket/profiles/images/***"
   ]
  }
 ],
 "Version": "2012-10-17"
}

After MinIO free Docker images deletion, we decided to switch to RustFS using rc:

rc alias set local http://localhost:9000 root rootroot
rc mb local/my-bucket
rc anonymous set public "local/my-bucket/persons/music"
rc anonymous set public "local/my-bucket/profiles/images"
rc anonymous get-json local/my-bucket

And we get this json policy:

{
  "Statement": [
    {
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Principal": "*",
      "Resource": "arn:aws:s3:::my-bucket/profiles/images/*",
      "Sid": "AnonymousRead1"
    },
    {
      "Action": "s3:ListBucket",
      "Condition": {
        "StringLike": {
          "s3:prefix": [
            "profiles/images",
            "profiles/images/*",
            "profiles/images*"
          ]
        }
      },
      "Effect": "Allow",
      "Principal": "*",
      "Resource": "arn:aws:s3:::my-bucket",
      "Sid": "AnonymousList2"
    },
    {
      "Action": [
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Principal": "*",
      "Resource": "arn:aws:s3:::my-bucket/profiles/images/*",
      "Sid": "AnonymousWrite3"
    }
  ],
  "Version": "2012-10-17"
}

(Public access to persons/music has been lost)

This slightly disrupted our transition from mc to rc; we had to add a json file and use anonymous set-json command instead.

Is it possible to update the rc so that it extends the existing policy for the bucket rather than overwriting it completely? I noticed there’s a warning message about this when using the cli (Warning: setting 'local/my-bucket/profiles/images' will replace the entire bucket policy for 'my-bucket', which may remove unrelated statements). Is this restriction really necessary?

Lingua principale
Rust
Stelle
152
Fork
21
Merge medio
1g 4h
PR unite (30g)
23

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rustfs/cli

Tutte le issue di rustfs/cli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.