Skip to content

Commit b8e143a

Browse files
lint fixes
1 parent bc486f6 commit b8e143a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

service/internal/auth/authn.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,21 +536,29 @@ func (a Authentication) validateDPoP(accessToken jwt.Token, acessTokenRaw string
536536
return nil, fmt.Errorf("the DPoP JWT has expired")
537537
}
538538

539-
htm, ok := dpopToken.Get("htm")
539+
htma, ok := dpopToken.Get("htm")
540540
if !ok {
541541
return nil, fmt.Errorf("`htm` claim missing in DPoP JWT")
542542
}
543+
htm, ok := htma.(string)
544+
if !ok {
545+
return nil, fmt.Errorf("`htm` claim invalid format in DPoP JWT")
546+
}
543547

544-
if !slices.Contains(dpopInfo.m, htm.(string)) {
548+
if !slices.Contains(dpopInfo.m, htm) {
545549
return nil, fmt.Errorf("incorrect `htm` claim in DPoP JWT; received [%v], but should match [%v]", htm, dpopInfo.m)
546550
}
547551

548-
htu, ok := dpopToken.Get("htu")
552+
htua, ok := dpopToken.Get("htu")
549553
if !ok {
550554
return nil, fmt.Errorf("`htu` claim missing in DPoP JWT")
551555
}
556+
htu, ok := htua.(string)
557+
if !ok {
558+
return nil, fmt.Errorf("`htu` claim invalid format in DPoP JWT")
559+
}
552560

553-
if !slices.Contains(dpopInfo.u, htu.(string)) {
561+
if !slices.Contains(dpopInfo.u, htu) {
554562
return nil, fmt.Errorf("incorrect `htu` claim in DPoP JWT; received [%v], but should match [%v]", htu, dpopInfo.u)
555563
}
556564

service/internal/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func NewOpenTDFServer(config Config, logger *logger.Logger) (*OpenTDFServer, err
179179
return "", false
180180
},
181181
),
182-
runtime.WithMetadata(func(ctx context.Context, r *http.Request) metadata.MD {
182+
runtime.WithMetadata(func(ctx context.Context, _ *http.Request) metadata.MD {
183183
md := make(map[string]string)
184184
if method, ok := runtime.RPCMethod(ctx); ok {
185185
md["method"] = method // /grpc.gateway.examples.internal.proto.examplepb.LoginService/Login

0 commit comments

Comments
 (0)