Repository navigation
feat(core): add listSecrets, getSecret, updateSecret, deleteSecret SDK functions - #139
Conversation
… client-core (closes osaas-app#4371) Co-Authored-By: Claude <noreply@anthropic.com>
Research ReviewTier classification: Tier 3 (touches auth/token handling, shared SDK library with external consumers, API contract changes) Verified
Needs Verification
Potential Guesses DetectedNone detected. Every endpoint path, HTTP method, body field name, and auth header was cross-referenced against the actual backend route handler and model definitions. No guessed values found. Adjacent Stubs DetectedNone. Swept Orphaned Files DetectedNone. All three modified files are existing non-orphaned files. The four new exports ( Impact Analysis
Risks Not Tested
Research Suggestions
Reviewed by PR Research Validator. This review checks whether code is based on verified sources rather than assumptions. |
Summary
Adds the missing secret lifecycle operations to
@osaas/client-core. The backend (deploy-manager) already supports these endpoints; this PR closes the SDK gap.listSecrets(serviceId, ctx)— GET /mysecrets/:serviceId, returns metadata only (no values)getSecret(serviceId, secretName, ctx)— client-side list + find (no single-secret endpoint)updateSecret(serviceId, secretName, value, ctx)— PUT /mysecrets/:serviceId/:secretName (upsert)deleteSecret(serviceId, secretName, ctx)— DELETE /mysecrets/:serviceId/:secretNameAlso refactors
packages/cli/src/user/cmd.tscmdSecretsto use the new SDK functions instead of inlinecreateFetchcalls.Closes Eyevinn/osaas-app#4371.
Lessons
Secret values are write-only by design — list and get return only metadata (serviceId, secretName). The
getSecretfunction is implemented client-side vialistSecrets + .find()because no single-secret GET endpoint exists on the backend. Document this in JSDoc to prevent future agents from trying to add a "get secret value" endpoint. ThecmdSecretsrefactor also revealed thatsaveSecretincore.tsusesnameas the parameter but passes it assecretNamein the body — matching the existing POST contract. The newupdateSecretusessecretNameas the URL path segment (matching the CLI's PUT pattern) rather than a body field.🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com