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

Certificates import from a source have incorrect/incomplete data when initially created #1645

Closed
explody opened this issue Aug 30, 2018 · 1 comment

Comments

@explody
Copy link
Contributor

explody commented Aug 30, 2018

Version: HEAD

While importing certs from a source, we noticed that upon initial import, the certificates had incorrect/limited set of data. Specifically,

  • The Issuer is set to the ORGANIZATION_NAME instead of the name of the issuer
  • external_id, though included in cert data, is missing
  • authority_id, though detected and returned in the cert data coming from ourplugin.get_certificates was missing

We traced this back through the code and determined that the data for each certificate changes here:

data, errors = CertificateUploadInputSchema().load(certificate)

Looking at CertificateUploadInputSchema, it appears to strip the certificate information down to a different set of keys (owner, notifications, roles, etc.) and the certificate 'body'.

The result is that upon import, as mentioned above, the certs are basically wrong/incomplete

until

When the recurring sync job runs, the certs are all updated, and e.g. issuer is fixed, authority_id is filled in and so on. We presume this is either as the update is parsed or as the model parses its own cert body, but we haven't tracked that part yet.

The problem with this is that for N minutes (interval of sync cronjob), any initially imported certs are effectively wrong, which can wreak havoc with API integrations.

The expected behavior is that upon import, a certificate looks the same as it does after update, presuming the data has not changed

We might suggest that either:

  • CertificateUploadInputSchema should not strip out additional valid fields if they exist
  • Immediately upon import, the certificate model instance should update itself in the same way as when the CLI sync job is run (not sure if this is possible)
@castrapel
Copy link
Contributor

Hi, I was able to replicate the issues you've experienced. I've pushed this PR to resolve. Please take a look and feel free to submit another issue or PR if anything is missed or not functioning as intended: #1691

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

2 participants