Skip to content

feat: add tenant-store command coverage#212

Merged
jbiskur merged 1 commit into
mainfrom
codex/tenant-store-service-accounts
Apr 15, 2026
Merged

feat: add tenant-store command coverage#212
jbiskur merged 1 commit into
mainfrom
codex/tenant-store-service-accounts

Conversation

@jbiskur
Copy link
Copy Markdown
Contributor

@jbiskur jbiskur commented Apr 15, 2026

What changed

  • add missing tenant-store fetch/validate commands for api keys, secrets, and variables
  • add service-account contracts and commands for create, fetch, list, update, rotate-secret, and delete
  • add tenant-store command tests covering the newly added endpoints

Why

The tenant-store API added service-account support and already exposed additional fetch/validation endpoints that were not covered by the SDK.

Impact

Consumers can now manage tenant-store service accounts and use the remaining tenant-store read/validation endpoints through @flowcore/sdk.

Validation

  • deno fmt src/contracts/api-key.ts src/contracts/index.ts src/contracts/service-account.ts src/commands/index.ts src/commands/api-key/api-key.fetch.ts src/commands/api-key/api-key.validate.ts src/commands/api-key/api-key.validate-with-tenant-id.ts src/commands/secret/secret.fetch.ts src/commands/variable/variable.fetch.ts src/commands/service-account/service-account.fetch.ts src/commands/service-account/service-account.list.ts src/commands/service-account/service-account.create.ts src/commands/service-account/service-account.edit.ts src/commands/service-account/service-account.rotate-secret.ts src/commands/service-account/service-account.delete.ts test/tests/commands/tenant-store.test.ts
  • deno test test/tests/commands/tenant-store.test.ts
  • deno check src/mod.ts

Summary by CodeRabbit

Release Notes

  • New Features

    • Added API key management: fetch and validate operations
    • Added secret and variable retrieval by key
    • Expanded service account functionality: create, list, fetch, edit, delete, and credential rotation
  • Tests

    • Added comprehensive test suite for tenant store operations

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6379336b-76f3-4124-9640-722be9e3469b

📥 Commits

Reviewing files that changed from the base of the PR and between 89b7149 and e7da45a.

📒 Files selected for processing (16)
  • src/commands/api-key/api-key.fetch.ts
  • src/commands/api-key/api-key.validate-with-tenant-id.ts
  • src/commands/api-key/api-key.validate.ts
  • src/commands/index.ts
  • src/commands/secret/secret.fetch.ts
  • src/commands/service-account/service-account.create.ts
  • src/commands/service-account/service-account.delete.ts
  • src/commands/service-account/service-account.edit.ts
  • src/commands/service-account/service-account.fetch.ts
  • src/commands/service-account/service-account.list.ts
  • src/commands/service-account/service-account.rotate-secret.ts
  • src/commands/variable/variable.fetch.ts
  • src/contracts/api-key.ts
  • src/contracts/index.ts
  • src/contracts/service-account.ts
  • test/tests/commands/tenant-store.test.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

This PR introduces new command implementations for API keys, secrets, service accounts, and variables, enabling CRUD and management operations against the tenant-store API. It adds corresponding contract definitions and schema updates, plus a comprehensive test suite validating all new commands.

Changes

Cohort / File(s) Summary
API Key Commands
src/commands/api-key/api-key.fetch.ts, src/commands/api-key/api-key.validate.ts, src/commands/api-key/api-key.validate-with-tenant-id.ts
Added three new command implementations: ApiKeyFetchCommand for retrieving an API key by ID (GET), ApiKeyValidateCommand for validating a key (POST), and ApiKeyValidateWithTenantIdCommand for validating with tenant context (POST). All target tenant-store API and disable retries.
Service Account Commands
src/commands/service-account/service-account.create.ts, src/commands/service-account/service-account.delete.ts, src/commands/service-account/service-account.edit.ts, src/commands/service-account/service-account.fetch.ts, src/commands/service-account/service-account.list.ts, src/commands/service-account/service-account.rotate-secret.ts
Added six new command implementations covering full CRUD and secret rotation: create (POST), delete (DELETE), edit (PATCH), fetch (GET), list (GET with query params), and rotate-secret (POST). All use bearer auth and disable retries.
Secret & Variable Commands
src/commands/secret/secret.fetch.ts, src/commands/variable/variable.fetch.ts
Added fetch commands for secrets and variables (GET requests) with custom 404 error handling to throw NotFoundException when resources are not found.
Contract Definitions
src/contracts/api-key.ts, src/contracts/service-account.ts
Added ApiKeyValidationSchema and ApiKeyValidation type for API key validation responses. Added ServiceAccountSchema, ServiceAccountWithSecretSchema, and ServiceAccountSecretRotationSchema with corresponding static types for service account data structures.
Command & Contract Exports
src/commands/index.ts, src/contracts/index.ts
Updated export indices to expose all new command classes and contract types for public API surface.
Test Suite
test/tests/commands/tenant-store.test.ts
Added comprehensive test suite validating all 11 new commands with both success and failure (404) scenarios, covering request/response matching and exception handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #144: Adds API key command implementations and updates API key contracts/schemas for the tenant-store REST API.
  • #142: Adds secret and variable command modules with related contract schema definitions.

Suggested reviewers

  • suuunly
  • olavurellefsen

Poem

🐰 Hop along the tenant store, commands galore!
Keys that fetch, secrets that hide,
Service accounts take a joyful ride,
Vars and rotations in perfect stride,
REST endpoints spring to life with pride!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/tenant-store-service-accounts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jbiskur jbiskur changed the title [codex] add tenant-store command coverage add tenant-store command coverage Apr 15, 2026
@jbiskur jbiskur changed the title add tenant-store command coverage feat: add tenant-store command coverage Apr 15, 2026
@jbiskur jbiskur marked this pull request as ready for review April 15, 2026 14:40
@jbiskur jbiskur merged commit 1529929 into main Apr 15, 2026
1 of 2 checks passed
@jbiskur jbiskur deleted the codex/tenant-store-service-accounts branch April 15, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant