Skip to content

Commit

Permalink
Add StaticHostUserV2 (#46038)
Browse files Browse the repository at this point in the history
This change adds the v2 static host user resource.
  • Loading branch information
atburke authored Sep 4, 2024
1 parent a64a09f commit 564c245
Show file tree
Hide file tree
Showing 23 changed files with 503 additions and 426 deletions.
2 changes: 1 addition & 1 deletion api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import (
secreportsv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/secreports/v1"
trustpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/trust/v1"
userloginstatev1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/userloginstate/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v2"
userspb "github.com/gravitational/teleport/api/gen/proto/go/teleport/users/v1"
"github.com/gravitational/teleport/api/gen/proto/go/teleport/vnet/v1"
userpreferencespb "github.com/gravitational/teleport/api/gen/proto/go/userpreferences/v1"
Expand Down
8 changes: 4 additions & 4 deletions api/client/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
kubewaitingcontainerpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/kubewaitingcontainer/v1"
machineidv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/machineid/v1"
notificationsv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/notifications/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v2"
"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 @@ -96,8 +96,8 @@ func EventToGRPC(in types.Event) (*proto.Event, error) {
SPIFFEFederation: r,
}
case *userprovisioningpb.StaticHostUser:
out.Resource = &proto.Event_StaticHostUser{
StaticHostUser: r,
out.Resource = &proto.Event_StaticHostUserV2{
StaticHostUserV2: r,
}
default:
return nil, trace.BadParameter("resource type %T is not supported", r)
Expand Down Expand Up @@ -539,7 +539,7 @@ func EventFromGRPC(in *proto.Event) (*types.Event, error) {
} else if r := in.GetSPIFFEFederation(); r != nil {
out.Resource = types.Resource153ToLegacy(r)
return &out, nil
} else if r := in.GetStaticHostUser(); r != nil {
} else if r := in.GetStaticHostUserV2(); r != nil {
out.Resource = types.Resource153ToLegacy(r)
return &out, nil
} else {
Expand Down
116 changes: 59 additions & 57 deletions api/client/proto/event.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/client/statichostuser/statichostuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/gravitational/trace"

userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v1"
userprovisioningpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/userprovisioning/v2"
)

// Client is a StaticHostUser client.
Expand Down
Loading

0 comments on commit 564c245

Please sign in to comment.