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

eyaml edit should produce evenly folded blocks. #281

Closed
pillarsdotnet opened this issue May 8, 2019 · 0 comments
Closed

eyaml edit should produce evenly folded blocks. #281

pillarsdotnet opened this issue May 8, 2019 · 0 comments

Comments

@pillarsdotnet
Copy link

pillarsdotnet commented May 8, 2019

From eyaml edit testfile.eyaml, I typed:

File Edit Options Buffers Tools Help
# | This is eyaml edit mode. This text (lines starting with # | at the top of
# | the file) will be removed when you save and exit.
# |  - To edit encrypted values, change the content of the DEC(<num>)::PKCS7[]!
# |    block.
# |    WARNING: DO NOT change the number in the parentheses.
# |  - To add a new encrypted value copy and paste a new block from the
# |    appropriate example below. Note that:
# |     * the text to encrypt goes in the square brackets
# |     * ensure you include the exclamation mark when you copy and paste
# |     * you must not include a number when adding a new block
# |    e.g. DEC::PKCS7[]!
---

test: >
  DEC::PKCS7[Lorem ipsum dolor sit amet, mea facer gubergren hendrerit te, id populo interpretaris sit. Quando torquatos ei nec. Eam ad lorem graeco, id perfecto democritum mnesarchum qui. Vis dico tibique forensibus an, duo odio tritani ut, latine voluptatibus sit at. \
Nam et rebum consequat, ad prompta mentitum pro. Facete fabellas urbanitas ea vel, sit modo autem perpetua ea.]!

When I view the resultant testfile.eyaml, I see:

---

test: >
  ENC[PKCS7,MIIC3QYJKoZIhvcNAQcDoIICzjCCAsoCAQAxggEhMIIBHQIBADAFMAACAQEw
  DQYJKoZIhvcNAQEBBQAEggEAclzQl/ynW0I1xcS2xQXUS12ly8u6w/7554SF
  T4fu01n62jcW7rDmplLWbWKguSLGMfHfL9GgehsuF+34VLnpjnR8oAufCG/E
  DjHClMSOIHTe7vzR5/8SXW0SFFFo1B6GIGtRXUlfaEUECkCmuK3nKzyrrGkN
  ipM7wWFzQdITZb306qWwZWTfwhVV2lPxwIRrStHvtA8DNL7BCFzLsaR7crfX
  lCcCaHprC0u9vlDQMkwU/17/V+wRcE5nZaKyUpfAj+Kim5t/adgnLlVYzT4r
  mwZ5rTTppmAlyfDCufRyQvYVTESbJVI/myDPmwBxzIwI9chuEghDjTzj9LhM
  aempfjCCAZ4GCSqGSIb3DQEHATAdBglghkgBZQMEASoEEIMGvW31uD9fDwSx
  0Ms4V/WAggFwM5ye93fo5j4k5v94u3B7NOMaPg0wJsN9woua93YDU0oxv0QW
  XRRPHafS5mGF3pOdKEXbgYae80yVhBzk/lO3XX6E8LBwgkCsTrIr3xk2fVTg
  CXW9h/VmPYV+7DRCtbn0FXR1uw0vnj+wr8zSujrCW8pRb7Nl4Iqq6M519EgT
  HsFeH0Z0PYmexfrwEPmlA7uBTgu98O8s6SIw5XJ1isbwueNwBnH5aWQ0pIuI
  TNfmPIXAp6lArbXNvysXav9TV8z9XJ+VC7EuTaMCD7Fk+i18m7iQmOWLbGzm
  qVDHkGIGeQf6zQtwrGPCQ7qoD0SvIfjSMgGPlpyKsx8VzyoDwBs32ow1xl1o
  fuQeMTuZ20Imp/XUoCWCHZ1FW4jf1PCPdOlRF5uAYUkEB+XaYv0FM73/bjb9
  0Mq3BomOohpVJE46ebAF4vffgJe8KxVfgOaTEzPPCqvhrRYnSsQPTMWcd3tm
  /0+BmreinQxQDodPRXJzt/M=]

Notice that the first line is exactly ten characters longer than the rest, probably because the line-wrapping code doesn't account for the initial ENC[PKCS7, prefix. I would prefer that lines be wrapped consistently, like this:

---

test: >
  ENC[PKCS7,MIIC3QYJKoZIhvcNAQcDoIICzjCCAsoCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKo
  ZIhvcNAQEBBQAEggEAclzQl/ynW0I1xcS2xQXUS12ly8u6w/7554SFT4fu01n62jcW7rDmplLWbW
  KguSLGMfHfL9GgehsuF+34VLnpjnR8oAufCG/EDjHClMSOIHTe7vzR5/8SXW0SFFFo1B6GIGtRXU
  lfaEUECkCmuK3nKzyrrGkNipM7wWFzQdITZb306qWwZWTfwhVV2lPxwIRrStHvtA8DNL7BCFzLsa
  R7crfXlCcCaHprC0u9vlDQMkwU/17/V+wRcE5nZaKyUpfAj+Kim5t/adgnLlVYzT4rmwZ5rTTppm
  AlyfDCufRyQvYVTESbJVI/myDPmwBxzIwI9chuEghDjTzj9LhMaempfjCCAZ4GCSqGSIb3DQEHAT
  AdBglghkgBZQMEASoEEIMGvW31uD9fDwSx0Ms4V/WAggFwM5ye93fo5j4k5v94u3B7NOMaPg0wJs
  N9woua93YDU0oxv0QWXRRPHafS5mGF3pOdKEXbgYae80yVhBzk/lO3XX6E8LBwgkCsTrIr3xk2fV
  TgCXW9h/VmPYV+7DRCtbn0FXR1uw0vnj+wr8zSujrCW8pRb7Nl4Iqq6M519EgTHsFeH0Z0PYmexf
  rwEPmlA7uBTgu98O8s6SIw5XJ1isbwueNwBnH5aWQ0pIuITNfmPIXAp6lArbXNvysXav9TV8z9XJ
  +VC7EuTaMCD7Fk+i18m7iQmOWLbGzmqVDHkGIGeQf6zQtwrGPCQ7qoD0SvIfjSMgGPlpyKsx8Vzy
  oDwBs32ow1xl1ofuQeMTuZ20Imp/XUoCWCHZ1FW4jf1PCPdOlRF5uAYUkEB+XaYv0FM73/bjb90M
  q3BomOohpVJE46ebAF4vffgJe8KxVfgOaTEzPPCqvhrRYnSsQPTMWcd3tm/0+BmreinQxQDodPRX
  Jzt/M=]

I can hand-edit the encrypted text to produce evenly-wrapped lines, but subsequent changes via eyaml edit will restore the hanging outdent.

kenyon added a commit to kenyon/hiera-eyaml that referenced this issue Nov 22, 2020
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

No branches or pull requests

1 participant