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

jwt is invalid after #255 #281

Closed
dezren39 opened this issue Apr 11, 2024 · 8 comments · Fixed by #286
Closed

jwt is invalid after #255 #281

dezren39 opened this issue Apr 11, 2024 · 8 comments · Fixed by #286

Comments

@dezren39
Copy link
Contributor

Describe the bug
commits after #255 fail to connect correctly with charm serve
probably relates to specifically #253 but relates to #252 #254 too

i've been using commits since this just fine,
recently i got a fresh windows install,
so maybe my go.work or other deps in my old box allowed me not to see this issue,
i haven't tried on linux yet, but i had been using this code on both windows and linux for a while now.


with no charm environment variables set and only using commits from charmbracelet/charm:
when running using commit
47448ea
everything works

git clone https://github.com/charmbracelet/charm
git checkout 47448ea01c9b71ae6c7e9717e3daf5db2b8bf2a5
go build
./charm serve
$env:CHARM_HOST = "localhost"
rm -re -fo (./charm where)
./charm
# works with 47448ea01c9b71ae6c7e9717e3daf5db2b8bf2a5

image

with no charm environment variables set and only using commits from charmbracelet/charm:
when running using commit
a2f77b8
FAIL: jwt is invalid

git clone https://github.com/charmbracelet/charm
git checkout a2f77b85886d1306b49bfcd1b349181097b6d391
go build
./charm serve
$env:CHARM_HOST = "localhost"
rm -re -fo (./charm where)
./charm
# fails with a2f77b85886d1306b49bfcd1b349181097b6d391

image

  • OS [e.g. Ubuntu, macOS]
    • windows 11
  • Shell [e.g. zsh, fish]
    • powershell 5
  • Terminal Emulator [e.g. kitty, iterm]
    • windows terminal
  • Terminal Multiplexer [e.g. tmux]
    • none
@dezren39
Copy link
Contributor Author

seeing in this example it's hitting ::1, i've had mixed results with ipv6 to begin with but in my original testing where i hit this bug i was either using 127.0.0.1, my exact ipv4 ip, or my tailnet dns address which i think is ipv4.

@dezren39
Copy link
Contributor Author

dezren39 commented Apr 12, 2024

this is at least also true when using wsl ubuntu 22 for both client and server sides


OS [e.g. Ubuntu, macOS]
ubuntu 22.04 by way of wsl 2 by way of windows 11
Shell [e.g. zsh, fish]
pwsh 7
Terminal Emulator [e.g. kitty, iterm]
windows terminal
Terminal Multiplexer [e.g. tmux]
none


PS /mnt/c/Users/drewr/charm> cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

image

@barnc
Copy link

barnc commented May 22, 2024

Seeing the same problem on ubuntu 22 with a fresh install.

@dezren39
Copy link
Contributor Author

dezren39 commented Jun 9, 2024

@caarlos0 if you have time i'd like to help resolve this if i can. do you have any suggestions for what might be needed? this has been a blocker for me for a little bit and i have just now gotten back around to looking at it.

@dezren39
Copy link
Contributor Author

dezren39 commented Jun 9, 2024

maybe it's something else? i tried building from the latest release even and i'm not able to connect to localhost anymore idk what changed.

caarlos0 added a commit that referenced this issue Jun 10, 2024
refs #281

Signed-off-by: Carlos Alexandro Becker <[email protected]>
@caarlos0
Copy link
Member

hey, sorry for the delay, #286 should fix it!

@dezren39
Copy link
Contributor Author

you're a lifesaver! thank you so much!! testing now 🤓

@dezren39
Copy link
Contributor Author

it works!! thank you again!! my intuition is that the change made it try to use rsa key type instead of eddsa/ed25519? that was as far as i'd kinda figured out, but looking at the pr, i think i'd have been stuck a long time before figuring out how to fix without just fully reverting the whole thing.

thanks again 👍

caarlos0 added a commit that referenced this issue Jun 11, 2024
* fix: jwks validation using the wrong type

refs #281

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* chore: var name

---------

Signed-off-by: Carlos Alexandro Becker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants