Skip to content

feat(identity): add String methods to identity enumerations - #12

Merged
ajbeck merged 1 commit into
claude/api-e4-invocation-error-typesfrom
claude/api-e5-identity-enum-strings
Sep 27, 2026
Merged

ajbeck merged 1 commit into
claude/api-e4-invocation-error-typesfrom
claude/api-e5-identity-enum-strings

Conversation

@ajbeck

@ajbeck ajbeck commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Implements E5. Kind, Source, ClaimKind, Representation and IAMPrincipalType now print stable lowercase names (TypeName(n) for undeclared values). Caller.String prints identity.Caller{kind:iam,source:verified_iam_proof} instead of numeric codes. The names are built from keyed arrays, so they can't drift from the constants. Tests cover every declared value, one undeclared value per type, and confirm the caller text still leaks no identifiers.

Part of decision 0026, approved by the owner; stacked on #11.

Validation

gofmt, go vet ./..., go mod verify, go test -race ./..., sh scripts/check-consumer.sh, Linux arm64/amd64 builds and git diff --check all pass locally on Go 1.27.1.

Not breaking: diagnostic text was already documented as non-contractual.

Kind, Source, ClaimKind, Representation and IAMPrincipalType now format as stable lowercase names, with TypeName(n) for undeclared values. Caller.String uses them, so a caller prints as identity.Caller{kind:iam,source:verified_iam_proof} instead of numeric codes. Diagnostics still exclude identifiers and claims.
@ajbeck
ajbeck added this pull request to stack #7 September 27, 2026 14:36
@ajbeck
ajbeck marked this pull request as ready for review September 27, 2026 15:05
@ajbeck
ajbeck merged commit 20c45bb into main Sep 27, 2026
4 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