mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-21 14:35:22 +08:00
* fix: Always populate AllowedResourceIDs on decoded Identity - TLS and SSH cert decoders populated AllowedResourceAccessIDs but left AllowedResourceIDs nil. Any path decoding an identity and re-encoding via Subject() would result in the encoder injecting a sentinel value into the legacy field, and storing all resources under the new AllowedResourceAccessIDs field only. This specifically broke database access in mixed-version clusters: Proxy would decode user cert, build a CSR (Subject()), send it to Auth for signing (FromSubject() then Subject() again). This dropped AllowedResourceIDs, storing all under the new extension, so older database agents received the cert with only the sentinel in the legacy extension, and unaware of the new extension, denied access. Fix by populating AllowedResourceIDs at decode time in both decoders via UnwrapResourceAccessIDs, ensuring and unconstrained resources persist across decode-re-encode cycles. * refac: tidy ca_test encode/decode test