core/authorize: use uuid for jti, current time for iat and exp (#5147)

* core/authorize: use uuid for jti, current time for iat and exp

* exclude the jtis

* Update authorize/evaluator/headers_evaluator_test.go

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>

---------

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
This commit is contained in:
Caleb Doxsey 2024-06-25 11:31:00 -06:00 committed by GitHub
parent a7dd30ad29
commit bf1d228131
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 32 deletions

View file

@ -537,7 +537,7 @@ func TestPomeriumJWT(t *testing.T) {
// Obtain a Pomerium attestation JWT from the /.pomerium/jwt endpoint. The
// contents should be identical to the JWT header (except possibly the
// timestamps). (https://github.com/pomerium/pomerium/issues/4210)
// timestamps and the jtis). (https://github.com/pomerium/pomerium/issues/4210)
res, err = client.Get("https://restricted-httpdetails.localhost.pomerium.io/.pomerium/jwt")
require.NoError(t, err)
defer res.Body.Close()
@ -549,8 +549,10 @@ func TestPomeriumJWT(t *testing.T) {
// Remove timestamps before comparing.
delete(p, "iat")
delete(p, "exp")
delete(p, "jti")
delete(p2, "iat")
delete(p2, "exp")
delete(p2, "jti")
assert.Equal(t, p, p2)
}