export-login is too big for env variable

Bug #1858023 reported by Anatoli Babenia
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

Trying to encrypt macaron for Travis SNAP_TOKEN fails, because data is too large.

Revision history for this message
Chris Patterson (cjp256) wrote :

Can you share the steps you took to generate/set SNAP_TOKEN?

Is the variable encoded as base64? (Does it have plaintext in it, e.g. "login.ubuntu.com", "macaroon"?)

The steps I take are available at https://docs.travis-ci.com/user/deployment/snaps/:

$ snapcraft export-login --snaps my-snap-name --channels edge -

...where the sending the data to stdout via `-` argument is crucial. Then I copy the output base64 encoded string and use it with:

$ travis env set SNAP_TOKEN "<token>"

If that doesn't help, mind sharing the number of characters in your token?

$ echo "<token>" | wc -c

Chris Patterson (cjp256)
Changed in snapcraft:
assignee: nobody → Chris Patterson (cjp256)
Revision history for this message
Anatoli Babenia (abitrolly) wrote :

I use `travis encrypt` to paste encrypted var into `.travis.yml` to avoid implicit magic variables in CI scripts.

https://github.com/yakshaveinc/linux/blob/c3ec48685cc0d6d22a4a85d1c5ffbc2e00e61048/.travis.yml#L13

Revision history for this message
Chris Patterson (cjp256) wrote :

So I tried `travis encrypt`, and probably got the same error as you:

`data too large - consider using travis encrypt-file or travis env set`

Unfortunately this looks like a limitation of Travis and how you're using it. I do understand your position and your preference, but I don't know we can offer a better solution other than to follow Travis' guidance and use one of the two options above... judging by the results of my searches, you are not alone in hoping for a more ideal solution :-/

Revision history for this message
Anatoli Babenia (abitrolly) wrote :

It may help to understand what is the structure of the information in the macaroon and what attributes to its size. Maybe it is possible to store permissions as a bit array?

Chris Patterson (cjp256)
Changed in snapcraft:
assignee: Chris Patterson (cjp256) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.