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

"user_data" needs to be encoded in base64 without newlines #255

Open
ogrand opened this issue Sep 27, 2022 · 5 comments
Open

"user_data" needs to be encoded in base64 without newlines #255

ogrand opened this issue Sep 27, 2022 · 5 comments

Comments

@ogrand
Copy link

ogrand commented Sep 27, 2022

Hello,

Bosh Openstack cpi send a POST request for instance creation, with body content user_data base64 encoded row containing newlines \n every 60 characters:

body: {
  "server": {
    "flavorRef": "s3.small.1",
    "name": "vm-d35f15af-9840-44be-8d95-a2b1e1ad5358",
    "imageRef": "97727138-8334-4188-9b1e-4x558599d99b",
    "user_data": "eyJzZXJ2ZXIiOnsibmFtZSI6InZtLWQzNWYxNWFmLTk4NDAtNDRiZS04ZDk1\nLWEyYjFlMWFkNTM1OCJ9LCJuZXR3b3JrcyI6eyJ0Zi1uZXQtY29hYi1kZXBs\ncy1pb

Recent upgrade (openstack 22.3) is less permissive for base64 decoding and refuses newlines \n inside base64 encoded value.

To be compliant, it will be nice to replace encoding format in /var/vcap/packages/bosh_openstack_cpi/vendor/bundle/ruby/*/gems/fog-openstack-*/lib/fog/openstack/compute/models/server.rb ruby script:

Replace [ascii_userdata].pack('m') with [ascii_userdata].pack('m0') which disable newlines assertion.

Thanks.
Olivier

@rkoster
Copy link
Contributor

rkoster commented Oct 6, 2022

@ogrand could you create a PR for that?

@rkoster rkoster moved this from Inbox to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Oct 6, 2022
@ogrand
Copy link
Author

ogrand commented Oct 11, 2022

Hello Ruben, I create a PR in fog-openstack repository for this issue.
Hope It will be merged soon.

Regards. Olivier

@ogrand
Copy link
Author

ogrand commented Oct 19, 2022

Hello Ruben, do you know if fog-openstack repository included in bosh openstack cpi is always active.
Nothing new for my PR : fog/fog-openstack#528

@rkoster rkoster moved this from Waiting for Changes | Open for Contribution to Inbox in Foundational Infrastructure Working Group Feb 1, 2023
@ramonskie
Copy link
Contributor

it seems that the fog-openstack repo is dying as there is no activity since august

@rkoster rkoster moved this from Inbox to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Feb 9, 2023
@ramonskie
Copy link
Contributor

@ogrand the upstream pr has been merged
could you make a pr so that the the cpi is using the updated version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for Changes | Open for Contribution
Development

No branches or pull requests

3 participants