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

Handling nomad maximum token name limit #4009

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

burdandrei
Copy link
Contributor

Nomad maximum token name is limited to 64 characters:
https://github.com/hashicorp/nomad/blob/d9276e22b3b74674996fb548cdb6bc4c70d5b0e4/nomad/structs/structs.go#L115

We ran in issue when generating tokens from nomad that runs a job that should do nomad dispatch.
Display name that nomad passes is token-job-uuid-task_name with adding all the prependers and timestamp it exceeds 64 characters.

PR just trims the token name if it's longer than 64 chars.

Hope it's OK from naming point of view @ncorrare

@jefferai
Copy link
Member

I'm going to push the Nomad team to increase this limit but in the meantime this seems fine so long as the job name doesn't end up being so long tokens become non-unique.

@dadgar
Copy link
Contributor

dadgar commented Feb 20, 2018

This will be mitigated in 0.8 as the limit has been increased to 256: hashicorp/nomad#3888

chrishoffman pushed a commit that referenced this pull request Feb 21, 2018
* oss/master: (178 commits)
  Cut version 0.9.4
  Remove netbsd/arm as it won't compile
  Bump files for new version
  Update plugins
  Update go-plugin
  changelog++
  Handling nomad maxTokenNameLength = 64 (#4009)
  Remove unneeded looping since Go 1.10 cover it already (#4010)
  Fix test statement with formatting in fatal call
  Fix PKI tests by generating on-demand
  Sanitize pem encoding to Go default of a newline at the end rather than break backwards compat
  Remove now-unneeded PKCS8 code and update certutil tests for Go 1.10
  Kick Travis
  Bump Travis to Go 1.10
  Fix bug with vault cli when reading an individual field containing a Printf formatting verb (#4005)
  Adding path roles test coverage for storing PKIX fields (#4003)
  Add test coverage for recently-added PKIX fields. (#4002)
  Fix missing CommonName in subject generation
  changelog++
  Handle missed error case in seal status output format (#4001)
  ...
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 this pull request may close these issues.

3 participants