Skip to content

Commit 187b93a

Browse files
Update rewrap.go
1 parent 63408a4 commit 187b93a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

service/kas/access/rewrap.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,6 @@ func (p *Provider) tdf3Rewrap(ctx context.Context, requests []*kaspb.UnsignedRew
888888
auditEvents := make(map[auditEventKey]*audit.RewrapEvent)
889889

890890
for _, req := range requests {
891-
if req == nil || req.GetPolicy() == nil || req.GetPolicy().GetId() == "" {
892-
continue
893-
}
894891
policyID := req.GetPolicy().GetId()
895892
for _, kao := range req.GetKeyAccessObjects() {
896893
if kao == nil {
@@ -1063,23 +1060,15 @@ func (p *Provider) nanoTDFRewrap(ctx context.Context, requests []*kaspb.Unsigned
10631060
ctx, span := p.Start(ctx, "nanoTDFRewrap")
10641061
defer span.End()
10651062

1066-
// Pre-create audit events for all KAOs to ensure they're logged even if a panic occurs
10671063
type auditEventKey struct {
10681064
policyID string
10691065
kaoID string
10701066
}
10711067
auditEvents := make(map[auditEventKey]*audit.RewrapEvent)
10721068

10731069
for _, req := range requests {
1074-
if req == nil || req.GetPolicy() == nil || req.GetPolicy().GetId() == "" {
1075-
continue
1076-
}
10771070
policyID := req.GetPolicy().GetId()
10781071
for _, kao := range req.GetKeyAccessObjects() {
1079-
if kao == nil {
1080-
continue
1081-
}
1082-
10831072
kaoID := kao.GetKeyAccessObjectId()
10841073

10851074
// For nano, we need to extract the header to get keyID and policyBinding
@@ -1161,7 +1150,7 @@ func (p *Provider) nanoTDFRewrap(ctx context.Context, requests []*kaspb.Unsigned
11611150
policyID := req.GetPolicy().GetId()
11621151
kaoResults, ok := results[policyID]
11631152
if !ok { // this should not happen
1164-
//nolint:sloglint // reference to key is intentional
1153+
11651154
p.Logger.WarnContext(ctx, "policy not found in policyReq response",
11661155
slog.String("policy_id", policyID),
11671156
slog.Any("policy.uuid", policy.UUID))
@@ -1181,9 +1170,6 @@ func (p *Provider) nanoTDFRewrap(ctx context.Context, requests []*kaspb.Unsigned
11811170
slog.String("policy_id", policyID),
11821171
slog.Any("policy.uuid", policy.UUID),
11831172
slog.String("kao_id", kaoID),
1184-
slog.Any("pdp_access_result", pdpAccess),
1185-
slog.Any("kao_info", kaoInfo),
1186-
slog.Any("audit_events", auditEvents),
11871173
)
11881174
continue
11891175
}

0 commit comments

Comments
 (0)