Skip to content

Commit

Permalink
Workload ID: Add Protos for WorkloadIdentity resource, CRUD and events (
Browse files Browse the repository at this point in the history
#49650)

* Add protos for resource and resource svc

* Add field for encoding the created/updated workloadidentity in audit
events

* Remove redundant package qualifier

* Add UpsertWorkloadIdentity

* Appease linter

* Add TrimToMaxSize implementation
  • Loading branch information
strideynet committed Dec 9, 2024
1 parent a8942de commit 9490afb
Show file tree
Hide file tree
Showing 17 changed files with 5,653 additions and 2,460 deletions.
8 changes: 8 additions & 0 deletions api/client/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
provisioningv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/provisioning/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v2"
usertasksv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/usertasks/v1"
workloadidentityv1pb "github.com/gravitational/teleport/api/gen/proto/go/teleport/workloadidentity/v1"
"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/api/types/accesslist"
accesslistv1conv "github.com/gravitational/teleport/api/types/accesslist/convert/v1"
Expand Down Expand Up @@ -135,6 +136,10 @@ func EventToGRPC(in types.Event) (*proto.Event, error) {
out.Resource = &proto.Event_IdentityCenterAccountAssignment{
IdentityCenterAccountAssignment: r,
}
case *workloadidentityv1pb.WorkloadIdentity:
out.Resource = &proto.Event_WorkloadIdentity{
WorkloadIdentity: r,
}
default:
return nil, trace.BadParameter("resource type %T is not supported", r)
}
Expand Down Expand Up @@ -609,6 +614,9 @@ func EventFromGRPC(in *proto.Event) (*types.Event, error) {
} else if r := in.GetIdentityCenterAccountAssignment(); r != nil {
out.Resource = types.Resource153ToLegacy(r)
return &out, nil
} else if r := in.GetWorkloadIdentity(); r != nil {
out.Resource = types.Resource153ToLegacy(r)
return &out, nil
} else {
return nil, trace.BadParameter("received unsupported resource %T", in.Resource)
}
Expand Down
696 changes: 362 additions & 334 deletions api/client/proto/event.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit 9490afb

Please sign in to comment.