Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7699205
initial python sdk code
May 19, 2022
b83a0da
fix github isort action
May 19, 2022
902e9fe
fix github isort action wip2
guyp-descope May 19, 2022
043ffbb
fix github isort action wip3
guyp-descope May 19, 2022
78e5a94
fix github unittest action wip4
guyp-descope May 19, 2022
03941d0
fix github unittest action wip5
guyp-descope May 19, 2022
9afaf77
fix github unittest action wip6
guyp-descope May 19, 2022
757c24d
fix github unittest action wip7
guyp-descope May 19, 2022
2b9f5b3
add github python code coverage action wip8
guyp-descope May 19, 2022
252ca25
add github python code coverage action wip9
guyp-descope May 19, 2022
30b1c74
add github python code coverage action wip10
guyp-descope May 19, 2022
3d07f9a
add github python code coverage action wip11
guyp-descope May 19, 2022
1a50cee
fixes some bugs and added functionality of fetching public key
guyp-descope May 19, 2022
18efbc8
Add unittest for better coverage
guyp-descope May 22, 2022
c9811bc
remove the pyproject.toml file (not in used)
guyp-descope May 22, 2022
bdf01c4
add gitleaks Action
guyp-descope May 22, 2022
3f45417
add gitleaks to workflow, some PR fixes
guyp-descope May 22, 2022
5946440
add github checkout action
guyp-descope May 22, 2022
2d22181
fix github action
guyp-descope May 22, 2022
0ce81e1
fix github action
guyp-descope May 22, 2022
d65b343
fix PR issues
guyp-descope May 22, 2022
31ebac5
add support for multiple public keys, add mutex for thread safe
guyp-descope May 22, 2022
be52ea7
replace email regex with python email validator package
guyp-descope May 23, 2022
d377caf
add new package to requirements file
guyp-descope May 23, 2022
6914192
change badge namedlogo
guyp-descope May 23, 2022
2ae8bf5
change coverage badge
guyp-descope May 24, 2022
8089b04
change coverage badge
guyp-descope May 24, 2022
11f02a4
revert to the latest coverage badge
guyp-descope May 24, 2022
6da0ad6
1. Add support for refresh token 2. Fix decorator (to support pre-pos…
guyp-descope May 24, 2022
d6d3409
fix UT
guyp-descope May 24, 2022
cf65450
add license check for pre-commit and part of the ci workflow
guyp-descope May 24, 2022
08e56e7
fix license checks
guyp-descope May 24, 2022
344022f
fix license checks 2
guyp-descope May 24, 2022
1e8a68d
seperate the coverage steps to run on a different workflow that run o…
guyp-descope May 25, 2022
63a161e
1. fixed few bugs 2. added flask decorator functions example 3. imp…
guyp-descope May 26, 2022
b2b1474
fix pr comments
guyp-descope May 26, 2022
4ae2458
fix some more pr comments
guyp-descope May 26, 2022
e32b425
1. change the api so the claims (jwt payload) will be available for t…
guyp-descope May 30, 2022
cfb24c8
set alg as const
guyp-descope May 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
per-file-ignores = __init__.py:F401
ignore = E501
78 changes: 78 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --show-source --statistics
- name: Lint with black
uses: psf/black@stable
with:
options: "--check --verbose"

- name: Run isort
uses: isort/isort-action@master
with:
configuration: --profile black

- name: Unittest
run: |
python -m pytest tests/*
- name: Build coverage file
run: |
python -m pytest --junitxml=/tmp/pytest.xml --cov-report=term-missing:skip-covered --cov=descope tests/ | tee /tmp/pytest-coverage.txt
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: /tmp/pytest-coverage.txt
junitxml-path: /tmp/pytest.xml

- name: Check the output coverage
run: |
echo "Coverage Percantage - ${{ steps.coverageComment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}"
echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}"
echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}"
echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}"
- name: Create the Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.CI_READ_COMMON }}
gistID: 277ec23e4e70728824362a0d24fbd0f9
filename: pytest-coverage-comment.json
label: Coverage Report
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
exclude: 'docs/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# python-sdk
# Python sdk
Python library used to integrate with Descope
3 changes: 3 additions & 0 deletions descope/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from descope.auth import AuthClient
from descope.common import COOKIE_NAME, DeliveryMethod, User
from descope.exceptions import AuthException
Loading