Repository navigation
fix(secret): add create; update of absent is 404 - #1708
Conversation
c4a76bb to
30c9916
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1708 +/- ##
=======================================
Coverage 99.99% 99.99%
=======================================
Files 446 446
Lines 25257 25281 +24
=======================================
+ Hits 25256 25280 +24
Misses 1 1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
dae7a5d to
3ea1140
Compare
|
Standards review: changes requested (3). (GitHub refuses a formal "request changes" on a PR by the same account, so this is a comment.)
Conforms: the specs PR is linked (specs#708) and the lab PR is named; the compare of secrets is constant-time; the error text does not hold the value ( |
3ea1140 to
5bf9936
Compare
|
Standards review: still changes requested (3 open of the 3). The head moved to 5bf9936, but items 1 and 2 are unchanged: TestCreate still picks its checks with a |
5bf9936 to
d927403
Compare
|
Standards review: still changes requested (2). The head moved to d927403, but the test file is unchanged: TestCreate still picks its checks with a |
|
Standards review reply: head d927403 has the fixes.
Please check again. |
|
Code review: changes requested. Everything except one point checked out (file update 404 on a missing name, secret update 404 on a missing key, Location with several path-escaped fields, the create route and its generated surfaces). One finding is held outside this thread and sent to the maintainer directly, because of what it touches; it is in the secret create handler and will be relayed with a fix. |
CONTRIBUTING says one endpoint does not both create and update, a POST
creates with the name in the body, and an update of a thing that is absent
is an error. file update and secret update both created.
- PUT /api/file/{name} of a name that is not there is 404. file upload is
the create. The same content answers changed false, never 201.
- POST /api/secret/{vault} with {key, value} (osapi client secret create,
SDK Secret.Create) makes a key as version 1: 201 with a Location header.
Create on an existing key always conflicts: 409, from the list of the
vault's keys.
- PUT /api/secret/{vault}/{key} of a key that is not there is 404.
- Location takes several fields, joined by / and escaped, so the secret's
is /api/secret/{vault}/{key}. The DSL term and dslcheck say so.
- The UI writes a key in the list with PUT and a new key with POST.
- The integration scenario and the audit test write with create. The
generated CLI, pages, SDK, UI client, catalog and contract golden are
regenerated. The secrets page and the agent skills say create.
Closes #1666
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d927403 to
aef7cf2
Compare
|
fixed: an existing key always conflicts |
Specs: osapi-io/specs#708
CONTRIBUTING says that one endpoint does not both create and update, that a POST creates with the name in the body, and that an update of a thing that is absent is an error.
file updateandsecret updateboth created. This change keeps no backward compatibility.File
PUT /api/file/{name}of a name that is not there is 404.file uploadis the create. The same content answerschanged: false, and never 201.Secret
POST /api/secret/{vault}, with{"key": "...", "value": "..."}. It isosapi client secret create, SDKSecret.Createand UI operationPostSecret. It writes version 1, and answers 201 withLocation: /api/secret/{vault}/{key}.PUT /api/secret/{vault}/{key}of a key that is not there is 404. Its body staysSecretUpdateRequest.The DSL
Locationtakes several output fields, joined by/and path-escaped. The DSL spec term (osapi dsl endpoint spec) andinternal/dslcheck/testdata/strings.txtsay so.Other changes in this PR
internal/apicontractgolden.TestAuditOfAWritewrite with create. The DSL examples run create, then update.create.Checks
go test -cover: secret, file, endpoint and endpoint/server at 100%. apicontract, dslcheck, skills, cmd, pkg/sdk and the integration unit gate pass.golangci-lint run: 0 issues.react-typecheck,react-lint,react-fmt-check,react-unit(107 pass) andreact-buildpass.docs-build,docs-fmt-checkandmd-fmt-checkpass.OSAPI_INTEGRATION_WRITES=1, forcliandsdk, on head aef7cf2's code:client secretexample, the sealed-secret scenario andTestAuditOfAWritepass for both clients.client agent listandclient agent getfail the same way on main: the agent stays Cordoned after an undrain. That is agent: after an undrain the agent stays Cordoned, and the agent list and get examples fail #1833.cliand timed out at its 60 s step forsdk, in a slow run (825 s). It does not touch secrets or files.UI click-through, for a person who is signed in. On Secrets:
Closes #1666
🤖 Generated with Claude Code