reflex-google-auth 0.0.9a9__tar.gz → 0.0.9a11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reflex_google_auth-0.0.9a11/.github/workflows/pre-commit.yaml +20 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/.github/workflows/publish.yml +1 -3
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/.gitignore +2 -1
- reflex_google_auth-0.0.9a11/.pre-commit-config.yaml +21 -0
- {reflex_google_auth-0.0.9a9/custom_components/reflex_google_auth.egg-info → reflex_google_auth-0.0.9a11}/PKG-INFO +3 -3
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth/decorator.py +0 -1
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth/google_auth.py +6 -7
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth/state.py +3 -5
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11/custom_components/reflex_google_auth.egg-info}/PKG-INFO +3 -3
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth.egg-info/SOURCES.txt +2 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth.egg-info/requires.txt +1 -1
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/.gitignore +1 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/google_auth_demo/google_auth_demo.py +0 -1
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/pyproject.toml +16 -2
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/README.md +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth/__init__.py +2 -2
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth.egg-info/dependency_links.txt +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/custom_components/reflex_google_auth.egg-info/top_level.txt +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/assets/favicon.ico +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/google_auth_demo/__init__.py +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/requirements.txt +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/rxconfig.py +0 -0
- {reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/setup.cfg +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
name: pre-commit
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: ["main"]
|
6
|
+
push:
|
7
|
+
branches: ["main", "masenf/deploy"]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
pre-commit:
|
11
|
+
timeout-minutes: 30
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
- uses: actions/setup-python@v2
|
16
|
+
with:
|
17
|
+
python-version: "3.12"
|
18
|
+
- run: |
|
19
|
+
pip install pre-commit pyright . -r${{ vars.APP_DIRECTORY }}/requirements.txt
|
20
|
+
pre-commit run --all-files
|
@@ -21,8 +21,6 @@ jobs:
|
|
21
21
|
python-version: "3.12"
|
22
22
|
- name: Install package
|
23
23
|
run: pip install .
|
24
|
-
- name: Install latest reflex
|
25
|
-
run: pip install 'git+https://github.com/reflex-dev/reflex@masenf/custom-component-publish-dynamic-version'
|
26
24
|
- name: Publish to PyPI
|
27
25
|
if: ${{ env.HAS_PYPI_TOKEN == 'true' }}
|
28
26
|
run: reflex component publish -t ${{ secrets.PYPI_TOKEN }} --no-share --no-validate-project-info
|
@@ -41,7 +39,7 @@ jobs:
|
|
41
39
|
- name: Set tagged version for deploy
|
42
40
|
run: sed -E 's/^${{ vars.COMPONENT_NAME }}([ >=].*)?$/${{ vars.COMPONENT_NAME }}==${{ github.event.release.tag_name }}/' -i ${{ vars.APP_DIRECTORY }}/requirements.txt
|
43
41
|
- name: Allow pre-release version of reflex
|
44
|
-
run: sed -E 's/(reflex[ >=]
|
42
|
+
run: sed -E 's/(reflex[ >=][^a]*$)/\1a/' -i ${{ vars.APP_DIRECTORY }}/requirements.txt
|
45
43
|
- name: Wait for package to become available
|
46
44
|
uses: databutton/wait-for-pypi-action@main
|
47
45
|
with:
|
@@ -0,0 +1,21 @@
|
|
1
|
+
fail_fast: true
|
2
|
+
|
3
|
+
repos:
|
4
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
5
|
+
rev: v0.9.3
|
6
|
+
hooks:
|
7
|
+
- id: ruff-format
|
8
|
+
- id: ruff
|
9
|
+
args: ["--fix", "--exit-non-zero-on-fix"]
|
10
|
+
|
11
|
+
- repo: https://github.com/codespell-project/codespell
|
12
|
+
rev: v2.3.0
|
13
|
+
hooks:
|
14
|
+
- id: codespell
|
15
|
+
|
16
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
17
|
+
rev: v1.1.392
|
18
|
+
hooks:
|
19
|
+
- id: pyright
|
20
|
+
args: []
|
21
|
+
language: system
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: reflex-google-auth
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9a11
|
4
4
|
Summary: Sign in with Google
|
5
5
|
Author-email: Masen Furer <m_github@0x26.net>
|
6
6
|
License: Apache-2.0
|
7
7
|
Project-URL: homepage, https://github.com/masenf/reflex-google-auth
|
8
8
|
Keywords: reflex,reflex-custom-components
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
10
|
-
Requires-Python: >=3.
|
10
|
+
Requires-Python: >=3.10
|
11
11
|
Description-Content-Type: text/markdown
|
12
|
-
Requires-Dist: reflex>=0.
|
12
|
+
Requires-Dist: reflex>=0.7.0a2
|
13
13
|
Requires-Dist: google-auth[requests]
|
14
14
|
Provides-Extra: dev
|
15
15
|
Requires-Dist: build; extra == "dev"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
from typing import cast
|
2
|
+
|
2
3
|
import reflex as rx
|
3
|
-
from reflex.event import EventType
|
4
|
+
from reflex.event import EventType
|
4
5
|
|
5
6
|
from .state import GoogleAuthState
|
6
7
|
|
7
|
-
|
8
8
|
LIBRARY = "@react-oauth/google"
|
9
9
|
|
10
10
|
|
@@ -43,11 +43,10 @@ google_login = GoogleLogin.create
|
|
43
43
|
|
44
44
|
|
45
45
|
def handle_google_login(
|
46
|
-
on_success: EventType[
|
46
|
+
on_success: EventType[dict] = GoogleAuthState.on_success,
|
47
47
|
) -> rx.Var[rx.EventChain]:
|
48
48
|
on_success_event_chain = rx.Var.create(
|
49
|
-
|
50
|
-
rx.Component()._create_event_chain(
|
49
|
+
rx.EventChain.create(
|
51
50
|
value=on_success, # type: ignore
|
52
51
|
args_spec=_on_success_signature,
|
53
52
|
key="on_success",
|
@@ -63,8 +62,8 @@ const login = useGoogleLogin({
|
|
63
62
|
onSuccess: %s,
|
64
63
|
flow: 'auth-code',
|
65
64
|
});"""
|
66
|
-
% on_success_event_chain:
|
65
|
+
% on_success_event_chain: on_success_event_chain._get_all_var_data(),
|
67
66
|
},
|
68
67
|
imports={LIBRARY: "useGoogleLogin"},
|
69
|
-
)
|
68
|
+
),
|
70
69
|
)
|
@@ -4,13 +4,11 @@ import json
|
|
4
4
|
import os
|
5
5
|
import time
|
6
6
|
|
7
|
+
import reflex as rx
|
7
8
|
from google.auth.transport import requests
|
8
9
|
from google.oauth2.id_token import verify_oauth2_token
|
9
10
|
from httpx import AsyncClient
|
10
11
|
|
11
|
-
import reflex as rx
|
12
|
-
|
13
|
-
|
14
12
|
TOKEN_URI = "https://oauth2.googleapis.com/token"
|
15
13
|
CLIENT_ID = os.environ.get("GOOGLE_CLIENT_ID", "")
|
16
14
|
CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET", "")
|
@@ -72,7 +70,7 @@ class GoogleAuthState(rx.State):
|
|
72
70
|
)
|
73
71
|
except Exception as exc:
|
74
72
|
if self.id_token_json:
|
75
|
-
print(f"Error verifying token: {exc!r}")
|
73
|
+
print(f"Error verifying token: {exc!r}") # noqa: T201
|
76
74
|
self.id_token_json = ""
|
77
75
|
return {}
|
78
76
|
|
@@ -80,7 +78,7 @@ class GoogleAuthState(rx.State):
|
|
80
78
|
def logout(self):
|
81
79
|
self.id_token_json = ""
|
82
80
|
|
83
|
-
@rx.var
|
81
|
+
@rx.var(cache=False)
|
84
82
|
def token_is_valid(self) -> bool:
|
85
83
|
try:
|
86
84
|
return bool(
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: reflex-google-auth
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9a11
|
4
4
|
Summary: Sign in with Google
|
5
5
|
Author-email: Masen Furer <m_github@0x26.net>
|
6
6
|
License: Apache-2.0
|
7
7
|
Project-URL: homepage, https://github.com/masenf/reflex-google-auth
|
8
8
|
Keywords: reflex,reflex-custom-components
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
10
|
-
Requires-Python: >=3.
|
10
|
+
Requires-Python: >=3.10
|
11
11
|
Description-Content-Type: text/markdown
|
12
|
-
Requires-Dist: reflex>=0.
|
12
|
+
Requires-Dist: reflex>=0.7.0a2
|
13
13
|
Requires-Dist: google-auth[requests]
|
14
14
|
Provides-Extra: dev
|
15
15
|
Requires-Dist: build; extra == "dev"
|
@@ -11,12 +11,12 @@ name = "reflex-google-auth"
|
|
11
11
|
description = "Sign in with Google"
|
12
12
|
readme = "README.md"
|
13
13
|
license = { text = "Apache-2.0" }
|
14
|
-
requires-python = ">=3.
|
14
|
+
requires-python = ">=3.10"
|
15
15
|
authors = [{ name = "Masen Furer", email = "m_github@0x26.net" }]
|
16
16
|
keywords = ["reflex", "reflex-custom-components"]
|
17
17
|
|
18
18
|
dependencies = [
|
19
|
-
"reflex>=0.
|
19
|
+
"reflex>=0.7.0a2",
|
20
20
|
"google-auth[requests]",
|
21
21
|
]
|
22
22
|
|
@@ -34,4 +34,18 @@ dev = ["build", "twine"]
|
|
34
34
|
[tool.setuptools.packages.find]
|
35
35
|
where = ["custom_components"]
|
36
36
|
|
37
|
+
[tool.ruff]
|
38
|
+
target-version = "py310"
|
39
|
+
output-format = "concise"
|
40
|
+
lint.isort.split-on-trailing-comma = false
|
41
|
+
lint.select = ["B", "C4", "E", "ERA", "F", "FURB", "I", "N", "PERF", "PTH", "RUF", "SIM", "T", "TRY", "W"]
|
42
|
+
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF008", "RUF012", "TRY0"]
|
43
|
+
lint.pydocstyle.convention = "google"
|
44
|
+
include = ["custom_components/**/*.py", "*_demo/**/*.py"]
|
45
|
+
|
46
|
+
[tool.ruff.lint.per-file-ignores]
|
47
|
+
"__init__.py" = ["F401"]
|
48
|
+
"env.py" = ["ALL"]
|
49
|
+
"*/alembic/*" = ["ALL"]
|
50
|
+
|
37
51
|
[tool.setuptools_scm]
|
File without changes
|
File without changes
|
File without changes
|
{reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/assets/favicon.ico
RENAMED
File without changes
|
File without changes
|
{reflex_google_auth-0.0.9a9 → reflex_google_auth-0.0.9a11}/google_auth_demo/requirements.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|