pypomes-iam 0.3.6__py3-none-any.whl → 0.3.8__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from .iam_pomes import (
2
- IamServer, register_logger,
2
+ IamServer, logger_register,
3
3
  login_callback, token_exchange,
4
4
  user_login, user_logout, user_token
5
5
  )
@@ -18,7 +18,7 @@ from .token_pomes import (
18
18
 
19
19
  __all__ = [
20
20
  # iam_pomes
21
- "IamServer", "register_logger",
21
+ "IamServer", "logger_register",
22
22
  "login_callback", "token_exchange",
23
23
  "user_login", "user_logout", "user_token",
24
24
  # jusbr_pomes
pypomes_iam/iam_pomes.py CHANGED
@@ -16,7 +16,7 @@ from .iam_common import (
16
16
  from .token_pomes import token_validate
17
17
 
18
18
 
19
- def register_logger(logger: Logger) -> None:
19
+ def logger_register(logger: Logger) -> None:
20
20
  """
21
21
  Register the logger for IAM operations.
22
22
 
@@ -21,9 +21,9 @@ def service_login() -> Response:
21
21
  """
22
22
  Entry point for the IAM server's login service.
23
23
 
24
- Return the URL for the IAM server's authentication page, with the appropriate parameters.
24
+ Return the URL for invoking the IAM server's authentication page, with the appropriate parameters.
25
25
 
26
- :return: the response from the operation
26
+ :return: *Response* with the URL for invoking the IAM server's authentication page, or *BAD REQUEST* if error
27
27
  """
28
28
  # declare the return variable
29
29
  result: Response | None = None
@@ -70,7 +70,7 @@ def service_logout() -> Response:
70
70
 
71
71
  Remove all data associating the user from the *IAM* server's registry.
72
72
 
73
- :return: response *OK*, or response *BAD REQUEST* if error
73
+ :return: *Response NO CONTENT*, or *BAD REQUEST* if error
74
74
  """
75
75
  # declare the return variable
76
76
  result: Response | None
@@ -97,7 +97,7 @@ def service_logout() -> Response:
97
97
  result = Response("; ".join(errors))
98
98
  result.status_code = 400
99
99
  else:
100
- result = Response(status=200)
100
+ result = Response(status=204)
101
101
 
102
102
  # log the response
103
103
  if logger:
@@ -118,7 +118,13 @@ def service_callback() -> Response:
118
118
  *IAM* server's login page, forwarding the data received. In a typical OAuth2 flow faction,
119
119
  this data is then used to effectively obtain the token from the *IAM* server.
120
120
 
121
- :return: the *Response* containing the reference user identification and the token, or *BAD REQUEST*
121
+ On success, the returned *Response* will contain the following JSON:
122
+ {
123
+ "user-id": <reference-user-identification>,
124
+ "token": <token>
125
+ }
126
+
127
+ :return: *Response* containing the reference user identification and the token, or *BAD REQUEST*
122
128
  """
123
129
  # retrieve the operations's logger
124
130
  logger: Logger = _get_logger()
@@ -147,7 +153,7 @@ def service_callback() -> Response:
147
153
  logger.error(msg=json.dumps(obj=result))
148
154
  else:
149
155
  result = jsonify({"user-id": token_data[0],
150
- "access-token": token_data[1]})
156
+ "token": token_data[1]})
151
157
  # log the response
152
158
  if logger:
153
159
  logger.debug(msg=f"Response {result}")
@@ -163,7 +169,13 @@ def service_token() -> Response:
163
169
  """
164
170
  Entry point for retrieving a token from the *IAM* server.
165
171
 
166
- :return: the *Response* containing the user reference identification and the token, or *BAD REQUEST*
172
+ On success, the returned *Response* will contain the following JSON:
173
+ {
174
+ "user-id": <reference-user-identification>,
175
+ "token": <token>
176
+ }
177
+
178
+ :return: *Response* containing the user reference identification and the token, or *BAD REQUEST*
167
179
  """
168
180
  # retrieve the operations's logger
169
181
  logger: Logger = _get_logger()
@@ -224,7 +236,7 @@ def service_exchange() -> Response:
224
236
  If the exchange is successful, the token data is stored in the *IAM* server's registry, and returned.
225
237
  Otherwise, *errors* will contain the appropriate error message.
226
238
 
227
- The typical *Response* returned contains the following attributes:
239
+ On success, the typical *Response* returned will contain the following attributes:
228
240
  {
229
241
  "token_type": "Bearer",
230
242
  "access_token": <str>,
@@ -233,7 +245,7 @@ def service_exchange() -> Response:
233
245
  "refesh_expires_in": <number-of-seconds>
234
246
  }
235
247
 
236
- :return: the *Response* containing the token data, or *UNAUTHORIZED*
248
+ :return: *Response* containing the token data, or *BAD REQUEST*
237
249
  """
238
250
  # retrieve the operations's logger
239
251
  logger: Logger = _get_logger()
@@ -40,8 +40,7 @@ def jusbr_setup(flask_app: Flask,
40
40
  token_endpoint: str = JUSBR_ENDPOINT_TOKEN,
41
41
  login_endpoint: str = JUSBR_ENDPOINT_LOGIN,
42
42
  logout_endpoint: str = JUSBR_ENDPOINT_LOGOUT,
43
- base_url: str = JUSBR_URL_AUTH_BASE,
44
- logger: Logger = None) -> None:
43
+ base_url: str = JUSBR_URL_AUTH_BASE) -> None:
45
44
  """
46
45
  Configure the JusBR IAM.
47
46
 
@@ -58,7 +57,6 @@ def jusbr_setup(flask_app: Flask,
58
57
  :param login_endpoint: endpoint for redirecting user to JusBR's login page
59
58
  :param logout_endpoint: endpoint for terminating user access to JusBR
60
59
  :param base_url: base URL to request JusBR services
61
- :param logger: optional logger
62
60
  """
63
61
  from .iam_services import service_login, service_logout, service_callback, service_token
64
62
 
@@ -75,7 +73,6 @@ def jusbr_setup(flask_app: Flask,
75
73
  "pk-expiration": sys.maxsize,
76
74
  "pk-lifetime": public_key_lifetime,
77
75
  "cache": cache,
78
- "logger": logger,
79
76
  "redirect-uri": None
80
77
  }
81
78
 
@@ -45,8 +45,7 @@ def keycloak_setup(flask_app: Flask,
45
45
  login_endpoint: str = KEYCLOAK_ENDPOINT_LOGIN,
46
46
  logout_endpoint: str = KEYCLOAK_ENDPOINT_LOGOUT,
47
47
  token_endpoint: str = KEYCLOAK_ENDPOINT_TOKEN,
48
- base_url: str = KEYCLOAK_URL_AUTH_BASE,
49
- logger: Logger = None) -> None:
48
+ base_url: str = KEYCLOAK_URL_AUTH_BASE) -> None:
50
49
  """
51
50
  Configure the Keycloak IAM.
52
51
 
@@ -65,7 +64,6 @@ def keycloak_setup(flask_app: Flask,
65
64
  :param login_endpoint: endpoint for redirecting user to Keycloak's login page
66
65
  :param logout_endpoint: endpoint for terminating user access to Keycloak
67
66
  :param base_url: base URL to request Keycloak services
68
- :param logger: optional logger
69
67
  """
70
68
  from .iam_services import (
71
69
  service_login, service_logout, service_callback, service_exchange, service_token
@@ -84,7 +82,6 @@ def keycloak_setup(flask_app: Flask,
84
82
  "pk-expiration": sys.maxsize,
85
83
  "pk-lifetime": public_key_lifetime,
86
84
  "cache": cache,
87
- "logger": logger,
88
85
  "redirect-uri": None
89
86
  }
90
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_iam
3
- Version: 0.3.6
3
+ Version: 0.3.8
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
@@ -0,0 +1,12 @@
1
+ pypomes_iam/__init__.py,sha256=vl7Frit5Xte3deOSwBSkg462lIhirwU0Rb0QMY3X2pM,965
2
+ pypomes_iam/iam_common.py,sha256=f74FUDcnMM2cgzJg-AF17GwCKwbfoezS8LppwxYwPys,10049
3
+ pypomes_iam/iam_pomes.py,sha256=Qlg78xv4e1WJSX2CMNluZRnHov6lqabeD45-bJ2JZSM,23966
4
+ pypomes_iam/iam_services.py,sha256=xs0y0FUBTDiVu_B_kP900Kp1D77wyphUBxb_-QlD07Y,10445
5
+ pypomes_iam/jusbr_pomes.py,sha256=JQFJVrEzaJZ_uTSDroPgEOxcqmdzz6EZMZmb6jno48s,5716
6
+ pypomes_iam/keycloak_pomes.py,sha256=rZzAtBXgfwTrCs7qf_HsZltS9FzQWZSGCd-ac4eh7vE,6726
7
+ pypomes_iam/provider_pomes.py,sha256=3Rui68hmj8zwY0tnw4aWurz-yQ-niacJFQpi6nWzh-M,6355
8
+ pypomes_iam/token_pomes.py,sha256=1g6PMNNMbmdwLrsvSXvpO8-zdRhso1IFnwAyndNmV4Q,5332
9
+ pypomes_iam-0.3.8.dist-info/METADATA,sha256=qc2_kcS5mEYBQuO-96AQJZz_4ZbMqHYdE08rcNi0IW8,694
10
+ pypomes_iam-0.3.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ pypomes_iam-0.3.8.dist-info/licenses/LICENSE,sha256=YvUELgV8qvXlaYsy9hXG5EW3Bmsrkw-OJmmILZnonAc,1086
12
+ pypomes_iam-0.3.8.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- pypomes_iam/__init__.py,sha256=H7rUCaUEJBLNJv2rtdmBxwcAB28OItdEPenpv_UEOVw,965
2
- pypomes_iam/iam_common.py,sha256=f74FUDcnMM2cgzJg-AF17GwCKwbfoezS8LppwxYwPys,10049
3
- pypomes_iam/iam_pomes.py,sha256=gvDpgff6arB4_Y8AAf6QH2CEWRmdy-kcnQLyD0hx4Y4,23966
4
- pypomes_iam/iam_services.py,sha256=Ae_hLz5luRjK-l_rhBcuuY03Ov7n7o67UYgBb5rbBys,10002
5
- pypomes_iam/jusbr_pomes.py,sha256=0qbjJ6EGnlx17K-4Lqh5XkfH58y0joVZiD6HykbwpoE,5823
6
- pypomes_iam/keycloak_pomes.py,sha256=5ZfpncofF20C1IB5ndO31vfrvfa8Ffy7FJxkGoKKoQQ,6836
7
- pypomes_iam/provider_pomes.py,sha256=3Rui68hmj8zwY0tnw4aWurz-yQ-niacJFQpi6nWzh-M,6355
8
- pypomes_iam/token_pomes.py,sha256=1g6PMNNMbmdwLrsvSXvpO8-zdRhso1IFnwAyndNmV4Q,5332
9
- pypomes_iam-0.3.6.dist-info/METADATA,sha256=q53TFkBnU4mUAZgsJ_r_730kASXLiIyCwW_5mkFz8TU,694
10
- pypomes_iam-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
- pypomes_iam-0.3.6.dist-info/licenses/LICENSE,sha256=YvUELgV8qvXlaYsy9hXG5EW3Bmsrkw-OJmmILZnonAc,1086
12
- pypomes_iam-0.3.6.dist-info/RECORD,,