-
Notifications
You must be signed in to change notification settings - Fork 1k
[Project-scoped API tokens] are too big for travis pypi deploy #6338
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
Comments
Interesting... Worked for me using a account-global token. Haven't tried it with a project-scoped one. Is it longer? |
Mine was 195 characters |
It looks like Travis CI limitation is 501 byte. You're probably doing something wrong. Are you using $ dd if=/dev/urandom | LC_CTYPE=X tr -cd "[:alpha:][:digit:]" | head -c 256 | travis encrypt -r xxx/xxx --api-endpoint 'https://api.travis-ci.com/'
Please add the following to your .travis.yml file:
secure: "VW5SHPo68Mz40zMlDJRwqgh5bsTzItdhDSAsK+Xozb64Z/4GOUJ++iWLFB7eqMA/pS9+FkuwUcBNBxB/DYCJ2jJRb3UxnF3JgBvsgNsi0FQAgvhzz3vKSfWZoTn9c1/jK8Ng1KmqJDkcwjC77EawUo8dbUz19Iw5eyES3803j/Q68luzO1IipZhQLrJRnCV0YhZTnCpoluOoePdv0GG/BU15PVMJIqn3B34fJk6mXrAfrhrjgsp2wt0XAj4e7cQEk80fZsM595mS6qgtLrNP4ZdIA6eSoYuaZ1oeK10wxuOz79wLkEv5LifdZaU5rEmn9grT+35B6Cekkk5rjotPQXgTKGByXWCQywvhYxpQU7zonZr3AeVgVMdFcFnNtxrDbN+dsyR6SwwyEUIBazxZyxN/ITTCHJLAad/1C9MPIY/SzZzNRYkwSbAjh+IxEcANm6Pitvf8UeP6bmII/61ovgPI0t3nxbtA2cnCaYeP6fbfqOBwdYc1ISBqR5w4pR85HBtZM7MI7qq+nME1i3UUG+j0MyixUIB10vOI1XnumxaQ2AqTOIoi3vm/4gDEay+S2YnWq7jMD4xCW6rQ+8b7lZWQhpRoig9rv6yb16oUOZsScCCwOkxbA4k33H2v+PbvBrFlvb8jKALYnaWqFlCU9WB4rIUGCjJ7NZcZ7I0h37U="
Pro Tip: You can add it automatically by running with --add. $ dd if=/dev/urandom | LC_CTYPE=X tr -cd "[:alpha:][:digit:]" | head -c 502 | travis encrypt -r xxx/xxx --api-endpoint 'https://api.travis-ci.com/'
Outdated CLI version, run `gem install travis`.
data too large - consider using travis encrypt-file or travis env set
$ dd if=/dev/urandom | LC_CTYPE=X tr -cd "[:alpha:][:digit:]" | head -c 501 | travis encrypt -r xxx/xxx --api-endpoint 'https://api.travis-ci.com/'
Outdated CLI version, run `gem install travis`.
Please add the following to your .travis.yml file:
secure: "t7P2dCpHE7x7nknQvUxGVSC5WFjTzDu2vnd59I26cG7jszeyEeE4J9sJctgwkHq5GGyiE24tZqsrfW4Nf6n3oS/S/KQRJb8zS3fSwnSlXDyrIDeH319/5i2qxolTZsXFKVkhNi9pzaAHCmFV2Id/VqjgFO9DegpuChObckJ8LGGhrAb7snRSwCtBAuAV0yE2sUsyhqwkKiglY4GSV/W+lswR+hxdkDlaqgA/uODSNWIMaFeuAUTwtLR1owpDyai5J9xTEk06PvYIWvOHvnu5Mcdck8rcNWyjUJiPGQEw2cFklH0JDuDSeAHULc/K3c0LMvXdN5HtPJMphuAH/7PKy4BOgIGIa40C9Hu4q1Tx9Y0jImOVUgywvWThFUBobxTsWLo0IFjRTe6wRfKR2/nzprnUiwQ1ouasynpF8/PDsuPczIm8kAUv+S9NM+7mLR+BFEg98f37wcxwYAM+nDqU8WkJjGxczoQybF0Xx1KW4QrFH7CrJfiQ4Urd7b6EQF58L5fD24T2SgIIA84r0bF0DWLUKvHMJifW8vRDPlThKXev3xwGti02EpUcnYATrWVOd5oJs1PBfirjp0zFRIE8GAjnBoVTQlAnG8JFYlvzJp+DdlB4NXY16VcIcyJ6kcWRUFDBKttJlmY7NnWxNuGQZ60kg11YjRGfhEju17KW6oQ="
Pro Tip: You can add it automatically by running with --add. |
Workaround:It's not very well advertised but you can actually use |
Not sure whether we should consider this a documentation issue to address in travis-ci/docs-travis-ci-com#2452 & #6211 or a thing we can/should address on the Warehouse side. @woodruffw ? |
I'm using the travis snap if that helps anyone repeat? |
@graingert I'm not sure what's packaged into that snap and don't have it myself :( |
Hmm -- this probably falls under documentation, since we're already using the more compact ("V2") text serialization format for Macaroons. We could probably squish it further by using a binary format for caveats instead of JSON, but it'll still be a relatively long token. I agree with @webknjaz that there might be something additional going on here: 195 characters is long, but well below the actual Travis CI limit. |
No nothing weird, just the : |
@graingert Could I ask you to contact Travis CI support or their bug tracker and ask what they find, in case there's something else going on here? |
I suspect this is a unique problem to me. I'm using |
@graingert I believe it's not safe to use that. |
@graingert heads up: the issue seems to be a duplicate of #6287 |
This problem isn't unique to you. I've encountered it in a couple of projects myself. It seems some projects in Travis have a 128-byte key while others a 512-byte key (and maybe others with another length). The only recommended solution seems to be "don't use encrypted values in config". |
I don't see how this is a duplicate of that issue. That issue discussed the escaping of values ( This issue is about how Travis config refuses to encrypt the value for certain projects, which was reported upstream in travis-ci/travis.rb#221, but the recommendation is to avoid using that feature. |
Although #6355 is a duplicate of this issue, the conversation is continuing there. |
Well, it seemed to have the same roots back when I suggested that it's a duplicate ;) |
To be honest the pypi token looks like a joke made in order to test who would choke trying to use it. Its unresonable length breaks even the newer v3 travis deploy api, as documentd at https://docs.travis-ci.com/user/deployment-v2/providers/pypi/ Any attempt to encrypt that huge token would give you a |
Describe the bug
Expected behavior
travis encrypt "pypi:token-here"
it prints a nice encrypted token
To Reproduce
$ travis encrypt "pypi:token-here"
data too large - consider using travis encrypt-file or travis env set
The text was updated successfully, but these errors were encountered: