pypomes-iam 0.3.8__py3-none-any.whl → 0.3.9__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.
@@ -31,32 +31,32 @@ JUSBR_URL_AUTH_BASE: Final[str] = env_get_str(key=f"{APP_PREFIX}_JUSBR_URL_AUTH_
31
31
 
32
32
 
33
33
  def jusbr_setup(flask_app: Flask,
34
+ base_url: str = JUSBR_URL_AUTH_BASE,
34
35
  client_id: str = JUSBR_CLIENT_ID,
35
36
  client_secret: str = JUSBR_CLIENT_SECRET,
36
37
  client_timeout: int = JUSBR_CLIENT_TIMEOUT,
37
- public_key_lifetime: int = JUSBR_PUBLIC_KEY_LIFETIME,
38
- recipient_attribute: str = JUSBR_RECIPIENT_ATTR,
39
- callback_endpoint: str = JUSBR_ENDPOINT_CALLBACK,
40
- token_endpoint: str = JUSBR_ENDPOINT_TOKEN,
41
- login_endpoint: str = JUSBR_ENDPOINT_LOGIN,
42
- logout_endpoint: str = JUSBR_ENDPOINT_LOGOUT,
43
- base_url: str = JUSBR_URL_AUTH_BASE) -> None:
38
+ public_key_lifetime: int | None = JUSBR_PUBLIC_KEY_LIFETIME,
39
+ recipient_attribute: str | None = JUSBR_RECIPIENT_ATTR,
40
+ callback_endpoint: str | None = JUSBR_ENDPOINT_CALLBACK,
41
+ login_endpoint: str | None = JUSBR_ENDPOINT_LOGIN,
42
+ logout_endpoint: str | None = JUSBR_ENDPOINT_LOGOUT,
43
+ token_endpoint: str | None = JUSBR_ENDPOINT_TOKEN) -> None:
44
44
  """
45
45
  Configure the JusBR IAM.
46
46
 
47
47
  This should be invoked only once, before the first access to a JusBR service.
48
48
 
49
49
  :param flask_app: the Flask application
50
+ :param base_url: base URL to request JusBR services
50
51
  :param client_id: the client's identification with JusBR
51
52
  :param client_secret: the client's password with JusBR
52
53
  :param client_timeout: timeout for login authentication (in seconds,defaults to no timeout)
53
54
  :param public_key_lifetime: how long to use JusBR's public key, before refreshing it (in seconds)
54
55
  :param recipient_attribute: attribute in the token's payload holding the token's subject
55
56
  :param callback_endpoint: endpoint for the callback from JusBR
56
- :param token_endpoint: endpoint for retrieving JusBR's authentication token
57
57
  :param login_endpoint: endpoint for redirecting user to JusBR's login page
58
58
  :param logout_endpoint: endpoint for terminating user access to JusBR
59
- :param base_url: base URL to request JusBR services
59
+ :param token_endpoint: endpoint for retrieving JusBR's authentication token
60
60
  """
61
61
  from .iam_services import service_login, service_logout, service_callback, service_token
62
62
 
@@ -77,6 +77,11 @@ def jusbr_setup(flask_app: Flask,
77
77
  }
78
78
 
79
79
  # establish the endpoints
80
+ if callback_endpoint:
81
+ flask_app.add_url_rule(rule=callback_endpoint,
82
+ endpoint="jusbr-callback",
83
+ view_func=service_callback,
84
+ methods=["GET"])
80
85
  if login_endpoint:
81
86
  flask_app.add_url_rule(rule=login_endpoint,
82
87
  endpoint="jusbr-login",
@@ -87,11 +92,6 @@ def jusbr_setup(flask_app: Flask,
87
92
  endpoint="jusbr-logout",
88
93
  view_func=service_logout,
89
94
  methods=["GET"])
90
- if callback_endpoint:
91
- flask_app.add_url_rule(rule=callback_endpoint,
92
- endpoint="jusbr-callback",
93
- view_func=service_callback,
94
- methods=["GET"])
95
95
  if token_endpoint:
96
96
  flask_app.add_url_rule(rule=token_endpoint,
97
97
  endpoint="jusbr-token",
@@ -34,36 +34,36 @@ KEYCLOAK_URL_AUTH_BASE: Final[str] = env_get_str(key=f"{APP_PREFIX}_KEYCLOAK_URL
34
34
 
35
35
 
36
36
  def keycloak_setup(flask_app: Flask,
37
+ base_url: str = KEYCLOAK_URL_AUTH_BASE,
38
+ realm: str = KEYCLOAK_REALM,
37
39
  client_id: str = KEYCLOAK_CLIENT_ID,
38
40
  client_secret: str = KEYCLOAK_CLIENT_SECRET,
39
41
  client_timeout: int = KEYCLOAK_CLIENT_TIMEOUT,
40
- public_key_lifetime: int = KEYCLOAK_PUBLIC_KEY_LIFETIME,
41
- recipient_attribute: str = KEYCLOAK_RECIPIENT_ATTR,
42
- realm: str = KEYCLOAK_REALM,
43
- callback_endpoint: str = KEYCLOAK_ENDPOINT_CALLBACK,
44
- exchange_endpoint: str = KEYCLOAK_ENDPOINT_EXCHANGE,
45
- login_endpoint: str = KEYCLOAK_ENDPOINT_LOGIN,
46
- logout_endpoint: str = KEYCLOAK_ENDPOINT_LOGOUT,
47
- token_endpoint: str = KEYCLOAK_ENDPOINT_TOKEN,
48
- base_url: str = KEYCLOAK_URL_AUTH_BASE) -> None:
42
+ public_key_lifetime: int | None = KEYCLOAK_PUBLIC_KEY_LIFETIME,
43
+ recipient_attribute: str | None = KEYCLOAK_RECIPIENT_ATTR,
44
+ callback_endpoint: str | None = KEYCLOAK_ENDPOINT_CALLBACK,
45
+ login_endpoint: str | None = KEYCLOAK_ENDPOINT_LOGIN,
46
+ logout_endpoint: str | None = KEYCLOAK_ENDPOINT_LOGOUT,
47
+ token_endpoint: str | None = KEYCLOAK_ENDPOINT_TOKEN,
48
+ exchange_endpoint: str | None = KEYCLOAK_ENDPOINT_EXCHANGE) -> None:
49
49
  """
50
50
  Configure the Keycloak IAM.
51
51
 
52
52
  This should be invoked only once, before the first access to a Keycloak service.
53
53
 
54
54
  :param flask_app: the Flask application
55
+ :param base_url: base URL to request Keycloak services
56
+ :param realm: the Keycloak realm
55
57
  :param client_id: the client's identification with JusBR
56
58
  :param client_secret: the client's password with JusBR
57
59
  :param client_timeout: timeout for login authentication (in seconds,defaults to no timeout)
58
60
  :param public_key_lifetime: how long to use Keycloak's public key, before refreshing it (in seconds)
59
61
  :param recipient_attribute: attribute in the token's payload holding the token's subject
60
- :param realm: the Keycloak realm
61
62
  :param callback_endpoint: endpoint for the callback from the front end
62
- :param exchange_endpoint: endpoint fro requesting token exchange
63
- :param token_endpoint: endpoint for retrieving Keycloak's authentication token
64
63
  :param login_endpoint: endpoint for redirecting user to Keycloak's login page
65
64
  :param logout_endpoint: endpoint for terminating user access to Keycloak
66
- :param base_url: base URL to request Keycloak services
65
+ :param token_endpoint: endpoint for retrieving Keycloak's authentication token
66
+ :param exchange_endpoint: endpoint for requesting token exchange
67
67
  """
68
68
  from .iam_services import (
69
69
  service_login, service_logout, service_callback, service_exchange, service_token
@@ -86,6 +86,11 @@ def keycloak_setup(flask_app: Flask,
86
86
  }
87
87
 
88
88
  # establish the endpoints
89
+ if callback_endpoint:
90
+ flask_app.add_url_rule(rule=callback_endpoint,
91
+ endpoint="keycloak-callback",
92
+ view_func=service_callback,
93
+ methods=["GET"])
89
94
  if login_endpoint:
90
95
  flask_app.add_url_rule(rule=login_endpoint,
91
96
  endpoint="keycloak-login",
@@ -96,11 +101,6 @@ def keycloak_setup(flask_app: Flask,
96
101
  endpoint="keycloak-logout",
97
102
  view_func=service_logout,
98
103
  methods=["GET"])
99
- if callback_endpoint:
100
- flask_app.add_url_rule(rule=callback_endpoint,
101
- endpoint="keycloak-callback",
102
- view_func=service_callback,
103
- methods=["GET"])
104
104
  if token_endpoint:
105
105
  flask_app.add_url_rule(rule=token_endpoint,
106
106
  endpoint="keycloak-token",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_iam
3
- Version: 0.3.8
3
+ Version: 0.3.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
@@ -2,11 +2,11 @@ pypomes_iam/__init__.py,sha256=vl7Frit5Xte3deOSwBSkg462lIhirwU0Rb0QMY3X2pM,965
2
2
  pypomes_iam/iam_common.py,sha256=f74FUDcnMM2cgzJg-AF17GwCKwbfoezS8LppwxYwPys,10049
3
3
  pypomes_iam/iam_pomes.py,sha256=Qlg78xv4e1WJSX2CMNluZRnHov6lqabeD45-bJ2JZSM,23966
4
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
5
+ pypomes_iam/jusbr_pomes.py,sha256=G-COBstBeQeD7dPgvf2MI1E8r2-ACHHwzhyfsphhKgw,5758
6
+ pypomes_iam/keycloak_pomes.py,sha256=JxVVFdhXJypK5x9ocn7283pB1xJbS-yPgStkSFS12HM,6775
7
7
  pypomes_iam/provider_pomes.py,sha256=3Rui68hmj8zwY0tnw4aWurz-yQ-niacJFQpi6nWzh-M,6355
8
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,,
9
+ pypomes_iam-0.3.9.dist-info/METADATA,sha256=fvTKxq9nwZGvQAcE0uQxMa9BLjgZomapgkn6OwplsWk,694
10
+ pypomes_iam-0.3.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ pypomes_iam-0.3.9.dist-info/licenses/LICENSE,sha256=YvUELgV8qvXlaYsy9hXG5EW3Bmsrkw-OJmmILZnonAc,1086
12
+ pypomes_iam-0.3.9.dist-info/RECORD,,