Fix certificate assignment for non-default services#381
Open
jmcte wants to merge 1 commit intoN4S4:masterfrom
Open
Fix certificate assignment for non-default services#381jmcte wants to merge 1 commit intoN4S4:masterfrom
jmcte wants to merge 1 commit intoN4S4:masterfrom
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🗃️ Summary
Fix certificate assignment for DSM services that are discovered from the live certificate service list instead of the static service map.
🚀 Motivation & Problem Statement
Certificate.set_certificate_for_service()currently indexes a hardcoded service dictionary byservice_name. That works forDSM Desktop Service, but it fails for non-default DSM services such as reverse proxy certificate assignments because those service entries are returned by DSM at runtime and are not present in the static map.🔧 Implementation Details
synology_api/core_certificate.pysoset_certificate_for_service()captures the matching service object while scanninglist_cert().DSM Desktop Service.ValueErrorwhen the requested service is not present in the certificate service list.tests/test_core_certificate.pyfor default service behavior, discovered non-default service behavior, missing service errors, and already-assigned no-op behavior.🏁 Checklist
tests/).pytest).black,flake8, etc.).pre-commitand addressed any linting issues.pre-commitis not installed in the project venv used for local verification, so I could not run it locally. The GitHubpre-commitworkflow is running on this PR.📝 Related Issue
Closes #341.
🔨 Additional Notes
Live DSM verification was performed against reverse proxy certificate assignment:
The marked safe integration tests currently fail for me even on clean
upstream/masteragainst my NAS, so I am treating those as existing environment/API-version drift rather than part of this change.😎 Test & Build Status
Attempted but unavailable locally:
👀 Screenshots / Media
Not applicable.
Thank you for contributing!