Back to Rustfs

Admin Route Action Snapshot

docs/architecture/admin-route-action-snapshot.md

1.0.0-beta.814.9 KB
Original Source

Admin Route Action Snapshot

This snapshot records the current admin routing and authorization surface before directory moves or crate extraction. It is a migration guardrail: later pure move PRs must preserve the route, handler, authorization action, public exception, and compatibility alias semantics listed here unless the PR is explicitly scoped as a behavior change.

Source Of Truth

  • Router assembly: rustfs/src/admin/mod.rs::make_admin_route
  • Route registration coverage: rustfs/src/admin/route_registration_test.rs
  • Runtime dispatch: rustfs/src/admin/router.rs
  • Admin auth helpers: rustfs/src/admin/auth.rs
  • Handler route/action ownership: rustfs/src/admin/handlers/*.rs

The route registration test intentionally covers representative paths for every registered route family. This document uses route patterns from the registration functions and action names from the handler authorization calls.

Prefix And Alias Contract

PrefixCurrent behaviorMigration rule
/rustfs/adminCanonical admin API prefix used by route registrationKeep as the single registered admin prefix
/minio/adminCompatibility alias accepted by S3Router::is_match; dispatch canonicalizes it to /rustfs/adminDo not duplicate registrations; preserve canonicalization
/iceberg/v1 table catalog prefixRegistered through table_catalog::register_table_catalog_route and accepted by is_admin_pathKeep outside /rustfs/admin and document auth separately
/health and /health/readyPublic health endpoints when ENV_HEALTH_ENDPOINT_ENABLE allows registrationPreserve unauthenticated health bypass
/profile/cpu and /profile/memoryRegistered by health handler but guarded by profile authDo not couple to health endpoint enablement

The compatibility alias is not a second route table. canonicalize_admin_path maps /minio/admin/... to /rustfs/admin/... immediately before route lookup.

Dispatch And Auth Shape

mermaid
flowchart LR
    A["Incoming request"] --> B{"S3Router::is_match"}
    B -->|"Replication or misc extension"| X["Extension handler"]
    B -->|"Health path"| H["Public health"]
    B -->|"OIDC public path"| O["OIDC public handler"]
    B -->|"POST / STS form"| S["STS handler"]
    B -->|"Admin or console path"| C{"S3Router::check_access"}
    C -->|"public exception"| P["No SigV4 required"]
    C -->|"admin route"| D["Credential required"]
    D --> E["canonicalize /minio/admin to /rustfs/admin"]
    E --> F["matchit route lookup"]
    F --> G["AdminOperation handler"]
    G --> I["handler-level validate_admin_request"]

Route-level credential presence and handler-level policy authorization are separate contracts. The router enforces credential presence for ordinary admin routes. Handler rows below record whether the current handler performs a precise AdminAction or S3Action check, or only repeats a credential presence check.

Public Exceptions

MethodPath patternHandlerAuth contract
GET, HEAD/healthHealthCheckHandlerPublic when health routes are registered
GET, HEAD/health/readyHealthCheckHandlerPublic when health routes are registered
Registered as GET; auth bypass is path-based/rustfs/admin/v3/oidc/providers and /minio/admin/v3/oidc/providersListOidcProvidersHandlerPublic OIDC bootstrap path; check_access bypasses SigV4 for any method matching this path
Registered as GET; auth bypass is path-prefix-based/rustfs/admin/v3/oidc/authorize/{provider_id} and /minio/admin/v3/oidc/authorize/{provider_id}OidcAuthorizeHandlerPublic OIDC bootstrap path; check_access bypasses SigV4 for any method matching this path prefix
Registered as GET; auth bypass is path-prefix-based/rustfs/admin/v3/oidc/callback/{provider_id} and /minio/admin/v3/oidc/callback/{provider_id}OidcCallbackHandlerPublic OIDC bootstrap path; check_access bypasses SigV4 for any method matching this path prefix
Registered as GET; auth bypass is path-based/rustfs/admin/v3/oidc/logout and /minio/admin/v3/oidc/logoutOidcLogoutHandlerPublic OIDC logout path; check_access bypasses SigV4 for any method matching this path
POST/ with application/x-www-form-urlencodedAssumeRoleHandlePublic only for unsigned STS web identity form requests; handler validates JWT/action
Any matched method/favicon.ico and /rustfs/console...Console routerPublic only when console_enabled is true; router bypasses SigV4 before handing off to the console router

Registered Route Families

All rows with /rustfs/admin also accept the /minio/admin compatibility alias through router canonicalization unless the row explicitly says otherwise.

AreaMethods and path patternsHandler ownershipAuthorization contract
STS and admin probePOST /; GET /rustfs/admin/v3/is-adminsts.rs, is_admin.rsSTS dispatch validates request action; is-admin checks AllAdminActions
User lifecycleGET /v3/list-users; GET /v3/user-info; PUT /v3/add-user; PUT /v3/set-user-status; DELETE /v3/remove-useruser_lifecycle.rs, user.rsListUsersAdminAction, GetUserAdminAction, CreateUserAdminAction, EnableUserAdminAction, DeleteUserAdminAction
Group managementGET /v3/groups; GET /v3/group; DELETE /v3/group/{group}; PUT /v3/set-group-status; PUT /v3/update-group-membersgroup.rsListGroupsAdminAction, GetGroupAdminAction, RemoveUserFromGroupAdminAction, EnableGroupAdminAction, AddUserToGroupAdminAction
Service accountsPUT /v3/add-service-account(s); POST /v3/update-service-account; GET /v3/info-service-account; GET /v3/temporary-account-info; GET /v3/info-access-key; GET /v3/list-service-accounts; GET /v3/list-access-keys-bulk; DELETE /v3/delete-service-account(s)service_account.rscreate/update/list/temp-info/user-list/remove service account actions as checked in handler context
IAM import/exportGET /v3/export-iam; PUT /v3/import-iamuser_iam.rs, user.rsExportIAMAction, ImportIAMAction
IAM policiesGET /v3/list-canned-policies; GET /v3/info-canned-policy; PUT /v3/add-canned-policy; DELETE /v3/remove-canned-policy; PUT /v3/set-user-or-group-policy; PUT /v3/set-policy; POST /v3/idp/builtin/policy/attach; POST /v3/idp/builtin/policy/detach; GET /v3/idp/builtin/policy-entitiespolicies.rslist/create/get/delete/attach policy actions; policy-entities combines list groups, users, and policies
Account infoGET /v3/accountinfoaccount_info.rsS3 action checks for account-scoped bucket and object probes
System infoGET /v3/info; GET /v3/storageinfo; GET /v3/datausageinfosystem.rsServerInfoAdminAction, StorageInfoAdminAction, DataUsageInfoAdminAction plus ListBucketAction for data usage
Metrics streamGET /v3/metricsmetrics.rs through system.rsRouter credential presence plus handler credential check; no handler-level AdminAction is currently enforced
System service placeholdersPOST /v3/service; `GETPOST /v3/inspect-data`system.rs
PoolsGET /v3/pools/list; GET /v3/pools/status; POST /v3/pools/decommission; POST /v3/pools/cancelpools.rslist/status accept server-info or decommission; decommission/cancel use DecommissionAdminAction
RebalancePOST /v3/rebalance/start; GET /v3/rebalance/status; POST /v3/rebalance/stoprebalance.rsRebalanceAdminAction
HealPOST /v3/heal/; POST /v3/heal/{bucket}; POST /v3/heal/{bucket}/{prefix}; POST /v3/background-heal/statusheal.rsHealAdminAction
TierGET /v3/tier; GET /v3/tier-stats; GET /v3/tier/{tier}; DELETE /v3/tier/{tiername}; PUT /v3/tier; POST /v3/tier/{tiername}; POST /v3/tier/cleartier.rsListTierAction for reads/status; SetTierAction for add/edit/remove/clear
Quota legacy and bucket-scopedPUT /v3/set-bucket-quota; GET /v3/get-bucket-quota; `PUTGETDELETE /v3/quota/{bucket}; GET /v3/quota-stats/{bucket}; POST /v3/quota-check/{bucket}`
Bucket metadataGET /export-bucket-metadata; GET /v3/export-bucket-metadata; PUT /import-bucket-metadata; PUT /v3/import-bucket-metadatabucket_meta.rsExportBucketMetadataAction, ImportBucketMetadataAction
Server configGET /v3/get-config-kv; PUT /v3/set-config-kv; DELETE /v3/del-config-kv; GET /v3/help-config-kv; GET /v3/list-config-history-kv; DELETE /v3/clear-config-history-kv; PUT /v3/restore-config-history-kv; `GETPUT /v3/config`config_admin.rs
ScannerGET /v3/scanner/statusscanner.rsServerInfoAdminAction
Notification targetsGET /v3/target/list; GET /v3/target/arns; PUT /v3/target/{target_type}/{target_name}; DELETE /v3/target/{target_type}/{target_name}/resetevent.rs through user_policy_binding.rsGetBucketTargetAction for list/ARNs; SetBucketTargetAction for put/delete
Audit targetsGET /v3/audit/target/list; PUT /v3/audit/target/{target_type}/{target_name}; DELETE /v3/audit/target/{target_type}/{target_name}/resetaudit.rsGetBucketTargetAction for list; SetBucketTargetAction for put/delete
Module switches`GETPUT /v3/module-switches`module_switch.rs
Plugin catalogGET /v4/plugins/catalogplugins_catalog.rsServerInfoAdminAction
Plugin instancesGET /v4/plugins/instances; `GETPUTDELETE /v4/plugins/instances/{id}`
Replication target listGET /v3/list-remote-targetsreplication.rsRouter credential presence plus handler credential check; no handler-level AdminAction is currently enforced
Replication target metrics/mutationGET /v3/replicationmetrics; PUT /v3/set-remote-target; DELETE /v3/remove-remote-targetreplication.rsGetReplicationMetricsAction for metrics; SetBucketTargetAction for target mutation
Site replicationPUT /v3/site-replication/add; PUT /v3/site-replication/remove; GET /v3/site-replication/info; GET /v3/site-replication/metainfo; GET /v3/site-replication/status; POST /v3/site-replication/devnull; POST /v3/site-replication/netperf; PUT /v3/site-replication/edit; PUT /v3/site-replication/peer/join; PUT /v3/site-replication/peer/bucket-ops; PUT /v3/site-replication/peer/iam-item; PUT /v3/site-replication/peer/bucket-meta; GET /v3/site-replication/peer/idp-settings; PUT /v3/site-replication/peer/edit; PUT /v3/site-replication/peer/remove; PUT /v3/site-replication/resync/op; PUT /v3/site-replication/state/editsite_replication.rsadd/remove/info/operation/resync actions selected per handler
Admin profilingGET /rustfs/admin/debug/pprof/profile; GET /rustfs/admin/debug/pprof/statusprofile_admin.rs, profile.rsProfilingAdminAction
TLS debugGET /rustfs/admin/debug/tls/statustls_debug.rs, profile.rsProfilingAdminAction via shared profile authorization
KMS legacy managementPOST /v3/kms/create-key; POST /v3/kms/key/create; GET /v3/kms/describe-key; GET /v3/kms/key/status; GET /v3/kms/list-keys; POST /v3/kms/generate-data-key; `GETPOST /v3/kms/status; GET /v3/kms/config; POST /v3/kms/clear-cache`kms_management.rs, kms_keys.rs
KMS dynamic controlPOST /v3/kms/configure; POST /v3/kms/start; POST /v3/kms/stop; GET /v3/kms/service-status; POST /v3/kms/reconfigurekms_dynamic.rsServerInfoAdminAction
KMS keysPOST /v3/kms/keys; DELETE /v3/kms/keys/delete; POST /v3/kms/keys/cancel-deletion; GET /v3/kms/keys; GET /v3/kms/keys/{key_id}kms_keys.rsKMSCreateKeyAdminAction, KMSKeyStatusAdminAction, ServerInfoAdminAction per handler
OIDC publicGET /v3/oidc/providers; GET /v3/oidc/authorize/{provider_id}; GET /v3/oidc/callback/{provider_id}; GET /v3/oidc/logoutoidc.rsPublic OIDC exception in is_oidc_path
OIDC configGET /v3/oidc/config; `PUTDELETE /v3/oidc/config/{provider_id}; POST /v3/oidc/validate`oidc.rs

Table Catalog Routes

The table catalog API is registered by the admin router but is not under /rustfs/admin. It has its own prefix and Iceberg-style route shape.

MethodPath patternHandlerAuthorization action
GET/iceberg/v1/configGET_CONFIG_HANDLERGetTableCatalogAction
GET/iceberg/v1/{warehouse}/namespacesLIST_NAMESPACES_HANDLERGetTableNamespaceAction
POST/iceberg/v1/{warehouse}/namespacesCREATE_NAMESPACE_HANDLERSetTableNamespaceAction
GET/iceberg/v1/{warehouse}/namespaces/{namespace}GET_NAMESPACE_HANDLERGetTableNamespaceAction
DELETE/iceberg/v1/{warehouse}/namespaces/{namespace}DROP_NAMESPACE_HANDLERDeleteTableNamespaceAction
GET/iceberg/v1/{warehouse}/namespaces/{namespace}/tablesLIST_TABLES_HANDLERGetTableAction
POST/iceberg/v1/{warehouse}/namespaces/{namespace}/tablesCREATE_TABLE_HANDLERCreateTableAction
POST/iceberg/v1/{warehouse}/namespaces/{namespace}/registerREGISTER_TABLE_HANDLERRegisterTableAction
GET/iceberg/v1/{warehouse}/namespaces/{namespace}/tables/{table}LOAD_TABLE_HANDLERGetTableAction
POST/iceberg/v1/{warehouse}/namespaces/{namespace}/tables/{table}COMMIT_TABLE_HANDLERCommitTableAction
DELETE/iceberg/v1/{warehouse}/namespaces/{namespace}/tables/{table}DROP_TABLE_HANDLERDeleteTableAction

Migration Rules

  1. Pure move PRs may move handler modules, but must not change registered methods, patterns, handler ownership, alias canonicalization, or public exception behavior.
  2. If an admin handler is wrapped to cut a dependency direction, the wrapper must preserve the same AdminAction or S3Action check and keep response compatibility unchanged.
  3. Do not duplicate /minio/admin registrations. The alias remains a router canonicalization concern.
  4. Do not move table catalog routes under /rustfs/admin during route cleanup.
  5. Registered-but-NotImplemented routes are behavior contracts too. Removing or implementing them requires a behavior-change PR type.
  6. Future route matrix automation should compare against this document and route_registration_test.rs before crate extraction begins.