concourse: fly login does not allow enough characters to paste in bearer token
Summary
When doing a fly login while unable to use the login_port feature (i.e., while ssh’d into another machine), the other option is to paste the token in by using the “Copy to Clipboard” button in the login prompt. However, when you try to copy and paste the token, the token gets trimmed due to a character limit. (You can’t even hit “Enter”).
Steps to reproduce
fly -t <some-concourse> login- Navigate to the login url provided, but change the port number in the url so it doesn’t log you in automatically
- Press the “Copy to Clipboard” button in your browser
- Attempt to paste the bearer token into the awaiting
fly-cliprompt - Attempt to hit enter
Expected results
I get logged in.
Actual results
I cannot hit enter and the bearer token is trimmed
Triaging info
- Concourse version: 6.2.0
- Browser (if applicable): Chrome (but should be irrelevant because the clipboard actually still has the whole token)
- Did this used to work? I assume so 😐
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 25 (19 by maintainers)
Commits related to this issue
- fly: behaviour: allow pasting long tokens into login concourse/concourse#5717 On OSX, there's some magic constant of 1024 characters, which is the length of some TTY buffer. Not sure of the specific... — committed to concourse/concourse by deleted user 4 years ago
- fly: behaviour: allow pasting long tokens into login concourse/concourse#5717 On OSX, there's some magic constant of 1024 characters, which is the length of some TTY buffer. Not sure of the specific... — committed to concourse/concourse by deleted user 4 years ago
- fly: behaviour: allow pasting long tokens into login concourse/concourse#5717 On OSX, there's some magic constant of 1024 characters, which is the length of some TTY buffer. Not sure of the specific... — committed to concourse/concourse by deleted user 4 years ago
- fly: behaviour: allow pasting long tokens into login concourse/concourse#5717 On OSX, there's some magic constant of 1024 characters, which is the length of some TTY buffer. Not sure of the specific... — committed to concourse/concourse by deleted user 4 years ago
@aoldershaw I was tempted to use something like
github.com/atotto/clipboardto haveflygrab the token off your clipboard, but then I realized if we’re able to directly access the token on your clipboard fromfly(orpbpaste) you probably wouldn’t be in this situation in the first place.This tends to happen when you’re using
flyremotely, i.e. over SSH - so it’d be a different machine without access to your clipboard. So whatever approach we take probably has to work in that context.This issue is so annoying haha.
@bmhkb4 Yeah - now that we just use the tokens issued directly by Dex, they can be much larger. For example, if you log in with GitHub the token will contain a list of all of your teams (x2 - one for team name, one for team slug) and organizations. This data is used by the API endpoints to check against the requested team’s configured list of authorized users/teams/orgs/etc.
Previously this limit could only be hit if you were a member of many Concourse teams, since team names were encoded in the token, which is probably less common.
I found the place where we talked about this before – and @cirocosta found a similarly sinister constant: https://github.com/concourse/concourse/issues/4339#issuecomment-527161365
@vito I’m using iTerm on macOS Catalina. The token I’m copying is ~2000 characters long, looks like it’s getting capped at 1024 characters.
@jamieklassen I tried using iTerm and terminal on macOS, both had the same issue. I had trouble installing aminal, so I haven’t tested it on something else yet.
Worth noting that when I just run
readand try to paste my token, it stops it at the same 1024 character limit, so definitely seems to be the buffer limit like you mentioned. Although this isn’t explicitly a concourse issue, maybe it’s something that needs to change about the instructions presented forfly logingiven it seems to affect both macOS and Linux out of the box?