feat(credentials): issue service principal client secrets#50
feat(credentials): issue service principal client secrets#50c1-squire-dev[bot] wants to merge 11 commits into
Conversation
|
@/tmp/summary.md |
|
Updated to finalized SDK commit |
|
Rebased onto current |
8a3d4f6 to
d9436a2
Compare
|
Cleared the real lint failure in this release-gated draft. The test server now encodes its synthetic response as a JSON map rather than marshaling a typed struct with a |
Prototype OAuth client-secret issuance, sync, TTL, and secret-safe HTTP handling. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Move lifetime to issuance constraints, use structured outputs, and gracefully omit unreadable service-principal secrets on 403/404. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Move profiles and status from deprecated trait fields to resource attributes and read provisioning metadata from the canonical resource profile. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Add account-scoped deletion, exact issue/list/delete parity coverage, and workspace-only issuance capability gating per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Encode the synthetic Databricks response as a JSON map so gosec does not treat the test fixture type as a marshaled production secret. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Use the v0.20.2 expiry, request ID, resource-mode, and resource-type contract while dropping prototype-only vendored API changes per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
4b7d9b5 to
ee41f3d
Compare
|
Release gate cleared in |
Mark service-principal secrets OptInRequired while preserving entitlement skipping and account-scoped issuance registration per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
|
Closed the opt-in contract gap at |
|
Connector PR Review: feat(credentials): issue service principal client secrets Blocking Issues: 0 | Suggestions: 2 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness. The change adds CredentialIssuerV2 client-secret issuance and ResourceDeleterV2 deletion for Databricks account service principals, plus a coordinated SDK migration moving profiles and status from trait-level options to resource-level (WithResourceProfile, WithResourceStatus) with all read sites updated consistently. Secret handling is sound: created secret material is zeroed before building the synced resource, list requests bypass the HTTP cache (GetNoCache) so revoked secrets cannot linger, response-body debug logging was removed, and 403/404 on secret listing degrades gracefully with a Warn. Issuance is correctly gated to account-configured connectors. No blocking issues found; two minor suggestions below. Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agentsVerify each finding against the current code and only fix it if needed. In pkg/connector/service_principal_secrets.go:
|
Skip account-only listing without account configuration, make provider 404 deletion idempotent, and reject sub-second expiry before mutation per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
|
Holistic review follow-up at |
Emit ResourceDoesNotExist for provider 404 and ceil positive expiry to the provider one-second minimum per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
|
Final contract correction at |
Reject sub-second remaining validity before provider mutation so issued credentials cannot exceed approved ExpiresAt per D-NHI-012. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
|
Final security disposition at |
Connector PR Review: feat(credentials): issue service principal client secretsBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness. This adds CredentialIssuerV2 / ResourceDeleterV2 support for account-level Databricks service-principal OAuth client secrets, and migrates trait-level profile/status to resource-level (WithResourceProfile / WithResourceStatus) across users, groups, roles, service-principals, and workspaces. The credential path is well-guarded: issuance is opt-in and gated on account configuration, secret material is returned only via the SDK encrypted PlaintextData contract and cleared from the synced resource, list bypasses HTTP caching to avoid stale post-revocation credentials, delete is idempotent on a provider 404, list degrades gracefully on 403/404, and response-body debug logging was removed. Entity and argument order in create/list/delete are correct, and the profile/status migration is internally consistent (every reader now uses resource.GetProfile(); no leftover trait readers). No blocking issues found. Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agents |
Summary
Adds released
baton-sdkv0.20.2CredentialIssuerV2support for Databricks service principals.CLIENT_SECRETissuance optionResourceDeleterV2using the secret ID and parent service-principal IDLifecycle proof
TestServicePrincipalSecretCredentialLifecycleexercises the connectorbuilder boundary end to end:IssueCredentialcreates and returns a secret resource.DeleteResourceV2calls the provider DELETE endpoint.Capability tests also prove workspace-only mode does not advertise credential issuance.
Dependency
Uses the managed, released
baton-sdkv0.20.2 frommain;.versions.yaml,go.mod, and vendoring agree.Verification
go test -count=1 ./...go build ./cmd/baton-databricksgolangci-lint run --allow-parallel-runnersgo generate ./pkg/configwith no diffgit diff --check origin/main...HEADGrounded in the Databricks Account Service Principal Secrets create/list/delete API and connector source per D-NHI-012.