Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Nov 8, 2021
1 parent 1561826 commit da80e96
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/tools/opa/policies/tokens_chained.rego
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ tokens_chained {
pair_count == count(input.path_segments) - 1
}

contains(arr, elem) {
arr[_] = elem
}

pair_valid(token1, token2) = r {
p1 := payload(token1)
p2 := payload(token2)
r := contains(p1.aud, p2.sub)
r := p1.aud[_] == p2.sub
}

payload(token) = p {
Expand Down

0 comments on commit da80e96

Please sign in to comment.