Add AAA Klish CLI transformer and YANG annotations#3
Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Open
Add AAA Klish CLI transformer and YANG annotations#3devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Conversation
- Add openconfig-aaa-annot.yang with transformer mappings for AAA authentication, authorization, and accounting containers - Add xfmr_aaa.go with key transformer (aaa_tbl_key_xfmr) and field transformers for method list to login string conversion - Add xfmr_aaa_test.go with unit tests for helper functions (round-trip conversion tests) Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add openconfig-aaa-sonic-ext.yang to augment OpenConfig AAA model with SONiC-specific failthrough, fallback, and debug leaves - Add field-name annotations for boolean fields in annotation file - Import augmentation module in annotation file Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
This was referenced Feb 20, 2026
Open
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.
Add AAA OpenConfig-to-SONiC transformer and YANG annotations
Summary
Adds the transformer layer for mapping OpenConfig AAA YANG model (
openconfig-aaa.yang) to SONiC's nativeAAAConfigDB table (sonic-system-aaa.yang). This is the sonic-mgmt-common half of the Klish AAA CLI feature (the sonic-mgmt-framework half with XML/actioner/template is in a separate PR).New files:
openconfig-aaa-sonic-ext.yang— YANG augmentation adding SONiC-specificfailthrough,fallback, anddebugboolean leaves to the OpenConfig AAA authentication config/state containers (these fields exist in SONiC'ssonic-system-aaa.yangbut not in standard OpenConfig AAA)openconfig-aaa-annot.yang— Deviation-based annotations mapping OpenConfig authentication/authorization/accounting containers toAAAtable with key and field transformers, plusfield-namemappings for the augmented boolean leavesxfmr_aaa.go— Key transformer (aaa_tbl_key_xfmr) that routes by URI path, plus 6 field transformers for converting between OpenConfig leaf-list and SONiC comma-separated login stringxfmr_aaa_test.go— Unit tests for the two helper conversion functions (aaaMethodListToLoginString,aaaLoginStringToMethodList) including round-trip testsUpdates since last revision
openconfig-aaa-sonic-ext.yang: Created a YANG augmentation module that addsfailthrough,fallback, anddebugleaves to OpenConfig AAA's authentication config and state containers. Without this, the REST paths used by the actioner for these fields would have no backing YANG definition.sonic-ext:field-namedeviations for the three augmented boolean leaves (config + state), mapping them directly to their SONiC DB field names.import openconfig-aaa-sonic-extto resolve the augmented leaf paths in deviation statements.Review & Testing Checklist for Human
Risk level: 🟡 YELLOW — New YANG augmentation pattern, uncompiled Go code, and two-repo dependency make this non-trivial to validate without a build.
openconfig-aaa-sonic-ext.yangaugments the OpenConfig AAA model to add SONiC-specific boolean fields. Verify that the YANG tooling correctly resolves the augmented leaf paths in the annotation file's deviations (e.g.,/oc-aaa:aaa/oc-aaa:authentication/oc-aaa:config/oc-aaa-sonic-ext:failthrough). There is only one other extension YANG in this repo (openconfig-mclag.yang) and it does not use augment in the same way, so this pattern may be untested.KeyXfmrYangToDb,FieldXfmrYangToDb,FieldXfmrDbtoYang,XfmrParams,NewPathInfo,XlateFuncBind) exist with correct signatures and that the code builds without errors.*-methodleaf has bothsonic-ext:field-name "login"ANDsonic-ext:field-transformer. Verify that the framework handles this correctly (typically field-transformer takes precedence, making field-name redundant or potentially conflicting)./oc-aaa:aaaitself. The actioner doesGET /restconf/data/openconfig-aaa:aaafor show commands. Verify that the framework can route this GET request without a top-level annotation, or add one if needed.DbToYang_*transformer hardcodes the AAA entry key lookup (e.g.,aaaEntry["authentication"]). Verify this matches how the framework invokes field transformers — if the framework expects the transformer to useinParams.keydynamically, this will break.Test Plan
aaa authentication login tacacs+ local,aaa authentication failthrough enable, etc.redis-cli HGETALL "AAA|authentication"show aaashould display all configured values including boolean fieldsNotes