Skip to content

Commit

Permalink
Need additional header for secret opa tokens
Browse files Browse the repository at this point in the history
Tyk will only allow valid bearer tokens, so need additional place to add magic root token
  • Loading branch information
daisieh committed Jul 28, 2022
1 parent 84a464a commit 832948c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion permissions_engine/authz.rego
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ allow { # Allow request if...
right.path == input.path # Right.path matches input.path.
}

x_opa := input.headers["X-Opa"][_]

identity_rights[right] { # Right is in the identity_rights set if...
token := tokens[input.identity] # Token exists for identity, and...
token := tokens[x_opa] # Token exists for identity, and...
role := token.roles[_] # Token has a role, and...
right := rights[role] # Role has rights defined.
}
Expand Down

0 comments on commit 832948c

Please sign in to comment.