Repository: HDFGroup/hsds

Issue:
typo,  should be   password_file
https://github.com/HDFGroup/hsds/blob/268bd655768fe6755ea2bc1a9a7bcb5145defbfb/hsds/app.py#L32

Discussion:

Patch:
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index 0e72a00..583dff9 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -18,3 +18,6 @@ jobs:
         uses: actions/checkout@v3
       - name: 'Dependency Review'
         uses: actions/dependency-review-action@v1
+        with:
+          # verify=False is never used in HSDS
+          allow-ghsas: ["GHSA-9wx4-h78v-vm56"]
diff --git a/hsds/app.py b/hsds/app.py
index 9ab269f..a1dd651 100644
--- a/hsds/app.py
+++ b/hsds/app.py
@@ -29,18 +29,18 @@ _HELP_EPILOG = """Examples:
 
 - with POSIX-based storage and config settings and password file:
 
-  hsds --root_dir ~/hsdata --password-file ./admin/config/passwd.txt \
+  hsds --root_dir ~/hsdata --password_file ./admin/config/passwd.txt \
   --config_dir ./admin/config
 
 - with minio data storage:
 
   hsds --s3-gateway http://localhost:6007 --access-key-id demo:demo
-      --secret-access-key DEMO_PASS --password-file ./admin/config/passwd.txt
+      --secret-access-key DEMO_PASS --password_file ./admin/config/passwd.txt
 
 - with AWS S3 storage and a bucket in the us-west-2 region:
 
   hsds --s3-gateway http://s3.us-west-2.amazonaws.com --access-key-id ${AWS_ACCESS_KEY_ID} \
-      --secret-access-key ${AWS_SECRET_ACCESS_KEY} --password-file ./admin/config/passwd.txt
+      --secret-access-key ${AWS_SECRET_ACCESS_KEY} --password_file ./admin/config/passwd.txt
 
 """
 
diff --git a/hsds/util/globparser.py b/hsds/util/globparser.py
index 4605e71..6fe57e9 100644
--- a/hsds/util/globparser.py
+++ b/hsds/util/globparser.py
@@ -116,7 +116,7 @@ def globmatch(item, pattern):
     asterix_index += 1
     glob_right = pattern[asterix_index:]
     index = _wildcharmatch(item, glob_left)
-    if glob_left and index == 0:
+    if glob_left and index < len(glob_left):
         return False
     item = item[index:]
     if not glob_right:
diff --git a/hsds/util/s3Client.py b/hsds/util/s3Client.py
index 3503e20..106e21a 100644
--- a/hsds/util/s3Client.py
+++ b/hsds/util/s3Client.py
@@ -314,7 +314,7 @@ class S3Client:
                     msg = f"s3_key: {bucket}/{key} not found "
                     log.info(msg)
                     raise HTTPNotFound()
-                elif response_code == "NoSuchBucket":
+                elif response_code in ("NoSuchBucket", "PermanentRedirect"):
                     msg = f"s3_bucket: {bucket} not found"
                     log.info(msg)
                     raise HTTPNotFound()
@@ -374,7 +374,7 @@ class S3Client:
                 }
             except ClientError as ce:
                 response_code = ce.response["Error"]["Code"]
-                if response_code == "NoSuchBucket":
+                if response_code in ("NoSuchBucket", "PermanentRedirect"):
                     msg = f"s3_bucket: {bucket} not found"
                     log.warn(msg)
                     raise HTTPNotFound()
diff --git a/pyproject.toml b/pyproject.toml
index 69b690c..2254ca5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -49,6 +49,7 @@ dependencies = [
     "pyjwt",
     "pytz",
     "pyyaml",
+    "requests <= 2.31.0",
     "requests-unixsocket",
     "simplejson",
     "s3fs",
diff --git a/requirements.txt b/requirements.txt
index 5ca6af7..88049a8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,6 +13,7 @@ psutil
 pyjwt
 pytz
 pyyaml
+requests<=2.31.0
 requests-unixsocket
 simplejson
-s3fs
\ No newline at end of file
+s3fs


Test patch:
diff --git a/tests/unit/glob_parser_test.py b/tests/unit/glob_parser_test.py
index 80ee61e..727b1b7 100755
--- a/tests/unit/glob_parser_test.py
+++ b/tests/unit/glob_parser_test.py
@@ -24,6 +24,7 @@ class GlobParserTest(unittest.TestCase):
     def testPatterns(self):
 
         self.assertTrue(globmatch("ab123", "ab*"))
+        self.assertFalse(globmatch("ab123", "abc*"))
         self.assertTrue(globmatch("abc123", "*123"))
         self.assertTrue(globmatch("abcxyz", "abc*xyz"))
         self.assertTrue(globmatch("abc123xyz", "abc*xyz"))