fix(auth/csvauth): ID() returns Name only, not Name~hashID for tokens

Principal identity is the subject (who), not the credential instance
(which token). The hashID suffix was an internal cache fingerprint that
leaked into the public ID. Callers that need to distinguish individual
token instances must use a separate mechanism.

TSV serialization in ToRecord() still writes Name~hashID when hashID is
set so the credential file round-trips correctly.
This commit is contained in:
AJ ONeal 2026-04-13 22:57:21 -06:00
parent fbb4a14620
commit 02fef67e53
No known key found for this signature in database

View File

@ -57,9 +57,6 @@ type Credential struct {
}
func (c *Credential) ID() string {
if c.Purpose == PurposeToken {
return c.Name + hashIDSep + c.hashID
}
return c.Name
}