Conversation
Add MacsecPolicy, MkaPolicy, Keychain and KeychainKey SDK classes backing the AOS-CX security configuration exposed by REST v10.16 (system/ macsec_policies, system/mka_policies, system/keychains and the nested key collection). Register the new classes in the API dispatch table and add v10.16 REST API support, which these resources require. Include offline unit tests. Signed-off-by: ed6869 <ed6869@mail.com>
This was referenced Jun 28, 2026
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.
Description
Adds pyaoscx SDK classes for the AOS-CX security resources required by the upcoming
arubanetworks.aoscxMACsec / MKA / keychain Ansible modules:MacsecPolicy(system/macsec_policies, indexed byname) — scalar attributes plus nestedbypassandcipher_suitesdicts.MkaPolicy(system/mka_policies, indexed byname) — scalars,keychainURI reference, and write-onlycak/ckn.Keychain(system/keychains, indexed byname).KeychainKey(nestedsystem/keychains/{name}/keys, indexed bykey_id) — child object ofKeychain.The four classes are registered in the
api.pydispatch table (module_names).REST API v10.16
These resources require REST API v10.16 (HTTP 400 below v10.10), so this PR also adds
pyaoscx/rest/v10_16/API support.Note
v10.16 support is also introduced by #73 (Port Access family). Whichever PR merges first, the other will be rebased to drop the duplicate
pyaoscx/rest/v10_16/files.Tests
tests/test_macsec.py— 16 offline unit tests (mocked session) covering paths, create payloads (includingname/key_idand nested dicts), idempotent update, update changes, delete andget_allfor all four classes.flake8+black --line-length 79clean.Validation
Validated live against an AOS-CX 6300 (FL.10.17.1001, REST v10.16): full create / read-back / update / delete lifecycle for all four classes, plus end-to-end exercise from the corresponding Ansible modules.
Notes
CONTRIBUTING, PRs should targetdevelopment, but that branch does not exist in this repository, so this PR targetsmaster.Fixes #74
Companion collection PR: aruba/aoscx-ansible-collection#143