Skip to content

nhi: emit STATIC_SECRET credential type for fine-grained PATs#170

Merged
pquerna merged 1 commit into
mainfrom
nhi/emit-credential-type
Jun 1, 2026
Merged

nhi: emit STATIC_SECRET credential type for fine-grained PATs#170
pquerna merged 1 commit into
mainfrom
nhi/emit-credential-type

Conversation

@c1-squire-dev
Copy link
Copy Markdown
Contributor

@c1-squire-dev c1-squire-dev Bot commented May 31, 2026

NHI Phase-1 trait-emit (Class-A). Annotates the already-synced api-key resource (fine-grained personal access token, built in pkg/connector/api_token.go:apiTokenResource) with the spine secret trait:

  • WithSecretType(SecretTrait_CREDENTIAL_TYPE_STATIC_SECRET) — a fine-grained PAT is an opaque static bearer token.
  • WithSecretDetail("github.token.pat") — axis-2 platform kind, dotted-lowercase, matching the gitlab.token.pat sibling convention.

Bumps baton-sdk to v0.11.0 for WithSecretType / WithSecretDetail and the SecretTrait_CredentialType enum. This is the interim self-bump strategy (RFC D-345); it rebases after the fleet-wide SDK bump.

Scope notes:

  • K2 (account_type SERVICE for bot/machine accounts): not in scope. The connector never emits User.Type, so synced users are not distinguishable as bots today; RFC §6 marks GitHub K2 as not-applicable. Adding bot detection would require emitting a new field (not a Class-A annotation).
  • GitHub Apps / installations, classic PATs, deploy keys, Actions tokens: not synced today → Class-B (new syncer, RFC §5.8.8), deferred.

Build: go build ./... ✅ · Tests: go test ./... ✅ · Lint: golangci-lint run ./pkg/connector/... ✅ (0 issues).


🛰️ Built with pqprime.

@c1-squire-dev c1-squire-dev Bot requested a review from a team May 31, 2026 15:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 31, 2026

Connector PR Review: nhi: emit STATIC_SECRET credential type for fine-grained PATs

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Review mode: full
View review run

Review Summary

This PR adds two SDK secret trait options (WithSecretType and WithSecretDetail) to the existing apiTokenResource function in api_token.go, annotating fine-grained PATs with CREDENTIAL_TYPE_STATIC_SECRET and the platform kind github.token.pat. The change is additive and well-scoped — no new resource types, no breaking changes, and the SDK at v0.11.1 already supports both functions. No issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.

@c1-squire-dev c1-squire-dev Bot force-pushed the nhi/emit-credential-type branch from ef2e1b2 to 9325126 Compare May 31, 2026 17:03
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.

Annotate the already-synced api-key resource (fine-grained personal
access token) with the NHI Phase-1 spine secret trait: credential type
STATIC_SECRET and detail github.token.pat.

Bumps baton-sdk to v0.11.0 for the WithSecretType/WithSecretDetail
helpers and the SecretTrait_CredentialType enum (interim; rebases after
the fleet bump).

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@c1-squire-dev c1-squire-dev Bot force-pushed the nhi/emit-credential-type branch from 9325126 to 82d710b Compare June 1, 2026 04:13
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.

@pquerna pquerna merged commit adfd937 into main Jun 1, 2026
8 of 9 checks passed
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