nhi: emit ACCOUNT_TYPE_SERVICE for Temporal Cloud service accounts#82
Open
c1-squire-dev[bot] wants to merge 2 commits into
Open
nhi: emit ACCOUNT_TYPE_SERVICE for Temporal Cloud service accounts#82c1-squire-dev[bot] wants to merge 2 commits into
c1-squire-dev[bot] wants to merge 2 commits into
Conversation
Contributor
Connector PR Review: nhi: emit ACCOUNT_TYPE_SERVICE for Temporal Cloud service accountsBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThis PR adds a new Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
67253a5 to
cbc343c
Compare
NHI Phase-1 class-C/B fix (RFC v6 §6 row 21, §5.9.2 C1). helpers.go previously emitted ACCOUNT_TYPE_HUMAN for every principal. Per the Temporal Cloud API, GetUsers returns only human identities (identityv1.User has no human/service discriminator), so HUMAN there is correct — the wrong-type finding is really an under-syncing one: service accounts are a distinct identity (GetServiceAccounts -> identityv1.ServiceAccount) that was not synced at all. - Add a service-account resource type (TRAIT_USER). - Add protoServiceAccountToResource emitting WithAccountType(SERVICE). - Add serviceAccountBuilder (List over GetServiceAccounts) and register it. - Bump baton-sdk v0.10.0 -> v0.11.0 (D-345 interim). 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>
405b303 to
7f17088
Compare
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.
NHI Phase-1 — Temporal Cloud (RFC v6 §6 row 21, §5.9.2 C1)
Fixes the K2 account-type classification for Temporal Cloud. Tagged class C + B in the coverage matrix.
Finding
pkg/connector/helpers.go(protoUserToResource) emittedWithAccountType(ACCOUNT_TYPE_HUMAN)unconditionally on every principal returned byGetUsers.Grounding (the SA discriminator)
Verified against the real Temporal Cloud API (
go.temporal.io/cloud-sdk@v0.3.1):identityv1.User/UserSpeccarry no human-vs-service discriminator field (UserSpec = {Email, Access}).GetUsersreturns only human identities — soHUMANon that path is actually correct, not a fabricated default.CloudService.GetServiceAccounts→identityv1.ServiceAccount({Id, Spec{Name, Access, Description}, ...}, no email). They were not synced at all today.So the "wrong-type" finding (C) is in substance an under-syncing one (B): the fix is a new service-account syncer, not a discriminator on the user path.
Changes
resource_types.go— addservice-accountresource type (TRAIT_USER).helpers.go— addprotoServiceAccountToResource, emittingWithAccountType(ACCOUNT_TYPE_SERVICE); document the GetUsers-is-humans-only invariant onprotoUserToResource.service_accounts.go(new) —serviceAccountBuilder,ListoverGetServiceAccounts(paginated, mirrorsuserBuilder), Entitlements/Grants empty.connector.go— registernewServiceAccountBuilder.go.mod— bumpbaton-sdkv0.10.0 → v0.11.0 (D-345 interim).account_typehas no axis-2 detail param (per RFC §2.8/§2.9) — none added.Verification
go build ./...✅ ·go vet ./...✅ ·go test ./...✅ ·gofmt -lclean ·golangci-lint run0 issuesReady for review — do not merge.