auth0-ai-langchain 1.0.0b1__tar.gz → 1.0.0b3__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 auth0-ai-langchain might be problematic. Click here for more details.

Files changed (15) hide show
  1. auth0_ai_langchain-1.0.0b1/README.md → auth0_ai_langchain-1.0.0b3/PKG-INFO +54 -1
  2. auth0_ai_langchain-1.0.0b1/PKG-INFO → auth0_ai_langchain-1.0.0b3/README.md +31 -24
  3. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/auth0_ai.py +3 -2
  4. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/federated_connections/__init__.py +4 -1
  5. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/pyproject.toml +7 -7
  6. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/LICENSE +0 -0
  7. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/FGARetriever.py +0 -0
  8. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/__init__.py +0 -0
  9. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/ciba/__init__.py +0 -0
  10. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/ciba/ciba_authorizer.py +0 -0
  11. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/ciba/graph_resumer.py +0 -0
  12. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/federated_connections/federated_connection_authorizer.py +0 -0
  13. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/fga/__init__.py +0 -0
  14. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/utils/interrupt.py +0 -0
  15. {auth0_ai_langchain-1.0.0b1 → auth0_ai_langchain-1.0.0b3}/auth0_ai_langchain/utils/tool_wrapper.py +0 -0
@@ -1,3 +1,25 @@
1
+ Metadata-Version: 2.3
2
+ Name: auth0-ai-langchain
3
+ Version: 1.0.0b3
4
+ Summary: This package is an SDK for building secure AI-powered applications using Auth0, Okta FGA and LangChain.
5
+ License: Apache-2.0
6
+ Author: Auth0
7
+ Author-email: support@auth0.com
8
+ Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: auth0-ai (>=1.0.0b3,<2.0.0)
15
+ Requires-Dist: langchain (>=0.3.26,<0.4.0)
16
+ Requires-Dist: langchain-core (>=0.3.69,<0.4.0)
17
+ Requires-Dist: langgraph (>=0.5.3,<0.6.0)
18
+ Requires-Dist: langgraph-sdk (>=0.1.73,<0.2.0)
19
+ Requires-Dist: openfga-sdk (>=0.9.5,<0.10.0)
20
+ Project-URL: Homepage, https://auth0.com
21
+ Description-Content-Type: text/markdown
22
+
1
23
  # Auth0 AI for LangChain
2
24
 
3
25
  `auth0-ai-langchain` is an SDK for building secure AI-powered applications using [Auth0](https://www.auth0.ai/), [Okta FGA](https://docs.fga.dev/) and [LangChain](https://python.langchain.com/docs/tutorials/).
@@ -30,7 +52,7 @@ from langchain_core.tools import StructuredTool
30
52
  auth0_ai = Auth0AI()
31
53
 
32
54
  with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
33
- scope="stock:trade",
55
+ scopes=["stock:trade"],
34
56
  audience=os.getenv("AUDIENCE"),
35
57
  binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
36
58
  user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
@@ -58,6 +80,36 @@ trade_tool = with_async_user_confirmation(
58
80
 
59
81
  2. Handle interruptions properly. For example, if user is not enrolled to MFA, it will throw an interruption. See [Handling Interrupts](#handling-interrupts) section.
60
82
 
83
+ ### CIBA with RAR (Rich Authorization Requests)
84
+ `Auth0AI` supports RAR (Rich Authorization Requests) for CIBA. This allows you to provide additional authorization parameters to be displayed during the user confirmation request.
85
+
86
+ When defining the tool authorizer, you can specify the `authorization_details` parameter to include detailed information about the authorization being requested:
87
+
88
+ ```python
89
+ with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
90
+ scopes=["stock:trade"],
91
+ audience=os.getenv("AUDIENCE"),
92
+ binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
93
+ authorization_details=lambda ticker, qty: [
94
+ {
95
+ "type": "trade_authorization",
96
+ "qty": qty,
97
+ "ticker": ticker,
98
+ "action": "buy"
99
+ }
100
+ ],
101
+ user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
102
+ # Optional:
103
+ # store=InMemoryStore()
104
+ )
105
+ ```
106
+
107
+ To use RAR with CIBA, you need to [set up authorization details](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests) in your Auth0 tenant. This includes defining the authorization request parameters and their types. Additionally, the [Guardian SDK](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian) is required to handle these authorization details in your authorizer app.
108
+
109
+ For more information on setting up RAR with CIBA, refer to:
110
+ - [Configure Rich Authorization Requests (RAR)](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests)
111
+ - [User Authorization with CIBA](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba)
112
+
61
113
  ## Authorization for Tools
62
114
 
63
115
  The `FGAAuthorizer` can leverage Okta FGA to authorize tools executions. The `FGAAuthorizer.create` function can be used to create an authorizer that checks permissions before executing the tool.
@@ -297,3 +349,4 @@ resumer.start()
297
349
  <p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
298
350
  <p align="center">
299
351
  This project is licensed under the Apache 2.0 license. See the <a href="https://github.com/auth0-lab/auth0-ai-python/blob/main/LICENSE"> LICENSE</a> file for more info.</p>
352
+
@@ -1,25 +1,3 @@
1
- Metadata-Version: 2.3
2
- Name: auth0-ai-langchain
3
- Version: 1.0.0b1
4
- Summary: This package is an SDK for building secure AI-powered applications using Auth0, Okta FGA and LangChain.
5
- License: Apache-2.0
6
- Author: Auth0
7
- Author-email: support@auth0.com
8
- Requires-Python: >=3.11,<4.0
9
- Classifier: License :: OSI Approved :: Apache Software License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Requires-Dist: auth0-ai (>=1.0.0b1,<2.0.0)
15
- Requires-Dist: langchain (>=0.3.25,<0.4.0)
16
- Requires-Dist: langchain-core (>=0.3.59,<0.4.0)
17
- Requires-Dist: langgraph (>=0.4.3,<0.5.0)
18
- Requires-Dist: langgraph-sdk (>=0.1.66,<0.2.0)
19
- Requires-Dist: openfga-sdk (>=0.9.4,<0.10.0)
20
- Project-URL: Homepage, https://auth0.com
21
- Description-Content-Type: text/markdown
22
-
23
1
  # Auth0 AI for LangChain
24
2
 
25
3
  `auth0-ai-langchain` is an SDK for building secure AI-powered applications using [Auth0](https://www.auth0.ai/), [Okta FGA](https://docs.fga.dev/) and [LangChain](https://python.langchain.com/docs/tutorials/).
@@ -52,7 +30,7 @@ from langchain_core.tools import StructuredTool
52
30
  auth0_ai = Auth0AI()
53
31
 
54
32
  with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
55
- scope="stock:trade",
33
+ scopes=["stock:trade"],
56
34
  audience=os.getenv("AUDIENCE"),
57
35
  binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
58
36
  user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
@@ -80,6 +58,36 @@ trade_tool = with_async_user_confirmation(
80
58
 
81
59
  2. Handle interruptions properly. For example, if user is not enrolled to MFA, it will throw an interruption. See [Handling Interrupts](#handling-interrupts) section.
82
60
 
61
+ ### CIBA with RAR (Rich Authorization Requests)
62
+ `Auth0AI` supports RAR (Rich Authorization Requests) for CIBA. This allows you to provide additional authorization parameters to be displayed during the user confirmation request.
63
+
64
+ When defining the tool authorizer, you can specify the `authorization_details` parameter to include detailed information about the authorization being requested:
65
+
66
+ ```python
67
+ with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
68
+ scopes=["stock:trade"],
69
+ audience=os.getenv("AUDIENCE"),
70
+ binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
71
+ authorization_details=lambda ticker, qty: [
72
+ {
73
+ "type": "trade_authorization",
74
+ "qty": qty,
75
+ "ticker": ticker,
76
+ "action": "buy"
77
+ }
78
+ ],
79
+ user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id"),
80
+ # Optional:
81
+ # store=InMemoryStore()
82
+ )
83
+ ```
84
+
85
+ To use RAR with CIBA, you need to [set up authorization details](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests) in your Auth0 tenant. This includes defining the authorization request parameters and their types. Additionally, the [Guardian SDK](https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian) is required to handle these authorization details in your authorizer app.
86
+
87
+ For more information on setting up RAR with CIBA, refer to:
88
+ - [Configure Rich Authorization Requests (RAR)](https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests)
89
+ - [User Authorization with CIBA](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba)
90
+
83
91
  ## Authorization for Tools
84
92
 
85
93
  The `FGAAuthorizer` can leverage Okta FGA to authorize tools executions. The `FGAAuthorizer.create` function can be used to create an authorizer that checks permissions before executing the tool.
@@ -319,4 +327,3 @@ resumer.start()
319
327
  <p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
320
328
  <p align="center">
321
329
  This project is licensed under the Apache 2.0 license. See the <a href="https://github.com/auth0-lab/auth0-ai-python/blob/main/LICENSE"> LICENSE</a> file for more info.</p>
322
-
@@ -44,7 +44,7 @@ class Auth0AI:
44
44
  auth0_ai = Auth0AI()
45
45
 
46
46
  with_async_user_confirmation = auth0_ai.with_async_user_confirmation(
47
- scope="stock:trade",
47
+ scopes=["stock:trade"],
48
48
  audience=os.getenv("AUDIENCE"),
49
49
  binding_message=lambda ticker, qty: f"Authorize the purchase of {qty} {ticker}",
50
50
  user_id=lambda *_, **__: ensure_config().get("configurable", {}).get("user_id")
@@ -108,5 +108,6 @@ class Auth0AI:
108
108
  )
109
109
  ```
110
110
  """
111
- authorizer = FederatedConnectionAuthorizer(FederatedConnectionAuthorizerParams(**params), self.auth0)
111
+ authorizer = FederatedConnectionAuthorizer(
112
+ FederatedConnectionAuthorizerParams(**params), self.auth0)
112
113
  return authorizer.authorizer()
@@ -3,5 +3,8 @@ from auth0_ai.interrupts.federated_connection_interrupt import (
3
3
  FederatedConnectionInterrupt as FederatedConnectionInterrupt
4
4
  )
5
5
 
6
- from auth0_ai.authorizers.federated_connection_authorizer import get_credentials_for_connection as get_credentials_for_connection
6
+ from auth0_ai.authorizers.federated_connection_authorizer import (
7
+ get_credentials_for_connection as get_credentials_for_connection,
8
+ get_access_token_for_connection as get_access_token_for_connection
9
+ )
7
10
  from .federated_connection_authorizer import FederatedConnectionAuthorizer as FederatedConnectionAuthorizer
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "auth0-ai-langchain"
3
- version = "1.0.0b1"
3
+ version = "1.0.0b3"
4
4
  description = "This package is an SDK for building secure AI-powered applications using Auth0, Okta FGA and LangChain."
5
5
  license = "apache-2.0"
6
6
  homepage = "https://auth0.com"
@@ -9,12 +9,12 @@ readme = "README.md"
9
9
 
10
10
  [tool.poetry.dependencies]
11
11
  python = "^3.11"
12
- openfga-sdk = "^0.9.4"
13
- langchain = "^0.3.25"
14
- langgraph-sdk = "^0.1.66"
15
- langchain-core = "^0.3.59"
16
- langgraph = "^0.4.3"
17
- auth0-ai = "^1.0.0b1"
12
+ openfga-sdk = "^0.9.5"
13
+ langchain = "^0.3.26"
14
+ langgraph-sdk = "^0.1.73"
15
+ langchain-core = "^0.3.69"
16
+ langgraph = "^0.5.3"
17
+ auth0-ai = "^1.0.0b3"
18
18
  # auth0-ai = { path = "../auth0-ai", develop = true }
19
19
 
20
20
  [tool.poetry.group.test.dependencies]