pypomes-iam 0.0.7__tar.gz → 0.0.9__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.
Potentially problematic release.
This version of pypomes-iam might be problematic. Click here for more details.
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/PKG-INFO +1 -1
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/pyproject.toml +1 -1
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/src/pypomes_iam/__init__.py +4 -4
- pypomes_iam-0.0.7/src/pypomes_iam/iam_jusbr.py → pypomes_iam-0.0.9/src/pypomes_iam/jusbr_pomes.py +23 -29
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/.gitignore +0 -0
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/LICENSE +0 -0
- {pypomes_iam-0.0.7 → pypomes_iam-0.0.9}/README.md +0 -0
- /pypomes_iam-0.0.7/src/pypomes_iam/iam_provider.py → /pypomes_iam-0.0.9/src/pypomes_iam/provider_pomes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_iam
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.9
|
|
4
4
|
Summary: A collection of Python pomes, penyeach (IAM modules)
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-IAM
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-IAM/issues
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
from .
|
|
1
|
+
from .jusbr_pomes import (
|
|
2
2
|
jusbr_setup, jusbr_get_token, jusbr_set_scope
|
|
3
3
|
)
|
|
4
|
-
from .
|
|
4
|
+
from .provider_pomes import (
|
|
5
5
|
provider_register, provider_get_token
|
|
6
6
|
)
|
|
7
7
|
|
|
8
8
|
__all__ = [
|
|
9
|
-
#
|
|
9
|
+
# jusbr_pomes
|
|
10
10
|
"jusbr_setup", "jusbr_get_token", "jusbr_set_scope",
|
|
11
|
-
#
|
|
11
|
+
# provider_pomes
|
|
12
12
|
"provider_register", "provider_get_token"
|
|
13
13
|
]
|
|
14
14
|
|
pypomes_iam-0.0.7/src/pypomes_iam/iam_jusbr.py → pypomes_iam-0.0.9/src/pypomes_iam/jusbr_pomes.py
RENAMED
|
@@ -13,26 +13,20 @@ from typing import Any, Final
|
|
|
13
13
|
|
|
14
14
|
JUSBR_CLIENT_ID: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_CLIENT_ID")
|
|
15
15
|
JUSBR_CLIENT_SECRET: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_CLIENT_SECRET")
|
|
16
|
-
|
|
16
|
+
JUSBR_CLIENT_TIMEOUT: Final[int] = env_get_int(key=f"{APP_PREFIX}_JUSBR_CLIENT_TIMEOUT")
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
JUSBR_ENDPOINT_CALLBACK: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_ENDPOINT_CALLBACK",
|
|
19
19
|
def_value="/iam/jusbr:callback")
|
|
20
|
-
|
|
21
|
-
def_value="/iam/jusbr:get-token")
|
|
22
|
-
JUSBR_LOGIN_ENDPOINT: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_LOGIN_ENDPOINT",
|
|
20
|
+
JUSBR_ENDPOINT_LOGIN: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_ENDPOINT_LOGIN",
|
|
23
21
|
def_value="/iam/jusbr:login")
|
|
24
|
-
|
|
22
|
+
JUSBR_ENDPOINT_LOGOUT: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_ENDPOINT_LOGOUT",
|
|
25
23
|
def_value="/iam/jusbr:logout")
|
|
24
|
+
JUSBR_ENDPOINT_TOKEN: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_ENDPOINT_TOKEN",
|
|
25
|
+
def_value="/iam/jusbr:get-token")
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def_value="https://sso.stg.cloud.pje.jus.br/auth/realms/pje/protocol/openid-connect/auth"
|
|
31
|
-
)
|
|
32
|
-
JUSBR_TOKEN_URL: Final[str] = env_get_str(
|
|
33
|
-
key=f"{APP_PREFIX}JUSBR_TOKEN_URL",
|
|
34
|
-
def_value="https://sso.stg.cloud.pje.jus.br/auth/realms/pje/protocol/openid-connect/token"
|
|
35
|
-
)
|
|
27
|
+
JUSBR_URL_AUTH_CALLBACK: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_URL_AUTH_CALLBACK")
|
|
28
|
+
JUSBR_URL_AUTH_LOGIN: Final[str] = env_get_str(key=f"{APP_PREFIX}JUSBR_URL_AUTH_LOGIN")
|
|
29
|
+
JUSBR_URL_AUTH_TOKEN: Final[str] = env_get_str(key=f"{APP_PREFIX}JUSBR_URL_AUTH_TOKEN")
|
|
36
30
|
|
|
37
31
|
# safe memory cache - structure:
|
|
38
32
|
# {
|
|
@@ -40,7 +34,7 @@ JUSBR_TOKEN_URL: Final[str] = env_get_str(
|
|
|
40
34
|
# "client-secret": <str>,
|
|
41
35
|
# "auth-url": <str>,
|
|
42
36
|
# "token-url": <str>,
|
|
43
|
-
# "
|
|
37
|
+
# "client-timeout": <int>,
|
|
44
38
|
# "users": [
|
|
45
39
|
# "<user-id>": {
|
|
46
40
|
# "cache-obj": <Cache>,
|
|
@@ -56,7 +50,7 @@ JUSBR_TOKEN_URL: Final[str] = env_get_str(
|
|
|
56
50
|
_jusbr_registry: dict[str, Any] = {
|
|
57
51
|
"client-id": None,
|
|
58
52
|
"client-secret": None,
|
|
59
|
-
"
|
|
53
|
+
"client-timeout": None,
|
|
60
54
|
"auth-url": None,
|
|
61
55
|
"callback-url": None,
|
|
62
56
|
"token-url": None,
|
|
@@ -70,14 +64,14 @@ _logger: Logger | None = None
|
|
|
70
64
|
def jusbr_setup(flask_app: Flask,
|
|
71
65
|
client_id: str = JUSBR_CLIENT_ID,
|
|
72
66
|
client_secret: str = JUSBR_CLIENT_SECRET,
|
|
73
|
-
|
|
74
|
-
callback_endpoint: str =
|
|
75
|
-
token_endpoint: str =
|
|
76
|
-
login_endpoint: str =
|
|
77
|
-
logout_endpoint: str =
|
|
78
|
-
auth_url: str =
|
|
79
|
-
callback_url: str =
|
|
80
|
-
token_url: str =
|
|
67
|
+
client_timeout: int = JUSBR_CLIENT_TIMEOUT,
|
|
68
|
+
callback_endpoint: str = JUSBR_ENDPOINT_CALLBACK,
|
|
69
|
+
token_endpoint: str = JUSBR_ENDPOINT_TOKEN,
|
|
70
|
+
login_endpoint: str = JUSBR_ENDPOINT_LOGIN,
|
|
71
|
+
logout_endpoint: str = JUSBR_ENDPOINT_LOGOUT,
|
|
72
|
+
auth_url: str = JUSBR_URL_AUTH_LOGIN,
|
|
73
|
+
callback_url: str = JUSBR_URL_AUTH_CALLBACK,
|
|
74
|
+
token_url: str = JUSBR_URL_AUTH_TOKEN,
|
|
81
75
|
logger: Logger = None) -> None:
|
|
82
76
|
"""
|
|
83
77
|
Configure the JusBR IAM.
|
|
@@ -87,7 +81,7 @@ def jusbr_setup(flask_app: Flask,
|
|
|
87
81
|
:param flask_app: the Flask application
|
|
88
82
|
:param client_id: the client's identification with JusBR
|
|
89
83
|
:param client_secret: the client's password with JusBR
|
|
90
|
-
:param
|
|
84
|
+
:param client_timeout: timeout for login authentication (in seconds,defaults to no timeout)
|
|
91
85
|
:param callback_endpoint: endpoint for the callback from JusBR
|
|
92
86
|
:param token_endpoint: endpoint for retrieving the JusBR authentication token
|
|
93
87
|
:param login_endpoint: endpoint for redirecting user to JusBR login page
|
|
@@ -106,7 +100,7 @@ def jusbr_setup(flask_app: Flask,
|
|
|
106
100
|
_jusbr_registry.update({
|
|
107
101
|
"client-id": client_id,
|
|
108
102
|
"client-secret": client_secret,
|
|
109
|
-
"
|
|
103
|
+
"client-timeout": client_timeout,
|
|
110
104
|
"auth-url": auth_url,
|
|
111
105
|
"callback-url": callback_url,
|
|
112
106
|
"token-url": token_url
|
|
@@ -205,7 +199,7 @@ def service_logout() -> Response:
|
|
|
205
199
|
# methods=["POST"])
|
|
206
200
|
def service_callback() -> Response:
|
|
207
201
|
"""
|
|
208
|
-
Entry point for the callback from JusBR on authentication.
|
|
202
|
+
Entry point for the callback from JusBR on authentication operation.
|
|
209
203
|
|
|
210
204
|
:return: the response containing the token, or *NOT AUTHORIZED*
|
|
211
205
|
"""
|
|
@@ -353,7 +347,7 @@ def __get_login_timeout() -> int | None:
|
|
|
353
347
|
"""
|
|
354
348
|
global _jusbr_registry
|
|
355
349
|
|
|
356
|
-
timeout: int = _jusbr_registry.get("
|
|
350
|
+
timeout: int = _jusbr_registry.get("client-timeout")
|
|
357
351
|
return timeout if isinstance(timeout, int) and timeout > 0 else None
|
|
358
352
|
|
|
359
353
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|