Repository navigation
feat(paymentcryptography): the payment keys in the Cloud Explorer - #476
Conversation
Adds AWS Payment Cryptography to the Cloud Explorer through the schema-driven pattern: a catalog row, a schema, an adapter and a test. The key is the resource, as it is in the reference's own key list: the table shows the ARN, the class, the usage, the algorithm, the state, the two flags and the moment the key was made, and the inspector adds the check value, the modes of use and the tags. A key is made the way the reference makes one: a TR-31 usage, an algorithm that usage allows, and the modes of use that say what the key may be used for. The class follows from the algorithm, so the form does not ask for one. The adapter refuses an algorithm the usage does not allow, naming the ones it does, and refuses a key with no mode of use, because such a key does no work. Deletion is the reference's own: the key is disabled and stays readable until the waiting period ends, and the tags are edited with the same pair of operations the reference uses. Adds @aws-sdk/client-payment-cryptography, pinned to the version the other AWS clients are on so the lockfiles stay additive.
A select the form left on its default entry showed "Default" and saved something the page never showed: the usage and the algorithm were resolved on the server, and the form said nothing about what they would be. Both now carry their default, so the form opens on the values that are saved, and the descriptions say what the default is. The algorithm's default is the first one the usage allows, which is the usage's own table and not a fixed value, so it is named in the description rather than in the field.
…able The create form took any algorithm the usage's family allowed and any combination of modes of use, so it could ask for a key the reference refuses: an elliptic curve key for a usage that takes an RSA one, or a MAC key that may encrypt. The reference publishes the table of valid key attributes, and it is now the authority: the algorithm has to be one the usage allows, and the modes of use have to be one of the combinations the usage allows. The table is the reference's own, and the local runtime is more permissive in two places, so the table and not the runtime decides. The algorithm is no longer given a fixed default, because the one that is saved depends on the usage: it is left unset and the adapter takes it from the usage's own table, the way the KMS adapter takes the key spec. A mode is parsed with the shared rule as well, so an answer that is neither of the two is refused rather than taken for a no.
|
A local review of this pull request with Right, and fixed
Not right
Both of those read as a model from a neighbouring service, which is why the The table the four fixes follow is the reference's Checks: |
[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.
|
…ccount The service status is polled every few seconds, and it fell back to the adapter's own list, which reads every page of keys and then every key in full. One page is enough to say the service answers, so the probe asks for one.
## Summary The `updateTags` capability has been advertised since the capability existed, and the console had no way to reach it, so the tags a resource showed were the ones it would keep. KMS declares the capability and the console never rendered it. The resource panel now carries the control: the tags a resource has, editable, saved through the adapter's own `updateTags`, which is where a key with a null value is one whose tag is removed. The control appears only for a service whose schema declares the capability, so a service that cannot edit its tags shows none. This is the shared half of the payment cryptography work, and it stands on its own: it needs nothing from #476, and #476 needs nothing from it. ## Type of change - [ ] Bug fix (`fix:`) - [x] New feature / service UI (`feat:`) - [ ] Breaking change (`feat!:` or `fix!:`) - [ ] Docs / chore ## Area - [x] Frontend (`packages/frontend`) - [x] API / Cloud Proxy (`packages/api`) - [ ] Cloud Explorer adapter / schema - [ ] Build / CI / Docker ## Verification Against a local Floci core (`:4566`): - a KMS key with tags, edited in the panel: a tag's value changed, a tag added and a tag removed, and the key comes back with the three; - a resource whose service does not declare `updateTags` shows no control, and the API answers the request with `501 operation_not_supported`, which is the error the service layer raises for an adapter without the method; - an unknown service answers `404`; - the tags refresh after they are edited: the panel asks again for the resource's own query and for the list, which are the two that carry them. Checks: `pnpm lint`, `pnpm type-check`, `pnpm test` (2904 API tests, 3 of them new in `clouds.tags.test.ts`, and 321 frontend tests, 6 of them new in `resourceTags.test.ts`) and `pnpm build` pass. ## Note on the shared surface The control lands in the shared resource panel, which the repository's rules ask to change only for an issue that came from an accepted Discussion. The argument for doing it directly is that the capability was already declared and the console simply could not reach it, so this is the control the schema always promised. Happy to split the API half out if the panel is the part that needs the discussion. ## Checklist - [x] `pnpm lint`, `pnpm type-check`, `pnpm test`, and `pnpm build` pass locally - [x] New or updated tests added where it makes sense (`bun test` in `packages/api`, vitest in `packages/frontend`) - [x] No fake/mock data added: unwired states stay empty or show an explicit placeholder - [x] Commit messages / PR title follow Conventional Commits - [x] Layout or look-and-feel changes close an issue that came from an accepted Discussion, or this PR has none (new services through the existing views, bug fixes that restore the intended layout, and accessibility fixes are exempt) - [x] I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).
Summary
Adds AWS Payment Cryptography to the Cloud Explorer through the schema-driven
pattern: a catalog row, a schema, an adapter and a test. The only frontend
line is the nav icon; the table, the form and the inspector are rendered from
the schema.
The key is the resource, as it is in the reference's own key list. The table
shows the ARN, the class, the usage, the algorithm, the state, the two flags
and the moment the key was made. The inspector adds the check value and the
algorithm it was computed with, the modes of use, the origin and the tags.
A key is made the way the reference makes one: a TR-31 usage, an algorithm that
usage allows, and the modes of use that say what the key may be used for. The
class follows from the algorithm, so the form does not ask for one: a symmetric
algorithm makes a
SYMMETRIC_KEYand an RSA or EC one a key pair. The adapterrefuses an algorithm the usage does not allow and names the ones it does, and
refuses a key with no mode of use, because such a key does no work.
Deletion is the reference's own: the key is disabled and stays readable until
the waiting period ends, so it keeps its row until then.
What the view does not hold is said above the list rather than left to be
guessed at: aliases, key replication and Multi-Party Approval are not in it.
The
Edit tagscapability is listed and the adapter implements it, but thegeneric view has no tags control yet, the same way KMS lists it.
Adds
@aws-sdk/client-payment-cryptography, pinned to the version the otherAWS clients are on so both lockfiles stay additive.
Type of change
fix:)feat:)feat!:orfix!:)Area
packages/frontend)packages/api)Verification
Against a local Floci core (
:4566) with four real payment cryptography keys,made through the console's own API and through the AWS CLI:
GET /api/clouds/aws/services/paymentcryptography/resourcesreturns the fourwith their class, usage, algorithm, state, flags and check value, and
GET .../resources/<keyArn>returns the modes of use and the tags. The keyswere made through
POST .../resourceswith the form's own values, and theanswer carries the class the algorithm implies and the check value the
algorithm's own kind computes (CMAC under an AES key).
In the browser,
/cloud-explorer/aws/paymentcryptographylists the keys withthe notice and the columns, the create form renders the usage, the algorithm,
the two flags and the nine modes of use, each select opening on the value it
saves rather than on a "Default" entry, and the inspector opens on a row with
the tags as chips. No console errors.
Checks:
pnpm lint,pnpm type-check,pnpm test(2853 API tests, 29 of themnew in
AwsPaymentCryptographyAdapter.test.ts, and 314 frontend tests) andpnpm buildpass.Checklist
pnpm lint,pnpm type-check,pnpm test, andpnpm buildpass locallybun testinpackages/api)