Repository navigation
fix(sse): recognise the AWS KMS backend instead of rendering it unsupported - #327
Merged
Merged
Conversation
…ported A cluster configured with the AWS KMS backend could not be read or managed: `KmsBackendType` omitted "AWS" and `normalizeBackendType` fell through to "unsupported", so the Encryption & Keys page claimed the backend was not supported by this Console version and forced the configuration form into a read-only fallback. The server reports the backend as "AWS" on /kms/service-status and as "aws" on /kms/status, so both spellings (plus the configure-time "AwsKms" alias) now normalize to the new "aws" form backend. The form gains an AWS KMS section with the two non-secret settings the server persists and echoes back (region and endpoint URL); credentials stay with the server's AWS provider chain and are never entered or stored in the console. A plaintext endpoint shows a development-only warning and unlocks the server's insecure-defaults flag for that request. Capabilities remain optional and additive: a server that omits them renders absence as unknown rather than false, which a test now pins together with the AWS status hydration. Closes rustfs#320 (Part A).
Contributor
Author
overtrue
approved these changes
Nov 30, 2026
overtrue
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Clean fix for AWS KMS support and capability-matrix fallback handling.
Review Notes
types/kms.ts&lib/sse/config.ts: Adding"AWS"toKmsBackendType,region/endpoint_urltoKmsBackendSummary,KmsAwsConfigPayloadtoKmsConfigPayload, and normalizing"AWS","aws", and"AwsKms"innormalizeBackendTyperesolves the read-only unsupported fallback cleanly without introducing or echoing any AWS credentials.app/(dashboard)/sse/page.tsx:buildConfigPayloadvalidates non-emptyawsRegionand optionalawsEndpointUrl(/^https?:\/\/\S+$/i), and displays a destructive development-onlyAlertwhen a plaintexthttp://endpoint is entered. Note thatallow_insecure_dev_defaults: trueis inferred automatically wheneverendpointUrlstarts withhttp://; if you ever want an explicit opt-in toggle in the future, that would be an easy follow-up, though the warning banner makes the behavior clear here.i18n/locales/*.json: All 15 locale files are updated consistently with the new AWS KMS strings.tests/lib/sse-config.test.ts&tests/lib/management-permission-controls.test.ts: Good unit and mounted-page test coverage for alias normalization, status hydration, missing summary fields, and missing capability matrices.
Merge Gate Note
- No GitHub Actions check runs are reported on this fork PR yet (
docs/test/quality/buildworkflows need maintainer approval to run), so please trigger and verify CI passes before merging.
Contributor
Author
Thank you! Can we depoly and I gonna take next task? |
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.


Description
A cluster configured with the AWS KMS backend cannot be read or managed in the Console: the Encryption & Keys page claims the backend is unsupported and forces the configuration form into a read-only fallback.
Root cause: the server reports the AWS backend under two different spellings —
GET /kms/service-statusreturns"AWS",GET /kms/statusreturns"aws", and the configure request also accepts the"AwsKms"alias.normalizeBackendTypeknew neither, so every AWS cluster fell through to"unsupported"(lib/sse/config.ts,types/kms.ts).This PR adds the backend type and a dedicated AWS KMS section to the form:
types/kms.ts:"AWS"added toKmsBackendType;regionandendpoint_urladded toKmsBackendSummary(the only non-secret settings the server persists and echoes back — it never reports credential material); newKmsAwsConfigPayloadinKmsConfigPayload.lib/sse/config.ts: new"aws"form backend;"AWS","aws"and"AwsKms"all normalize to it;region/endpoint_urlhydrate fromconfig_summary.backend_summary.app/(dashboard)/sse/page.tsx: "AWS KMS" option in the backend selector, an "AWS KMS configuration" section with a requiredRegionand an optionalEndpoint, and the same cache/timeout fields every backend shares. A plaintext (http://) endpoint shows a development-only warning and unlocks the server'sallow_insecure_dev_defaultsflag for that request only;https://endpoints do not set it. Non-URL endpoints are rejected in the field.Capabilities on
/kms/statusstay optional and additive: a server that omits them renders absence as "unknown" rather than "false", which the page test pins, along with the AWS status hydration.Scope: this is Part A of #320 only. The missing admin endpoints listed under Part B are not touched here.
Type of Change
Testing
tests/lib/sse-config.test.tscoversnormalizeBackendTypefor all three AWS spellings and status hydration (including a summary that omits the fields).tests/lib/management-permission-controls.test.tsmounts the page against an AWS status and asserts the AWS section renders instead of the unsupported fallback, plus that a missing capability matrix does not mark the backend unsupported.Manual verification against a real server: RustFS
1.0.xin Docker, AWS backend configured throughPOST /kms/configure(region: us-east-1), then the Console dev server logged in against it. Before/after screenshots below.Checklist
Related Issues
Part of #320 (Part A — AWS KMS backend). Closes the defect half of the issue; Part B endpoints remain.
Screenshots (if applicable)
Encryption & Keys page with an AWS KMS backend configured, desktop 1264×1269.
us-east-1), Create/Save enabledScreenshots attached below.
Additional Notes
Configured+Health: Unknown. That is the server's own state and is unrelated to this change; it also happens to exercise the "capabilities absent ⇒ unknown, not false" path.buildConfigPayloadpath, so no new form state machine was added.