You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
This issue is to change (sophisticate) the ServiceIdentity type in pkg/identity from a string to a struct{} so it can capture more context.
As a string this relies on implied structure, form, separators etc. to capture context of service accounts, namespaces, trust domain etc. Changing this to a struct would allow us to not rely on parsing strings, but actually capturing this in properly typed fields of a struct.
After the resolution of #3186, we no longer need to parse k8s primitives to construct the ServiceIdentity for a proxy. The ServiceIdentity is now encoded in the XDS bootstrap cert, and is derived using the GetServiceIdentityFromProxyCertificate() helper.
Thus, the only conversion necessary is when we want to retrieve the ServiceAccount from the ServiceIdentity, for which we already have identity.ToK8sServiceAccount().
In general, it makes sense to convert identity.ServiceIdentity to a struct if sophistication is needed, but I don't see that being necessary at the moment. Using a string type allows abstracting the identity, which in the future could hold a SPIFFE ID. This would not be possible if we start encoding k8s primitives in the ServiceIdentity type, without also tightly coupling ServiceIdentity to k8s primitives.
This issue is to change (sophisticate) the
ServiceIdentity
type inpkg/identity
from astring
to astruct{}
so it can capture more context.As a string this relies on implied structure, form, separators etc. to capture context of service accounts, namespaces, trust domain etc. Changing this to a struct would allow us to not rely on parsing strings, but actually capturing this in properly typed fields of a struct.
Context: #3170 (comment)
This is a sub-task of #2218
The text was updated successfully, but these errors were encountered: