From f2dcea095772b06eef9158a77e8c58e2374dc330 Mon Sep 17 00:00:00 2001 From: Szilveszter Farkas Date: Fri, 22 Jan 2021 23:42:22 +0100 Subject: [PATCH 1/2] Update path regex to allow underscores and colons A few extra characters that are totally valid in URLs were not part of the `AuthPolicy` class' path regular expression. This is also preparing for a 1.0 release, which drops Python 2.7 support. --- fleece/authpolicy.py | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fleece/authpolicy.py b/fleece/authpolicy.py index d2d9906..b30ab66 100644 --- a/fleece/authpolicy.py +++ b/fleece/authpolicy.py @@ -30,7 +30,7 @@ def __init__( # Policy version should always be '2012-10-17' self.version = "2012-10-17" # Used to validate resource paths for policy - self.path_regex = r"^[/.a-zA-Z0-9-\*]+$" + self.path_regex = r'^[/.a-zA-Z0-9-_\*\:]+$' # Lists of allowed/denied methods, objects with resource ARN and # nullable conditions statement self.allowMethods = [] diff --git a/pyproject.toml b/pyproject.toml index 8a7f306..dcf4432 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fleece" -version = "1.0.0-alpha.0" +version = "1.0.0" description = "Wrap the lamb...da" license = "Apache-2.0" readme = "README.md" @@ -88,6 +88,7 @@ bandit = "bandit -c .bandit.yml -r fleece/" black = "black fleece" black_ci = "black -check fleece" flake8 = "flake8 fleece/ tests/" +convert_readme = "pandoc --from=gfm --to=rst README.md --output=README.rst" generate_requirements = "poetry export -f requirements.txt -o requirements.txt" pre_safety = "task generate_requirements" safety = "safety check -r requirements.txt" From 1baf165c9e2a85c39fb9d96934b106dc4308ea9c Mon Sep 17 00:00:00 2001 From: Szilveszter Farkas Date: Sat, 23 Jan 2021 00:01:28 +0100 Subject: [PATCH 2/2] Remove non-existant test from bandit config The `B322` test doesn't seem to exist anymore, and bandit doesn't like that it's included in the list of skipped tests. --- .bandit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bandit.yml b/.bandit.yml index 4be731d..e2a1d19 100644 --- a/.bandit.yml +++ b/.bandit.yml @@ -1 +1 @@ -skips: ["B110", "B101", "B322", "B404", "B602", "B607"] \ No newline at end of file +skips: ["B110", "B101", "B404", "B602", "B607"] \ No newline at end of file