Skip to content

Improve GNMI_CLIENT_CERT table to support multiple roles. #21849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 28, 2025
8 changes: 6 additions & 2 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1414,10 +1414,14 @@
},
"GNMI_CLIENT_CERT": {
"testcert1": {
"role": "RW"
"role": [
"RW"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  	 [](http://example.com/codeflow?start=0&length=3)

Please fix mixing tab and space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

]
},
"testcert2": {
"role": "RO"
"role": [
"RO"
Copy link
Collaborator

@qiluo-msft qiluo-msft Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  	 [](http://example.com/codeflow?start=0&length=3)

The same. #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

]
}
},
"TUNNEL": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE": {
"desc": "CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE failure.",
"eStrKey": "Mandatory"
"eStrKey": "MinElements"
},
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@
"GNMI_CLIENT_CERT_LIST": [
{
"cert_cname": "testcert1",
"role": "RW"
"role": [
"RW"
]
},
{
"cert_cname": "testcert2",
"role": "RO"
"role": [
"RO"
]
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-gnmi.yang
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ module sonic-gnmi {
"client cert common name";
}

leaf role {
leaf-list role {
type string;
mandatory true;
min-elements 1;
description
"role of client cert common name";
}
Expand Down
Loading