This repository was archived by the owner on Feb 15, 2022. It is now read-only.
[CDN-1176] Add fix to delete SNI certificate with domain name#31
Open
merryldmello wants to merge 1 commit into
Open
[CDN-1176] Add fix to delete SNI certificate with domain name#31merryldmello wants to merge 1 commit into
merryldmello wants to merge 1 commit into
Conversation
satroutr
reviewed
Jun 28, 2018
satroutr
left a comment
There was a problem hiding this comment.
Commit message is not pep8 compliance
satroutr
reviewed
Jun 28, 2018
| ) | ||
|
|
||
| if found is False: | ||
| if (cert_obj.cert_details["Akamai"] |
There was a problem hiding this comment.
Please add a comment what we are doing here. example(check if there is no pending changes in the enrolment
satroutr
reviewed
Jun 28, 2018
satroutr
reviewed
Jun 28, 2018
|
|
||
| certificate_controller = \ | ||
| self._driver.manager.ssl_certificate_controller | ||
|
|
There was a problem hiding this comment.
existing implementation looks good. is it possible to use the existing implementation?
The endpoint to delete domain from SNI certificate was not supported for sni, this fix adds the support. poppy/distributed_task/taskflow/task/delete_ssl_certificate_tasks.py Removed flavor_id as cert_obj_json will contain all cert information. poppy/provider/akamai/certificates.py If domain is not found on certificate, we need to check pending change in progress and skip it if found; moved changes to appropriate part of the code. poppy/transport/pecan/controllers/v1/ssl_certificates.py Deletion of domain was hardcoded to san, and now has been accommodated for any type of cert value by accepting the request body instead. tests/unit/distributed_task/taskflow/test_flows.py Changed variables respective to changes in code. tests/unit/provider/akamai/test_certificates.py Deleted a duplicate test. Added cert details to pending changes, as it contains change url.
LukeRepko
reviewed
Jul 2, 2018
| @@ -72,14 +72,17 @@ def post(self): | |||
| helpers.abort_with_message) | |||
| ) | |||
| def delete(self, domain_name): | |||
Collaborator
There was a problem hiding this comment.
Should be:
def delete(self, domain_name):
certificate_controller = \
self._driver.manager.ssl_certificate_controller
try:
# NOTE(TheSriram): we can also enforce project_id constraints
cert_obj = certificate_controller.get_certs_info_by_domain(
domain_name=domain_name,
project_id=None)
except ValueError:
pecan.abort(404, detail='certificate '
'could not be found '
'for domain : %s' %
domain_name)
raise
try:
certificate_controller.delete_ssl_certificate(
cert_obj.project_id, domain_name, cert_obj.cert_type
)
except ValueError as e:
pecan.abort(400, detail='Delete ssl certificate failed. '
'Reason: %s' % str(e))
return pecan.Response(None, 202)
@pecan.expose('json')
@decorators.validate(
domain_name=rule.Rule(
helpers.is_valid_domain_by_name(),
helpers.abort_with_message)
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CDN-1176
poppy/distributed_task/taskflow/task/delete_ssl_certificate_tasks.py
Removed flavor_id as cert_obj_json will contain all cert information.
poppy/provider/akamai/certificates.py b/poppy/provider/akamai/certificates.py
If domain is not found on certificate, we need to check pending change in progress and skip it if found; moved changes to appropriate part of the code.
poppy/transport/pecan/controllers/v1/ssl_certificates.py
Deletion of domain was hardcoded to san, and now has been accommodated for any type of cert value by accepting the request body instead.
tests/unit/distributed_task/taskflow/test_flows.py b/tests/unit/distributed_task/taskflow/test_flows.py
Changed variables respective to changes in code.
tests/unit/provider/akamai/test_certificates.py b/tests/unit/provider/akamai/test_certificates.py
Deleted a duplicate test.
Added cert details to pending changes, as it contains change url.