Skip to content

Commit

Permalink
feat(service): no dpop
Browse files Browse the repository at this point in the history
  • Loading branch information
arkavo-com committed Apr 28, 2024
1 parent 0393a6e commit 03c6b1d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions service/kas/access/rewrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func verifyAndParsePolicy(ctx context.Context, requestBody *RequestBody, k []byt
func getEntityInfo(ctx context.Context) (*entityInfo, error) {
var info = new(entityInfo)

// check if metadata exists. if it doesn't not sure how we got to this point
// check if metadata exists. if it doesn't then sure how we got to this point
md, exists := metadata.FromIncomingContext(ctx)
if !exists {
slog.WarnContext(ctx, "missing metadata")
Expand All @@ -185,13 +185,6 @@ func getEntityInfo(ctx context.Context) (*entityInfo, error) {
return nil, status.Error(codes.Unauthenticated, "missing authorization header")
}

switch {
case strings.HasPrefix(header[0], "DPoP "):
tokenRaw = strings.TrimPrefix(header[0], "DPoP ")
default:
return nil, status.Error(codes.Unauthenticated, "not of type dpop")
}

token, err := jwt.ParseInsecure([]byte(tokenRaw))
if err != nil {
slog.WarnContext(ctx, "unable to get token")
Expand Down

0 comments on commit 03c6b1d

Please sign in to comment.