Skip to content

Commit

Permalink
Remove custom marshaling
Browse files Browse the repository at this point in the history
  • Loading branch information
atburke committed Jul 30, 2024
1 parent 8116476 commit 986b994
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/services/local/statichostuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func NewStaticHostUserService(bk backend.Backend) (*StaticHostUserService, error
bk,
types.KindStaticHostUser,
staticHostUserPrefix,
services.MarshalStaticHostUser,
services.UnmarshalStaticHostUser,
services.MarshalProtoResource[*userprovisioningpb.StaticHostUser],
services.UnmarshalProtoResource[*userprovisioningpb.StaticHostUser],
)
if err != nil {
return nil, trace.Wrap(err)
Expand Down
11 changes: 0 additions & 11 deletions lib/services/statichostuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ type StaticHostUser interface {
DeleteStaticHostUser(ctx context.Context, name string) error
}

// MarshalStaticHostUser marshals a StaticHostUser resource to JSON.
func MarshalStaticHostUser(in *userprovisioningpb.StaticHostUser, opts ...MarshalOption) ([]byte, error) {
return MarshalProtoResource(in, opts...)
}

// UnmarshalStaticHostUser unmarshals a StaticHostUser resource from JSON.
func UnmarshalStaticHostUser(data []byte, opts ...MarshalOption) (*userprovisioningpb.StaticHostUser, error) {
out, err := UnmarshalProtoResource[*userprovisioningpb.StaticHostUser](data, opts...)
return out, trace.Wrap(err)
}

func isValidUidOrGid(s string) bool {
// No uid/gid is OK.
if s == "" {
Expand Down

0 comments on commit 986b994

Please sign in to comment.