Skip to content

Commit 46175da

Browse files
committed
Remove unnecessary marshalling
Signed-off-by: Jason Parraga <[email protected]>
1 parent d3ddd31 commit 46175da

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

flyteadmin/auth/config/config.go

-26
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package config
22

33
import (
4-
"encoding/json"
5-
"fmt"
64
"net/url"
75
"time"
86

@@ -261,18 +259,6 @@ type AuthorizationPolicy struct {
261259
Rules []Rule `json:"rules" pflag:",Allow rules for matching requests."`
262260
}
263261

264-
func (ap AuthorizationPolicy) MarshalJSON() ([]byte, error) {
265-
return json.Marshal(ap)
266-
}
267-
268-
func (ap AuthorizationPolicy) UnmarshalJSON(b []byte) error {
269-
err := json.Unmarshal(b, &ap)
270-
if err != nil {
271-
return fmt.Errorf("unmarshalling AuthorizationPolicy: %w", err)
272-
}
273-
return nil
274-
}
275-
276262
// A Rule is a struct that represents an API request to match on.
277263
type Rule struct {
278264
MethodPattern string `json:"methodPattern" pflag:",Regex pattern for the gRPC method of the request."`
@@ -296,18 +282,6 @@ type TokenClaim struct {
296282
Name string `json:"name" pflag:",Scope of the claim to look for in the token."`
297283
}
298284

299-
func (tc TokenClaim) MarshalJSON() ([]byte, error) {
300-
return json.Marshal(tc)
301-
}
302-
303-
func (tc TokenClaim) UnmarshalJSON(b []byte) error {
304-
err := json.Unmarshal(b, &tc)
305-
if err != nil {
306-
return fmt.Errorf("unmarshalling TokenClaim: %w", err)
307-
}
308-
return nil
309-
}
310-
311285
//go:generate enumer --type=SameSite --trimprefix=SameSite -json
312286
type SameSite int
313287

flyteadmin/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ require (
5252
github.com/wI2L/jsondiff v0.6.0
5353
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0
5454
go.opentelemetry.io/otel v1.24.0
55+
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
5556
golang.org/x/net v0.33.0
5657
golang.org/x/oauth2 v0.18.0
5758
golang.org/x/sync v0.10.0
@@ -198,7 +199,6 @@ require (
198199
go.uber.org/multierr v1.11.0 // indirect
199200
go.uber.org/zap v1.27.0 // indirect
200201
golang.org/x/crypto v0.31.0 // indirect
201-
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
202202
golang.org/x/sys v0.28.0 // indirect
203203
golang.org/x/term v0.27.0 // indirect
204204
golang.org/x/text v0.21.0 // indirect

0 commit comments

Comments
 (0)