mirror of
https://github.com/therootcompany/golib.git
synced 2026-04-24 04:38:02 +00:00
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:
parent
fbb4a14620
commit
02fef67e53
@ -57,9 +57,6 @@ type Credential struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Credential) ID() string {
|
func (c *Credential) ID() string {
|
||||||
if c.Purpose == PurposeToken {
|
|
||||||
return c.Name + hashIDSep + c.hashID
|
|
||||||
}
|
|
||||||
return c.Name
|
return c.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user