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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_iam
3
- Version: 0.0.7
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
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "pypomes_iam"
9
- version = "0.0.7"
9
+ version = "0.0.9"
10
10
  authors = [
11
11
  { name="GT Nunes", email="wisecoder01@gmail.com" }
12
12
  ]
@@ -1,14 +1,14 @@
1
- from .iam_jusbr import (
1
+ from .jusbr_pomes import (
2
2
  jusbr_setup, jusbr_get_token, jusbr_set_scope
3
3
  )
4
- from .iam_provider import (
4
+ from .provider_pomes import (
5
5
  provider_register, provider_get_token
6
6
  )
7
7
 
8
8
  __all__ = [
9
- # iam_jusbr
9
+ # jusbr_pomes
10
10
  "jusbr_setup", "jusbr_get_token", "jusbr_set_scope",
11
- # jwt_provider
11
+ # provider_pomes
12
12
  "provider_register", "provider_get_token"
13
13
  ]
14
14
 
@@ -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
- JUSBR_LOGIN_TIMEOUT: Final[int] = env_get_int(key=f"{APP_PREFIX}_JUSBR_LOGIN_TIMEOUT")
16
+ JUSBR_CLIENT_TIMEOUT: Final[int] = env_get_int(key=f"{APP_PREFIX}_JUSBR_CLIENT_TIMEOUT")
17
17
 
18
- JUSBR_CALLBACK_ENDPOINT: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_CALLBACK_ENDPOINT",
18
+ JUSBR_ENDPOINT_CALLBACK: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_ENDPOINT_CALLBACK",
19
19
  def_value="/iam/jusbr:callback")
20
- JUSBR_TOKEN_ENDPOINT: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_TOKEN_ENDPOINT",
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
- JUSBR_LOGOUT_ENDPOINT: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_LOGOUT_ENDPOINT",
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
- JUSBR_CALLBACK_URL: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_CALLBACK_URL")
28
- JUSBR_AUTH_URL: Final[str] = env_get_str(
29
- key=f"{APP_PREFIX}JUSBR_AUTH_URL",
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
- # "login-timeout": <int>,
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
- "login-timeout": None,
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
- login_timeout: int = JUSBR_LOGIN_TIMEOUT,
74
- callback_endpoint: str = JUSBR_CALLBACK_ENDPOINT,
75
- token_endpoint: str = JUSBR_TOKEN_ENDPOINT,
76
- login_endpoint: str = JUSBR_LOGIN_ENDPOINT,
77
- logout_endpoint: str = JUSBR_LOGOUT_ENDPOINT,
78
- auth_url: str = JUSBR_AUTH_URL,
79
- callback_url: str = JUSBR_CALLBACK_URL,
80
- token_url: str = JUSBR_TOKEN_URL,
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 login_timeout: timeout for login authentication (in seconds,defaults to no timeout)
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
- "login-timeout": login_timeout,
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("login-timeout")
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