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

Return object in converter if is SecretBytes #135

Merged
merged 1 commit into from
Feb 27, 2020

Conversation

timja
Copy link
Member

@timja timja commented Feb 22, 2020

Partially fixes jenkinsci/configuration-as-code-plugin#1170

The other part is a null check in JCasC

Before this change, if one credential was a FileCredentialsImpl then no credentials could be exported (see the linked issue above), after this change and a null check in JCasC I can export all credentials including FileCredentialsImpl

@timja
Copy link
Member Author

timja commented Feb 22, 2020

Test in the JCasC PR using incremental version: jenkinsci/configuration-as-code-plugin#1282

@jetersen
Copy link
Member

@timja how does it handle my attempt to fix keystore and credentials in #129

@timja
Copy link
Member Author

timja commented Feb 22, 2020

@timja how does it handle my attempt to fix keystore and credentials in #129

exports fine, I tried every type of credential that came from installing plain-credentials

      - file:
          fileName: "pom.xml"
          id: "secret-file"
          scope: GLOBAL
          secretBytes: "{xzU2q+630GkH6w47s+V4GVB6hnJLt3VLz/PkgV89vlDEKUIuawSkiTtyPB7xariU9O2ja7F9ek2CmyFO7YvWd3ChMWaYM6ADGcPUCJ8DC2PVFBLgJypb8m5sRpUmo1njwVGNn6SukTgvklYhDtGRsaLQbggYteibuKZYcuawSebxXcXxP0V07XwCodHp1n/U0338WcOfI3YJKdX375BArU9QahDZ/gKFX8eWPEYKG7ITsqQU6chVK6fZlUqe6L7ib/srsOANQW2Wr7UXiDBE3AqWVs/BtbuFNuqXhEIPqXnGgrB63q2wykZjtU1F1YSXZFsDGCApCciWnPhdayddSoW3uzgdx3DcSUnssVAedRDH7wcGkW7JUkumdtg+mKAxBAVVU8CO7P9L3Abcf/nclQQXtqrMYFbrXnNKMoxg3UD1X7LzwMqrB9tBgyVpoRKboNCLdbMGmf0y0TiVySmBkgA0F6ia+hs03IzsbDDk4EIjlsnoXIgV0GJ+fuh0XfaPIX3/yCtZOuq+rKy2pZ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XoomD43uOeJxsP3WU46AvtKoBi5ziW7EVwfoh/IZqI20E+jKECBihoCHSjL}"
      - certificate:
          id: "590cc9a5-10c3-4680-9f97-afa77c6d4c36"
          keyStoreSource:
            uploaded:
              uploadedKeystore: "****"
          password: "{AQAAABAAAAAQI0D0qAWL6imcWL8SL4BY1nLyBKpllSh11GkurZ+Y738=}"
          scope: GLOBAL

@jetersen
Copy link
Member

Hmmm at the same time should we try and fix that the exported things are returned as **** instead of the encrypted value?

@timja
Copy link
Member Author

timja commented Feb 22, 2020

Hmmm at the same time should we try and fix that the exported things are returned as **** instead of the encrypted value?

separate improvement 😉 **** is much better than ALL creds being skipped

Copy link
Member

@jvz jvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Can you add any tests for this?

@timja
Copy link
Member Author

timja commented Feb 24, 2020

Seems reasonable. Can you add any tests for this?

There's a test here:
jenkinsci/configuration-as-code-plugin#1282

I can port it over if you want? There's a circular dependency though, the test won't pass until JCasC is fixed, which means this would need the incrementals version of JCasc to be here and JCasc needs the incrementals...
(I'm looping around, but TLDR it's circular...)

@jvz
Copy link
Member

jvz commented Feb 24, 2020

That test looks fine, no need to port it here.

@timja
Copy link
Member Author

timja commented Feb 25, 2020

That test looks fine, no need to port it here.

The build is green on the jcasc side if you want to 🚢 now, (Must've keyboard mashed in between running the test locally and committing 🤕 jenkinsci/configuration-as-code-plugin@c6f4a24)

@timja
Copy link
Member Author

timja commented Feb 26, 2020

a rebuild of this hit 1 test failure on a web client test (note it passed on the previous build):

java.net.SocketTimeoutException: Read timed out

@timja timja closed this Feb 26, 2020
@timja timja reopened this Feb 26, 2020
@oleg-nenashev oleg-nenashev self-requested a review February 26, 2020 09:39
@jetersen
Copy link
Member

Would be nice with a release 🙏

@jvz jvz merged commit 9bdfefa into jenkinsci:master Feb 27, 2020
@timja timja deleted the fix-class-cast-in-jcasc branch February 27, 2020 20:49
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.

Possible NPE when DataBound Object attribute is not Describable
4 participants