Skip to content

Commit

Permalink
Merge branch 'main' into mgmt-keys-rebac
Browse files Browse the repository at this point in the history
  • Loading branch information
guyp-descope authored Nov 18, 2024
2 parents 7342628 + 423494d commit 9a813f0
Show file tree
Hide file tree
Showing 11 changed files with 428 additions and 386 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ jobs:
- "3.10"
- "3.9"
- "3.8"
- "3.7"
os:
- ubuntu-latest
- macos-latest
- windows-latest
exclude:
- os: macos-latest
py: "3.7"
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -50,7 +46,6 @@ jobs:
env:
COVERAGE_FILE: "coverage.${{ matrix.os }}.${{ matrix.py }}"
- name: Store coverage file
if: matrix.py != '3.7'
uses: actions/upload-artifact@v4
with:
name: coverage.${{ matrix.os }}.${{ matrix.py }}
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
Expand Down
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"isort.importStrategy": "fromEnvironment",
"black-formatter.importStrategy": "fromEnvironment",
"workbench.colorCustomizations": {
"activityBar.background": "#4D1C3B",
"titleBar.activeBackground": "#6B2752",
"titleBar.activeForeground": "#FDF8FB"
"activityBar.background": "#121D85",
"titleBar.activeBackground": "#1A28BA",
"titleBar.activeForeground": "#F9FAFE"
},
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ for a backend written in python. You can read more on the [Descope Website](http

## Requirements

The SDK supports Python 3.7 and above.
The SDK supports Python 3.8.1 and above.

## Installing the SDK

Expand Down Expand Up @@ -1451,7 +1451,7 @@ You can find various usage samples in the [samples folder](https://github.com/de

### Prerequisites

- Python 3.7 or higher
- Python 3.8.1 or higher
- [Poetry](https://python-poetry.org) installed

### Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion descope/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def _generate_auth_info(
def generate_jwt_response(
self,
response_body: dict,
refresh_cookie: str,
refresh_cookie: str | None,
audience: str | None | Iterable[str] = None,
) -> dict:
jwt_response = self._generate_auth_info(
Expand Down
7 changes: 7 additions & 0 deletions descope/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def __init__(
self,
stepup: bool = False,
mfa: bool = False,
revoke_other_sessions: Optional[None] = None,
custom_claims: Optional[dict] = None,
template_options: Optional[
dict
Expand All @@ -119,6 +120,8 @@ def __init__(
self.stepup = stepup
self.customClaims = custom_claims
self.mfa = mfa
if revoke_other_sessions is not None:
self.revokeOtherSessions = revoke_other_sessions
if template_options is not None:
self.templateOptions = template_options

Expand Down Expand Up @@ -149,11 +152,13 @@ def validate_refresh_token_provided(
class SignUpOptions:
def __init__(
self,
revoke_other_sessions: Optional[None] = None,
custom_claims: Optional[dict] = None,
template_options: Optional[
dict
] = None, # for providing messaging template options (templates that are being sent via email / text message)
):
self.revoke_other_sessions = revoke_other_sessions
self.customClaims = custom_claims
self.templateOptions = template_options

Expand All @@ -165,4 +170,6 @@ def signup_options_to_dict(signup_options: Optional[SignUpOptions] = None) -> di
res["customClaims"] = signup_options.customClaims
if signup_options.templateOptions is not None:
res["templateOptions"] = signup_options.templateOptions
if signup_options.revoke_other_sessions is not None:
res["revokeOtherSessions"] = signup_options.revoke_other_sessions
return res
398 changes: 211 additions & 187 deletions poetry.lock

Large diffs are not rendered by default.

53 changes: 24 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed"
]
packages = [
{ include = "descope" },
"Typing :: Typed",
]
packages = [{ include = "descope" }]

[tool.poetry.extras]
Flask = ["Flask"]
Expand All @@ -37,41 +34,41 @@ Flask = ["Flask"]


[tool.poetry.dependencies]
python = ">=3.7,<4.0"
python = ">=3.8.1,<4.0"
requests = ">=2.27.0"
pyjwt = {version = ">=2.4.0", extras = ["crypto"]}
email-validator = [
{version = ">=2,<=2.0.0.post2", python = ">=3.7,<3.8"},
{version = ">=2,<3", python = ">=3.8"}
]
pyjwt = { version = ">=2.4.0", extras = ["crypto"] }
email-validator = [{ version = ">=2,<3", python = ">=3.8" }]
liccheck = "^0.9.1"
Flask = {version = ">=2", python = ">=3.8"}
Flask = ">=2"

[tool.poetry.group.dev.dependencies]
mock = "5.1.0"
pre-commit = [
{version = "<3.0.0", python = ">=3.8,<3.9"},
{version = "3.6.0", python = ">3.9"}
{ version = "<3.0.0", python = "<3.9" },
{ version = "3.6.0", python = ">=3.9" },
]
flake8 = {version = "7.1.1", python = ">=3.8.1"}
flake8-pyproject = {version = "1.2.3", python = ">=3.8.1"}
flake8-bugbear = {version = "24.1.17", python = ">=3.8.1"}
flake8 = "7.1.1"
flake8-pyproject = "1.2.3"
flake8-bugbear = "24.8.19"
liccheck = "0.9.2"
isort = {version = "5.13.2", python = ">=3.8"}
pep8-naming = {version = "0.13.3", python = ">=3.8"}
tox = {version = "4.12.1", python = ">=3.8"}
isort = "5.13.2"
pep8-naming = "0.14.1"
tox = "4.23.0"

[tool.poetry.group.format.dependencies]
black = {version = "24.3.0", python = ">=3.8"}
black = [
{ version = "<24.10.0", python = "<3.9" },
{ version = "24.10.0", python = ">=3.9" },
]

[tool.poetry.group.types.dependencies]
mypy = {version = "1.11.2", python = ">=3.8"}
types-requests = {version = "2.32.0.20240914", python = ">=3.8"}
types-setuptools = {version = "75.1.0.20240917", python = ">=3.8"}
mypy = "1.11.2"
types-requests = "2.32.0.20240914"
types-setuptools = "75.1.0.20240917"

[tool.poetry.group.tests.dependencies]
pytest = {version = "8.0.0", python = ">=3.8"}
coverage = {version = "^7.3.1", python = ">=3.8", extras = ["toml"]}
pytest = "8.3.3"
coverage = { version = "^7.3.1", extras = ["toml"] }

[build-system]
requires = ["poetry-core>=1.1.0"]
Expand All @@ -80,9 +77,7 @@ build-backend = "poetry.core.masonry.api"
[tool.coverage.run]
relative_files = true
source = ["descope"]
omit = [
"descope/flask/*",
]
omit = ["descope/flask/*"]


[tool.coverage.report]
Expand Down
Loading

0 comments on commit 9a813f0

Please sign in to comment.