Files
query-orchestration/internal/cognitoauth/cognitotest/readme.md
T
jay brown b56c67f807 functionally complete
needs cleanup next
2025-07-18 10:40:05 -07:00

2.2 KiB

Cognitotest sub module

This is a completely seperate submodule just for end to end testing of the cognito authentication libraries.

This submodule is not vendored.

The chromedp library used by this module requires Chrome/Chromium to be properly installed. It's not enough to simply add the Go package - you need the actual browser binaries and their dependencies.

This is why this module must not pollute the top level modules go.mod. If it did, then all of the docker containers for this entire project would have to have a massive amount of chrome dependencies added instead of just being able to run on a scratch container.

To run the tests just run ./test.sh from this directory. Also the local permit.io pdp must also be running.
This can be started by running demo.sh in /cmd/cognito_test/permit_test/permit.harness

Obtaining a reusable JWT token

If you observe the log output of running test.sh and look for msg="Raw Access Token" token= xxx... You can copy that token value and reuse it until it expires which by default is one hour after the creation of the token.

It will look like this example (actual token) msg="Raw Access Token" token=eyJraWQiOiJVMFwvbW04QXJUN1FWMDZMRThjdjRqaUk5eEpSaG1Zak1PbTYzNHRPemhFZz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJlMTJiYjUxMC0zMGUxLTcwNjItYTY5YS1jYTdmM2YzOGQ4MGUiLCJjb2duaXRvOmdyb3VwcyI6WyJ1cGxvYWRlcnMiLCJxdWVyeWJ1aWxkZXJzIl0sImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTIuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0yXzF5NnBvOHJSOCIsInZlcnNpb24iOjIsImNsaWVudF9pZCI6IjU1MmNxa2YzNjQwdDM5bmNlaGttZ3BjZTMxIiwib3JpZ2luX2p0aSI6IjdkZmM2MjU4LWU5MzMtNDY0NS1iMmQzLThkYjhiZWZhYTU1NCIsImV2ZW50X2lkIjoiZDY5M2Q3MjEtZmI5MS00ZmRkLWEyZWQtMTY2ZTNiODlkMTVjIiwidG9rZW5fdXNlIjoiYWNjZXNzIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCIsImF1dGhf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