strimzi / strimzi-kafka-oauth

OAuth2 support for Apache Kafka® to work with many OAuth2 authorization servers
Apache License 2.0
140 stars 89 forks source link

examples/docker/kafka-oauth-strimzi/kafka/oauth.sh:101:44: warning[SC2050]: This expression is constant. Did you forget the $ on a variable? #240

Open k-wall opened 2 months ago

k-wall commented 2 months ago

https://github.com/strimzi/strimzi-kafka-oauth/blob/229daee85b096804d16e2904c8c0f1add599cc99/examples/docker/kafka-oauth-strimzi/kafka/oauth.sh#L101

Snyk noticed this error, which does indeed look like a true positive.

Error: SHELLCHECK_WARNING (CWE-398):
examples/docker/kafka-oauth-strimzi/kafka/oauth.sh:101:44: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   99|   fi
#  100|   
#  101|-> if [ "$SCOPES" == "" ] && [ DEFAULT_SCOPES != "" ]; then
#  102|       [ "$QUIET" == "" ] && >&2 echo "SCOPES not set. Using default value: ${DEFAULT_SCOPES}"
#  103|       SCOPES="${DEFAULT_SCOPES}"
mstruk commented 2 months ago

Indeed, it looks like it should be $DEFAULT_SCOPES.