Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: converge on go-jose #1297

Merged
merged 2 commits into from
Jun 18, 2024
Merged

chore: converge on go-jose #1297

merged 2 commits into from
Jun 18, 2024

Conversation

RTann
Copy link
Contributor

@RTann RTann commented May 22, 2024

github.com/dgrijalva/jwt-go is old and archived in favor of github.com/golang-jwt/jwt

gopkg.in/square/go-jose.v2 is old and archived in favor of github.com/go-jose/go-jose

Honestly wasn't sure which one to pick, so I opted for go-jose because it seemed like it had the nicer interface. The stackrox/stackrox repo also uses both, but mostly go-jose so that helps with this decision, too.

If anyone knows a good way to test this, please let me know

@RTann RTann requested a review from mtodor May 22, 2024 17:01
@RTann RTann requested a review from a team as a code owner May 22, 2024 17:01
@rhacs-bot
Copy link
Contributor

rhacs-bot commented May 22, 2024

A single node development cluster (infra-pr-1297) was allocated in production infra for this PR.

CI will attempt to deploy quay.io/rhacs-eng/infra-server:0.10.1-2-g2585dc3d1c to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-1297 --zone us-central1-a --project acs-team-temp-dev

🛠️ And pull infractl from the deployed dev infra-server with:

nohup kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
make pull-infractl-from-dev-server

🚲 You can then use the dev infra instance e.g.:

bin/infractl -k -e localhost:8443 whoami

⚠️ Any clusters that you start using your dev infra instance should have a lifespan shorter then the development cluster instance. Otherwise they will not be destroyed when the dev infra instance ceases to exist when the development cluster is deleted. ⚠️

Further Development

☕ If you make changes, you can commit and push and CI will take care of updating the development cluster.

🚀 If you only modify configuration (chart/infra-server/configuration) or templates (chart/infra-server/{static,templates}), you can get a faster update with:

make install-local

Logs

Logs for the development infra depending on your @redhat.com authuser:

Or:

kubectl -n infra logs -l app=infra-server --tail=1 -f

@RTann RTann force-pushed the one-jwt-lib branch 2 times, most recently from d0917d2 to d7014d3 Compare May 22, 2024 19:53
@tommartensen
Copy link
Contributor

tommartensen commented May 23, 2024

If anyone knows a good way to test this, please let me know

IMO if you can connect to the cluster created in this PR (if it expired, re-run the GH workflows), port-forward and login, see a token on https:/localhost:8443/downloads and your initials in the top-right corner, the auth should work.

@RTann
Copy link
Contributor Author

RTann commented Jun 14, 2024

I am testing the dev server, and I found it seems ok until I run make pull-infractl-from-dev-server. This command fails every time and, more-or-less, kills the server. It's still up, but it's essentially useless.

$ make pull-infractl-from-dev-server
set -o pipefail; \
	curl --retry 3 --insecure --silent --show-error --fail --location https://localhost:8443/v1/cli/darwin/amd64/upgrade \
          | jq -r ".result.fileChunk" \
          | base64 -d \
          > bin/infractl
/usr/bin/base64: I/O error on input
curl: (23) Failure writing output to destination
make: *** [pull-infractl-from-dev-server] Error 141

Anyone know why this may be?

Otherwise, I can see my auth token (different from my prod one)

@tommartensen
Copy link
Contributor

$ make pull-infractl-from-dev-server
set -o pipefail; \
	curl --retry 3 --insecure --silent --show-error --fail --location https://localhost:8443/v1/cli/darwin/amd64/upgrade \
          | jq -r ".result.fileChunk" \
          | base64 -d \
          > bin/infractl
/usr/bin/base64: I/O error on input
curl: (23) Failure writing output to destination
make: *** [pull-infractl-from-dev-server] Error 141

Anyone know why this may be?

No, but it works for me™. i/o error could be because the curl or jq are failing. If you want to debug this, check if you can see any error from curl or jq.

@RTann
Copy link
Contributor Author

RTann commented Jun 18, 2024

Since I ran into issues locally but Tom didn't, I'd like to get at least one more reviewer to take a look and try testing this, if possible. Thank!

@RTann
Copy link
Contributor Author

RTann commented Jun 18, 2024

Also, when I tested it, I noticed the token differed from my prod token, so I think when/if this is merged, we'll have to inform everyone they may need to update their tokens locally

@tommartensen
Copy link
Contributor

Also, when I tested it, I noticed the token differed from my prod token, so I think when/if this is merged, we'll have to inform everyone they may need to update their tokens locally

The token on the /downloads page or infractl token is regenerated every time you open the page or run the command. There is no need to update every token or something.

@gavin-stackrox
Copy link
Contributor

make pull-infractl-from-dev-server

works for me also.

@RTann RTann merged commit ab9769c into master Jun 18, 2024
9 checks passed
@RTann RTann deleted the one-jwt-lib branch June 18, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants