pypomes-iam 0.1.2__py3-none-any.whl → 0.1.4__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/jusbr_pomes.py +6 -5
- pypomes_iam/keycloak_pomes.py +3 -2
- {pypomes_iam-0.1.2.dist-info → pypomes_iam-0.1.4.dist-info}/METADATA +1 -1
- pypomes_iam-0.1.4.dist-info/RECORD +9 -0
- pypomes_iam-0.1.2.dist-info/RECORD +0 -9
- {pypomes_iam-0.1.2.dist-info → pypomes_iam-0.1.4.dist-info}/WHEEL +0 -0
- {pypomes_iam-0.1.2.dist-info → pypomes_iam-0.1.4.dist-info}/licenses/LICENSE +0 -0
pypomes_iam/jusbr_pomes.py
CHANGED
|
@@ -91,7 +91,7 @@ def jusbr_setup(flask_app: Flask,
|
|
|
91
91
|
_logger = logger
|
|
92
92
|
|
|
93
93
|
# configure the JusBR registry
|
|
94
|
-
global _jusbr_registry
|
|
94
|
+
global _jusbr_registry
|
|
95
95
|
_jusbr_registry = {
|
|
96
96
|
"client-id": client_id,
|
|
97
97
|
"client-secret": client_secret,
|
|
@@ -99,7 +99,8 @@ def jusbr_setup(flask_app: Flask,
|
|
|
99
99
|
"auth-url": auth_url,
|
|
100
100
|
"callback-url": callback_url,
|
|
101
101
|
"key-expiration": int(datetime.now(tz=TZ_LOCAL).timestamp()),
|
|
102
|
-
"key-lifetime": public_key_lifetime
|
|
102
|
+
"key-lifetime": public_key_lifetime,
|
|
103
|
+
"users": {}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
# establish the endpoints
|
|
@@ -142,7 +143,7 @@ def service_login() -> Response:
|
|
|
142
143
|
oauth_state: str = "".join(secrets.choice(string.ascii_letters + string.digits) for _ in range(16))
|
|
143
144
|
user_id: str = input_params.get("user-id") or input_params.get("login") or oauth_state
|
|
144
145
|
# obtain user data
|
|
145
|
-
user_data: dict[str, Any] = __get_user_data(user_id=user_id
|
|
146
|
+
user_data: dict[str, Any] = __get_user_data(user_id=user_id,
|
|
146
147
|
logger=_logger)
|
|
147
148
|
# build redirect url
|
|
148
149
|
timeout: int = __get_login_timeout()
|
|
@@ -156,7 +157,7 @@ def service_login() -> Response:
|
|
|
156
157
|
user_data["cache-obj"] = safe_cache
|
|
157
158
|
auth_url: str = (f"{_jusbr_registry["auth-url"]}/protocol/openid-connect/auth?response_type=code"
|
|
158
159
|
f"&client_id={_jusbr_registry["client-id"]}"
|
|
159
|
-
f"&
|
|
160
|
+
f"&redirect_uri={_jusbr_registry["callback-url"]}"
|
|
160
161
|
f"&state={oauth_state}")
|
|
161
162
|
if user_data.get("oauth-scope"):
|
|
162
163
|
auth_url += f"&scope={user_data.get("oauth-scope")}"
|
|
@@ -438,7 +439,7 @@ def __post_jusbr(user_data: dict[str, Any],
|
|
|
438
439
|
For code for token exchange, *body_data* will have the attributes
|
|
439
440
|
- "grant_type": "authorization_code"
|
|
440
441
|
- "code": <16-character-random-code>
|
|
441
|
-
- "
|
|
442
|
+
- "redirect_uri": <callback-url>
|
|
442
443
|
For token refresh, *body_data* will have the attributes
|
|
443
444
|
- "grant_type": "refresh_token"
|
|
444
445
|
- "refresh_token": <current-refresh-token>
|
pypomes_iam/keycloak_pomes.py
CHANGED
|
@@ -92,7 +92,7 @@ def keycloak_setup(flask_app: Flask,
|
|
|
92
92
|
:param callback_url: URL for Keycloak to callback on login
|
|
93
93
|
:param logger: optional logger
|
|
94
94
|
"""
|
|
95
|
-
global _keycloak_registry
|
|
95
|
+
global _keycloak_registry
|
|
96
96
|
|
|
97
97
|
# establish the logger
|
|
98
98
|
global _logger
|
|
@@ -105,7 +105,8 @@ def keycloak_setup(flask_app: Flask,
|
|
|
105
105
|
"client-timeout": client_timeout,
|
|
106
106
|
"realm": realm,
|
|
107
107
|
"auth-url": auth_url,
|
|
108
|
-
"callback-url": callback_url
|
|
108
|
+
"callback-url": callback_url,
|
|
109
|
+
"users": []
|
|
109
110
|
})
|
|
110
111
|
|
|
111
112
|
# establish the endpoints
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_iam
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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,9 @@
|
|
|
1
|
+
pypomes_iam/__init__.py,sha256=lHnqNqW1stQjcM6cr9wf3GGnw5_zGf1HN3zyHGb8PCA,577
|
|
2
|
+
pypomes_iam/jusbr_pomes.py,sha256=XtkekDBgvSD5hboP2uIn5xAIcKCBRTpGXejE-iNW0rM,20242
|
|
3
|
+
pypomes_iam/keycloak_pomes.py,sha256=4vLaYQNY9S9xHmyiv9Ii8jgL5jA1-MgAgWduicCyofw,8059
|
|
4
|
+
pypomes_iam/provider_pomes.py,sha256=eP8XzjTUEpwejTkO0wmDiqKjqbIEOzRNCR2ju5E15og,5856
|
|
5
|
+
pypomes_iam/token_pomes.py,sha256=McjKB8omCjuicenwvDVPiWYu3-7gQeLg1AzgAVKK32M,4309
|
|
6
|
+
pypomes_iam-0.1.4.dist-info/METADATA,sha256=L7VEtNCcRPI76Bj8H1PnjdrfgJ413VsuBoPkcQ2KyO4,694
|
|
7
|
+
pypomes_iam-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
pypomes_iam-0.1.4.dist-info/licenses/LICENSE,sha256=YvUELgV8qvXlaYsy9hXG5EW3Bmsrkw-OJmmILZnonAc,1086
|
|
9
|
+
pypomes_iam-0.1.4.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
pypomes_iam/__init__.py,sha256=lHnqNqW1stQjcM6cr9wf3GGnw5_zGf1HN3zyHGb8PCA,577
|
|
2
|
-
pypomes_iam/jusbr_pomes.py,sha256=clPb5RitMXymrObONwcrWm3XFS9nAPUbKnltK-O2Kc8,20252
|
|
3
|
-
pypomes_iam/keycloak_pomes.py,sha256=qa3PGekZ1yFKxyWO5-doMLWAwuSzAo0zvG48N0HQRLs,8054
|
|
4
|
-
pypomes_iam/provider_pomes.py,sha256=eP8XzjTUEpwejTkO0wmDiqKjqbIEOzRNCR2ju5E15og,5856
|
|
5
|
-
pypomes_iam/token_pomes.py,sha256=McjKB8omCjuicenwvDVPiWYu3-7gQeLg1AzgAVKK32M,4309
|
|
6
|
-
pypomes_iam-0.1.2.dist-info/METADATA,sha256=v6264bGX36iasqyrwPX757bNgiaw5Lg9EDuhtDLC0zc,694
|
|
7
|
-
pypomes_iam-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
pypomes_iam-0.1.2.dist-info/licenses/LICENSE,sha256=YvUELgV8qvXlaYsy9hXG5EW3Bmsrkw-OJmmILZnonAc,1086
|
|
9
|
-
pypomes_iam-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|