Skip to content

profiling jwt verification using io.jwt.decode_verify shows multiple invocations #270

Discussion options

You must be logged in to vote

So here's what is notoriously misleading about the NUM EVAL and NUM REDO: it accumulates the numbers of the expressions that the source line expanded into.

In your example, allow is rewritten in the compiler to

allow = true {
    input.message = "hello"
    __local4__ = input.token
    __local5__ = data.authz.jwks
    io.jwt.decode_verify(__local4__, {"aud": "some-audience", "cert": __local5__}, __local3__)
    [__local0__, __local1__, __local2__] = __local3__
}

and the last 4 lines of the body come from the one line you had there in policy.rego:21. They're each evaluated (and redone) once, but aggregated, you'll get a 4 on both counts.

Does that help? I'm afraid there's no simple way to …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alam-chime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants