Repository navigation
Conversation
Geoff asked whether vending could go through baton custom actions instead of IssueCredential. This is the prototype to compare against the Issue path. Two global actions register with RegisterWithSecrets, one per credential kind, each gated on the same operator grant that gates its Issue counterpart. Their secret return is exactly the Field the descriptor advertises, and the public returns are identifiers only, so C1 can show and revoke a vended key without ever holding it. The mint and plaintext helpers are shared with Issue rather than copied, so both paths deliver the same api_key_v2 document under the same name. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
applicationKeyBuilder.Delete takes the bare key id as resourceID and the service account as parentResourceID. The action returned a composite "<service-account>/<key>" id instead, so DeleteResourceV2 with it would have looked up a key that does not exist. The response now carries the bare id, plus the parent type and id the deleter needs. Also share the minting with Issue rather than copying it: the duplicate guard, the service-account re-check, the create call and the discard-on-encode-failure now live in mintOrganizationAPIKey and mintServiceAccountApplicationKey, called by both paths. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Contributor
Author
|
Squire (claude-opus-5-5): Closing. These hand-written vending actions were a prototype for an approach that has been dropped. The revised plan exposes existing IssueCredential implementations as custom actions through a baton-sdk adapter, so connector-specific vending actions aren't needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Squire (Together/DeepSeek-V4.1-Flash-1017):
What this is
A prototype, for comparison with the
IssueCredentialpath in #55. Geoff askedwhether credential vending could go through baton custom actions instead, so this
does exactly that for both Datadog credential kinds. It is not a proposal to
replace #55 — the point is to have both mechanisms in hand and compare them.
Stacked on #55; base branch is
highb/IGA-5308/emit-multipass-api-key-v2-json.It depends on baton-sdk #1218 for
CredentialIssueOptionDescriptor.output, thesame dependency #55 has.
Modelled on the AWS connector's
issueFederationTokenSchema:pkg/connector/sts_actions.go.How it works
Two global actions, registered with
actions.RegisterWithSecrets:issue_organization_api_keyallow-org-api-key-deletionrequest_idissue_service_account_application_keysync-secrets+sync-service-account-application-keysrequest_id,service_account_id, optionalscopesEach gate matches the one that gates the corresponding
IssueCredentialkind, soan action cannot mint a credential the connector has no way to revoke.
The secret return is exactly the
Fieldthe descriptor already advertises(
is_secret,content_typeapplication/vnd.multipass.api_key_v2+json, thetags, and a string field). The public returns are
key_id,secret_resource_type_idandsecret_resource_id— identifiers only, so C1 canrevoke through
DeleteResourceV2without ever holding the key.The minting and plaintext helpers are shared with
Issue, not copied, so bothpaths produce the same
api_key_v2document under the same name.Why this might not be the shape
Worth stating plainly, since the comparison is the point:
IssueCredentialproduces a syncedsecret resource with a
SecretTraitand a revoke path wired into the SDK. Anaction returns bytes once and the caller owns them; nothing is registered for
later sync or revocation.
IssueCredentialcontract checks. Scopes, expiry, resource mode and thedeleter requirement are enforced by the SDK on the Issue path. Here they are
re-implemented per action, which is more surface to keep in step.
request_ididempotency is duplicated from Issue, not shared.What it gains: the caller chooses at invocation time, and the secret never
becomes a resource in the connector's own inventory.
Tests
TestVendingActionsDeclareTheSameSecretReturnAsIssue— the secret returnequals the descriptor
Fieldbyte for byte; public returns are the threeidentifiers.
TestVendingActionsGatedOnOperatorGrants— no grant, no action;each grant enables only its own action.
TestVendingActionVendsThroughTheActionManager— drives the real actionmanager with a real age recipient: the provider is called, the response
carries the identifiers and never the key, and the returned
EncryptedDatais ciphertext holding no plaintext.
TestVendingActionRefusesDuplicateRequestID— a repeated request is refusedrather than minting a second key.
go build ./...,go vet ./...,go test ./...andgolangci-lint run(CI'sv2.14.0) pass.
baton_capabilities.jsonis unchanged: these are actions, notconnector capabilities, so no regeneration was needed.
Known CI
verify-versions-matchfails for the same reason as #55:.versions.yamlonmainpins baton-sdkv0.43.0, and both branches need the commit that adds thecredential-issue output field.