Skip to content

Add MACsec policy, MKA policy and keychain resource modules - #75

Open
ed6869 wants to merge 1 commit into
aruba:masterfrom
ed6869:feature/macsec
Open

ed6869 wants to merge 1 commit into
aruba:masterfrom
ed6869:feature/macsec

Conversation

@ed6869

@ed6869 ed6869 commented Jun 28, 2026

Copy link
Copy Markdown

Description

Adds pyaoscx SDK classes for the AOS-CX security resources required by the upcoming arubanetworks.aoscx MACsec / MKA / keychain Ansible modules:

  • MacsecPolicy (system/macsec_policies, indexed by name) — scalar attributes plus nested bypass and cipher_suites dicts.
  • MkaPolicy (system/mka_policies, indexed by name) — scalars, keychain URI reference, and write-only cak / ckn.
  • Keychain (system/keychains, indexed by name).
  • KeychainKey (nested system/keychains/{name}/keys, indexed by key_id) — child object of Keychain.

The four classes are registered in the api.py dispatch 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 (including name / key_id and nested dicts), idempotent update, update changes, delete and get_all for all four classes.
  • flake8 + black --line-length 79 clean.

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

  • Per CONTRIBUTING, PRs should target development, but that branch does not exist in this repository, so this PR targets master.

Fixes #74

Companion collection PR: aruba/aoscx-ansible-collection#143

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>
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

Successfully merging this pull request may close these issues.

Add MACsec policy, MKA policy and keychain resource modules

1 participant