diff --git a/api/client/accesslist/accesslist.go b/api/client/accesslist/accesslist.go index 3fc0acade95d2..d64b9db23e7ab 100644 --- a/api/client/accesslist/accesslist.go +++ b/api/client/accesslist/accesslist.go @@ -48,7 +48,9 @@ func (c *Client) GetAccessLists(ctx context.Context) ([]*accesslist.AccessList, accessLists := make([]*accesslist.AccessList, len(resp.AccessLists)) for i, accessList := range resp.AccessLists { var err error - accessLists[i], err = conv.FromProto(accessList) + accessLists[i], err = conv.FromProto( + accessList, + conv.WithOwnersIneligibleStatusField(accessList.GetSpec().GetOwners())) if err != nil { return nil, trace.Wrap(err) } @@ -70,7 +72,7 @@ func (c *Client) ListAccessLists(ctx context.Context, pageSize int, nextToken st accessLists := make([]*accesslist.AccessList, len(resp.AccessLists)) for i, accessList := range resp.AccessLists { var err error - accessLists[i], err = conv.FromProto(accessList) + accessLists[i], err = conv.FromProto(accessList, conv.WithOwnersIneligibleStatusField(accessList.GetSpec().GetOwners())) if err != nil { return nil, "", trace.Wrap(err) } @@ -102,7 +104,7 @@ func (c *Client) GetAccessListsToReview(ctx context.Context) ([]*accesslist.Acce accessLists := make([]*accesslist.AccessList, len(resp.AccessLists)) for i, accessList := range resp.AccessLists { var err error - accessLists[i], err = conv.FromProto(accessList) + accessLists[i], err = conv.FromProto(accessList, conv.WithOwnersIneligibleStatusField(accessList.GetSpec().GetOwners())) if err != nil { return nil, trace.Wrap(err) } @@ -119,7 +121,7 @@ func (c *Client) UpsertAccessList(ctx context.Context, accessList *accesslist.Ac if err != nil { return nil, trace.Wrap(err) } - responseAccessList, err := conv.FromProto(resp) + responseAccessList, err := conv.FromProto(resp, conv.WithOwnersIneligibleStatusField(resp.GetSpec().GetOwners())) return responseAccessList, trace.Wrap(err) } @@ -131,7 +133,7 @@ func (c *Client) UpdateAccessList(ctx context.Context, accessList *accesslist.Ac if err != nil { return nil, trace.Wrap(err) } - responseAccessList, err := conv.FromProto(resp) + responseAccessList, err := conv.FromProto(resp, conv.WithOwnersIneligibleStatusField(resp.GetSpec().GetOwners())) return responseAccessList, trace.Wrap(err) } @@ -227,7 +229,7 @@ func (c *Client) UpsertAccessListMember(ctx context.Context, member *accesslist. if err != nil { return nil, trace.Wrap(err) } - responseMember, err := conv.FromMemberProto(resp) + responseMember, err := conv.FromMemberProto(resp, conv.WithMemberIneligibleStatusField(resp)) return responseMember, trace.Wrap(err) } @@ -239,7 +241,7 @@ func (c *Client) UpdateAccessListMember(ctx context.Context, member *accesslist. if err != nil { return nil, trace.Wrap(err) } - responseMember, err := conv.FromMemberProto(resp) + responseMember, err := conv.FromMemberProto(resp, conv.WithMemberIneligibleStatusField(resp)) return responseMember, trace.Wrap(err) } diff --git a/api/client/events.go b/api/client/events.go index 5494d9754e9cc..99a75f72f354b 100644 --- a/api/client/events.go +++ b/api/client/events.go @@ -440,7 +440,10 @@ func EventFromGRPC(in *proto.Event) (*types.Event, error) { out.Resource = r return &out, nil } else if r := in.GetAccessList(); r != nil { - out.Resource, err = accesslistv1conv.FromProto(r) + out.Resource, err = accesslistv1conv.FromProto( + r, + accesslistv1conv.WithOwnersIneligibleStatusField(r.GetSpec().GetOwners()), + ) if err != nil { return nil, trace.Wrap(err) } @@ -452,7 +455,10 @@ func EventFromGRPC(in *proto.Event) (*types.Event, error) { } return &out, nil } else if r := in.GetAccessListMember(); r != nil { - out.Resource, err = accesslistv1conv.FromMemberProto(r) + out.Resource, err = accesslistv1conv.FromMemberProto( + r, + accesslistv1conv.WithMemberIneligibleStatusField(r), + ) if err != nil { return nil, trace.Wrap(err) } diff --git a/api/types/accesslist/convert/v1/member.go b/api/types/accesslist/convert/v1/member.go index f624287dbb17e..3fe632b167389 100644 --- a/api/types/accesslist/convert/v1/member.go +++ b/api/types/accesslist/convert/v1/member.go @@ -64,7 +64,7 @@ func FromMembersProto(msgs []*accesslistv1.Member) ([]*accesslist.AccessListMemb members := make([]*accesslist.AccessListMember, len(msgs)) for i, msg := range msgs { var err error - members[i], err = FromMemberProto(msg) + members[i], err = FromMemberProto(msg, WithMemberIneligibleStatusField(msg)) if err != nil { return nil, trace.Wrap(err) }