Skip to content

Commit 7cd1f52

Browse files
authored
Improve GNMI_CLIENT_CERT table to support multiple roles. (#21849)
Improve GNMI_CLIENT_CERT table to support multiple roles. Why I did it GNMI need support multiple roles. HLD: sonic-net/SONiC#1967 Work item tracking Microsoft ADO (number only):31561802 How I did it Change GNMI_CLIENT_CERT table yang model. How to verify it Pass all test case. This PR depends on following PRs: sonic-net/sonic-gnmi#366 sonic-net/sonic-mgmt#17866
1 parent 8d6fe0c commit 7cd1f52

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,10 +1414,14 @@
14141414
},
14151415
"GNMI_CLIENT_CERT": {
14161416
"testcert1": {
1417-
"role": "RW"
1417+
"role": [
1418+
"RW"
1419+
]
14181420
},
14191421
"testcert2": {
1420-
"role": "RO"
1422+
"role": [
1423+
"RO"
1424+
]
14211425
}
14221426
},
14231427
"TUNNEL": {

src/sonic-yang-models/tests/yang_model_tests/tests/gnmi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE": {
2222
"desc": "CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE failure.",
23-
"eStrKey": "Mandatory"
23+
"eStrKey": "MinElements"
2424
},
2525
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_VALID_CONFIG": {
2626
"desc": "TABLE WITH VALID CONFIG."

src/sonic-yang-models/tests/yang_model_tests/tests_config/gnmi.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,15 @@
108108
"GNMI_CLIENT_CERT_LIST": [
109109
{
110110
"cert_cname": "testcert1",
111-
"role": "RW"
111+
"role": [
112+
"RW"
113+
]
112114
},
113115
{
114116
"cert_cname": "testcert2",
115-
"role": "RO"
117+
"role": [
118+
"RO"
119+
]
116120
}
117121
]
118122
}

src/sonic-yang-models/yang-models/sonic-gnmi.yang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ module sonic-gnmi {
107107
"client cert common name";
108108
}
109109

110-
leaf role {
110+
leaf-list role {
111111
type string;
112-
mandatory true;
112+
min-elements 1;
113113
description
114114
"role of client cert common name";
115115
}

0 commit comments

Comments
 (0)