diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cc94a8..11f9e57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.6, 3.7, 3.8, 3.9 ] + python-version: [ "3.7", "3.8", "3.9", "3.10" ] os: [ ubuntu-latest ] services: redis: @@ -84,7 +84,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '18' - name: Setup run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi @@ -101,4 +101,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: npx semantic-release \ No newline at end of file + run: npx semantic-release diff --git a/README.md b/README.md index f6ab1da..7930380 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ if __name__ == "main": test_option.host = "localhost" test_option.port = "6379" test_option.channel = "test" + test_option.ssl = False test_option.optional_update_callback = callback_function w = new_watcher(test_option) diff --git a/casbin_redis_watcher/options.py b/casbin_redis_watcher/options.py index 306b76a..12307b1 100644 --- a/casbin_redis_watcher/options.py +++ b/casbin_redis_watcher/options.py @@ -19,6 +19,7 @@ class WatcherOptions: password = None host = "localhost" port = "6379" + ssl = False sub_client = None pub_client = None channel = None diff --git a/casbin_redis_watcher/watcher.py b/casbin_redis_watcher/watcher.py index 1a2ea14..869e6b2 100644 --- a/casbin_redis_watcher/watcher.py +++ b/casbin_redis_watcher/watcher.py @@ -146,7 +146,7 @@ def unmarshal_binary(data: bytes): def new_watcher(option: WatcherOptions): option.init_config() w = RedisWatcher() - rds = Redis(host=option.host, port=option.port, password=option.password) + rds = Redis(host=option.host, port=option.port, password=option.password, ssl=option.ssl) if rds.ping() is False: raise Exception("Redis server is not available.") w.sub_client = rds.client().pubsub() @@ -161,7 +161,7 @@ def new_watcher(option: WatcherOptions): def new_publish_watcher(option: WatcherOptions): option.init_config() w = RedisWatcher() - rds = Redis(host=option.host, port=option.port, password=option.password) + rds = Redis(host=option.host, port=option.port, password=option.password, ssl=option.ssl) if rds.ping() is False: raise Exception("Redis server is not available.") w.pub_client = rds.client() diff --git a/requirements.txt b/requirements.txt index 03a829d..b087ee0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -casbin==1.16.8 -redis==4.3.4 +casbin==1.18.0 +redis==4.5.2