-
Notifications
You must be signed in to change notification settings - Fork 394
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
Cert: Fix role certificate parameter #886
Conversation
b7cc8f0
to
d283c81
Compare
Codecov Report
@@ Coverage Diff @@
## develop #886 +/- ##
===========================================
- Coverage 82.93% 80.95% -1.99%
===========================================
Files 59 59
Lines 2748 2772 +24
===========================================
- Hits 2279 2244 -35
- Misses 469 528 +59
|
d283c81
to
50a541e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions:
- Have we decided in which version
certificate
will stop accepting files altogether? - Can we report that version in the warning?
- Are we tracking that in GitHub anywhere? (we could create an issue for removing it, assign it to a
v2.0.0
milestone for example) - I don't see tests updated, are we missing tests for this method currently?
50a541e
to
7819ce6
Compare
Let's do v2.0.0
I did add documentation in the API, which will propagate into the docs. Should we also add the version support will be removed in the warning message?
Created #914!
Just added tests 😄, forgot about doing that when I initially created this PR. |
imo, yes, it's helpful to see in output, we could also add a link to #914 maybe?
Thanks! I updated the title and pinned the issue to make it more visible (maybe we can come up with a different way of surfacing upcoming breaking changes but should be ok for now). |
80f6311
to
0980b3a
Compare
The `create_ca_certificate_role` currently accepts a `certificate` parameter that can either be a PEM-formatted certificate or a path to a PEM-fromatted certificate file. The parameter is differentiated by trying to open a file with what's passed to `certificate`. For some systems, the lengh of a certificate is long enough that it will cause a OSError because of the path length. The conditional was updated to actually inspect what is passed to contents. To avoid these issues moving forward, `certificate` will only accept a certificate string. Paths should be passed to the new `certificate_file` parameter. For now, passing a certificate file to `certificate` will generate a warning. Updated tests to use a RSA 4096 key as the certificate file's length would cause the OSError regression solved by this fix. Tests additionally test the certificate and certificate_file parameters. Signed-off-by: Colin McAllister <colinmca242@gmail.com>
0980b3a
to
ac82b14
Compare
* Cert: Fix role certificate parameter The `create_ca_certificate_role` currently accepts a `certificate` parameter that can either be a PEM-formatted certificate or a path to a PEM-fromatted certificate file. The parameter is differentiated by trying to open a file with what's passed to `certificate`. For some systems, the lengh of a certificate is long enough that it will cause a OSError because of the path length. The conditional was updated to actually inspect what is passed to contents. To avoid these issues moving forward, `certificate` will only accept a certificate string. Paths should be passed to the new `certificate_file` parameter. For now, passing a certificate file to `certificate` will generate a warning. Updated tests to use a RSA 4096 key as the certificate file's length would cause the OSError regression solved by this fix. Tests additionally test the certificate and certificate_file parameters. Signed-off-by: Colin McAllister <colinmca242@gmail.com> * Update hvac/api/auth_methods/cert.py Signed-off-by: Colin McAllister <colinmca242@gmail.com> Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
* Cert: Fix role certificate parameter The `create_ca_certificate_role` currently accepts a `certificate` parameter that can either be a PEM-formatted certificate or a path to a PEM-fromatted certificate file. The parameter is differentiated by trying to open a file with what's passed to `certificate`. For some systems, the lengh of a certificate is long enough that it will cause a OSError because of the path length. The conditional was updated to actually inspect what is passed to contents. To avoid these issues moving forward, `certificate` will only accept a certificate string. Paths should be passed to the new `certificate_file` parameter. For now, passing a certificate file to `certificate` will generate a warning. Updated tests to use a RSA 4096 key as the certificate file's length would cause the OSError regression solved by this fix. Tests additionally test the certificate and certificate_file parameters. Signed-off-by: Colin McAllister <colinmca242@gmail.com> * Update hvac/api/auth_methods/cert.py Signed-off-by: Colin McAllister <colinmca242@gmail.com> Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
* Cert: Fix role certificate parameter The `create_ca_certificate_role` currently accepts a `certificate` parameter that can either be a PEM-formatted certificate or a path to a PEM-fromatted certificate file. The parameter is differentiated by trying to open a file with what's passed to `certificate`. For some systems, the lengh of a certificate is long enough that it will cause a OSError because of the path length. The conditional was updated to actually inspect what is passed to contents. To avoid these issues moving forward, `certificate` will only accept a certificate string. Paths should be passed to the new `certificate_file` parameter. For now, passing a certificate file to `certificate` will generate a warning. Updated tests to use a RSA 4096 key as the certificate file's length would cause the OSError regression solved by this fix. Tests additionally test the certificate and certificate_file parameters. Signed-off-by: Colin McAllister <colinmca242@gmail.com> * Update hvac/api/auth_methods/cert.py Signed-off-by: Colin McAllister <colinmca242@gmail.com> Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
The
create_ca_certificate_role
currently accepts acertificate
parameter that can either be a PEM-formatted certificate or a path to a PEM-fromatted certificate file. The parameter is differentiated by trying to open a file with what's passed tocertificate
. For some systems, the lengh of a certificate is long enough that it will cause a OSError because of the path length.The conditional was updated to actually inspect what is passed to contents. To avoid these issues moving forward,
certificate
will only accept a certificate string. Paths should be passed to the newcertificate_file
parameter. For now, passing a certificate file tocertificate
will generate a warning.Signed-off-by: Colin McAllister colinmca242@gmail.com
Closes #841