File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ SQLD_NODE="${SQLD_NODE:-primary}"
77SQLD_DB_PATH=" ${SQLD_DB_PATH:- iku.db} "
88SQLD_HTTP_LISTEN_ADDR=" ${SQLD_HTTP_LISTEN_ADDR:- " 0.0.0.0:8080" } "
99
10- SQLD_HTTP_AUTH=" ${SQLD_HTTP_AUTH:- " always" } "
11-
1210if [ " $1 " = ' /bin/sqld' ]; then
1311 # We are running the server.
1412 declare -a server_args=()
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use tonic::metadata::MetadataMap;
66
77pub fn parse_http_basic_auth_arg ( arg : & str ) -> Result < Option < String > > {
88 if arg == "always" {
9- return Ok ( None ) ;
9+ return Ok ( Some ( "always" . to_string ( ) ) ) ;
1010 }
1111
1212 let Some ( ( scheme, param) ) = arg. split_once ( ':' ) else {
@@ -71,6 +71,8 @@ mod tests {
7171
7272 use crate :: auth:: { parse_http_auth_header, AuthError } ;
7373
74+ use super :: parse_http_basic_auth_arg;
75+
7476 #[ test]
7577 fn parse_http_auth_header_returns_auth_header_param_when_valid ( ) {
7678 assert_eq ! (
@@ -111,4 +113,10 @@ mod tests {
111113 AuthError :: HttpAuthHeaderUnsupportedScheme
112114 )
113115 }
116+
117+ #[ test]
118+ fn parse_http_auth_arg_always ( ) {
119+ let out = parse_http_basic_auth_arg ( "always" ) . unwrap ( ) ;
120+ assert_eq ! ( out, Some ( "always" . to_string( ) ) ) ;
121+ }
114122}
You can’t perform that action at this time.
0 commit comments