[Restapi Yang] Fix issue with multiple certs (#12495)

*[Restapi Yang] Fix issue with multiple certs (#12495)
This commit is contained in:
Prince Sunny 2022-10-27 14:18:37 -07:00 committed by GitHub
parent 89f76829fc
commit 538e4c0a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -9,5 +9,8 @@
},
"RESTAPI_TABLE_WITH_VALID_CONFIG": {
"desc": "RESTAPI TABLE WITH VALID CONFIG."
},
"RESTAPI_TABLE_WITH_MULTIPLE_CERTS": {
"desc": "RESTAPI TABLE WITH MULTIPLE CERTS."
}
}

View File

@ -34,5 +34,17 @@
}
}
}
},
"RESTAPI_TABLE_WITH_MULTIPLE_CERTS": {
"sonic-restapi:sonic-restapi": {
"sonic-restapi:RESTAPI": {
"certs": {
"ca_crt": "/etc/sonic/credentials/ame_root.pem",
"server_crt": "/etc/sonic/credentials/restapiserver.crt",
"server_key": "/etc/sonic/credentials/restapiserver.key",
"client_crt_cname": "client.sonic.net,clientds.prod.net"
}
}
}
}
}

View File

@ -45,7 +45,7 @@ module sonic-restapi {
leaf client_crt_cname {
type string {
pattern '([a-zA-Z0-9_\-\.]+)';
pattern '([a-zA-Z0-9_\-\.]+,)*([a-zA-Z0-9_\-\.]+)';
}
description "Client cert name.";
}