Skip to content

Commit

Permalink
feat: Add ssl option (#10)
Browse files Browse the repository at this point in the history
* feat: add ssl option

* feat: set ssl according to option

* feat: latest version

* docs: add ssl option

* fix: remove python 3.6 add python 3.10

* fix: fix CI script

* fix: fix CI Node version

---------

Co-authored-by: hsluoyz <[email protected]>
  • Loading branch information
gui2dev and hsluoyz authored Mar 22, 2023
1 parent b5b7238 commit b025d29
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -101,4 +101,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: npx semantic-release
run: npx semantic-release
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions casbin_redis_watcher/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class WatcherOptions:
password = None
host = "localhost"
port = "6379"
ssl = False
sub_client = None
pub_client = None
channel = None
Expand Down
4 changes: 2 additions & 2 deletions casbin_redis_watcher/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
casbin==1.16.8
redis==4.3.4
casbin==1.18.0
redis==4.5.2

0 comments on commit b025d29

Please sign in to comment.