Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dockers/docker-sonic-gnmi/gnmi-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ if [ -n "$CERTS" ]; then
if [ ! -z $CA_CRT ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi

TELEMETRY_ARGS+=" --config_table_name GNMI_CLIENT_CERT"
elif [ -n "$X509" ]; then
SERVER_CRT=$(echo $X509 | jq -r '.server_crt')
SERVER_KEY=$(echo $X509 | jq -r '.server_key')
Expand Down Expand Up @@ -69,6 +67,12 @@ if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then
TELEMETRY_ARGS+=" --allow_no_client_auth"
fi

USER_AUTH=$(echo $GNMI | jq -r '.user_auth')
if [ ! -z $USER_AUTH ] then
TELEMETRY_ARGS+=" --user_auth $USER_AUTH"
Comment thread
liuh-80 marked this conversation as resolved.
Outdated
TELEMETRY_ARGS+=" --config_table_name GNMI_CLIENT_CERT"
fi

LOG_LEVEL=$(echo $GNMI | jq -r '.log_level')
if [[ $LOG_LEVEL =~ ^[0-9]+$ ]]; then
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
Expand Down
11 changes: 8 additions & 3 deletions dockers/docker-sonic-telemetry/telemetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ if [ -n "$CERTS" ]; then
if [ ! -z $CA_CRT ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi

# Reuse GNMI_CLIENT_CERT for telemetry service
TELEMETRY_ARGS+=" --config_table_name GNMI_CLIENT_CERT"
elif [ -n "$X509" ]; then
SERVER_CRT=$(echo $X509 | jq -r '.server_crt')
SERVER_KEY=$(echo $X509 | jq -r '.server_key')
Expand Down Expand Up @@ -70,6 +67,14 @@ if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then
TELEMETRY_ARGS+=" --allow_no_client_auth"
fi

USER_AUTH=$(echo $GNMI | jq -r '.user_auth')
if [ ! -z $USER_AUTH ] then
TELEMETRY_ARGS+=" --user_auth $USER_AUTH"
Comment thread
liuh-80 marked this conversation as resolved.
Outdated

# Reuse GNMI_CLIENT_CERT for telemetry service
TELEMETRY_ARGS+=" --config_table_name GNMI_CLIENT_CERT"
fi

LOG_LEVEL=$(echo $GNMI | jq -r '.log_level')
if [[ $LOG_LEVEL =~ ^[0-9]+$ ]]; then
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-gnmi.yang
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ module sonic-gnmi {
type uint32;
description "Certificate revocation list cache expire duration.";
}

leaf user_auth {
type string;
Comment thread
liuh-80 marked this conversation as resolved.
Outdated
description "GNMI service user authorization type.";
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-telemetry.yang
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ module sonic-telemetry {
type uint32;
description "Certificate revocation list cache expire duration.";
}

leaf user_auth {
type string;
description "Telemetry service user authorization type.";
}
}

}
Expand Down