Skip to content

Commit c1a6765

Browse files
feat: Support existing-user AgentCard wallet imports
Stainless-Generated-From: 207cf9bd5926ddf327a2b6db9df5a97300e62a59
1 parent 457e6c1 commit c1a6765

5 files changed

Lines changed: 52 additions & 12 deletions

File tree

‎src/kernel/resources/vaults/items.py‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,8 +1236,16 @@ def upsert(
12361236
select a customer-owned configuration. Mode (sandbox vs live) is determined by
12371237
the selected credential; there is no per-item test flag. Without user_id,
12381238
creation returns a hosted enrollment action and Kernel polls until the user
1239-
connects. user_id may only reference a user already enrolled by a wallet in this
1240-
organization under the same configuration.
1239+
connects. With a customer-owned provider_config, user_id imports an existing
1240+
connection after verifying access with the selected credentials in their sandbox
1241+
or live mode; no hosted enrollment is needed, even if the connected user has no
1242+
stored cards. With Kernel-managed credentials, user_id may only reference a user
1243+
already enrolled by a wallet in this organization under the same configuration.
1244+
The user and configuration bindings cannot be changed after creation. Import
1245+
validation is read-only and runs before creation: a failed validation leaves no
1246+
wallet or reserved key, so the user_id can be corrected and retried. Concurrent
1247+
imports of the same key may both validate, but create at most one wallet and
1248+
connected event.
12411249
12421250
extra_headers: Send extra headers
12431251
@@ -2609,8 +2617,16 @@ async def upsert(
26092617
select a customer-owned configuration. Mode (sandbox vs live) is determined by
26102618
the selected credential; there is no per-item test flag. Without user_id,
26112619
creation returns a hosted enrollment action and Kernel polls until the user
2612-
connects. user_id may only reference a user already enrolled by a wallet in this
2613-
organization under the same configuration.
2620+
connects. With a customer-owned provider_config, user_id imports an existing
2621+
connection after verifying access with the selected credentials in their sandbox
2622+
or live mode; no hosted enrollment is needed, even if the connected user has no
2623+
stored cards. With Kernel-managed credentials, user_id may only reference a user
2624+
already enrolled by a wallet in this organization under the same configuration.
2625+
The user and configuration bindings cannot be changed after creation. Import
2626+
validation is read-only and runs before creation: a failed validation leaves no
2627+
wallet or reserved key, so the user_id can be corrected and retried. Concurrent
2628+
imports of the same key may both validate, but create at most one wallet and
2629+
connected event.
26142630
26152631
extra_headers: Send extra headers
26162632

‎src/kernel/types/vaults/item_upsert_params.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,16 @@ class WalletVaultItemRequest(TypedDict, total=False):
4040
customer-owned configuration. Mode (sandbox vs live) is determined by the
4141
selected credential; there is no per-item test flag. Without user_id, creation
4242
returns a hosted enrollment action and Kernel polls until the user connects.
43-
user_id may only reference a user already enrolled by a wallet in this
44-
organization under the same configuration.
43+
With a customer-owned provider_config, user_id imports an existing connection
44+
after verifying access with the selected credentials in their sandbox or live
45+
mode; no hosted enrollment is needed, even if the connected user has no stored
46+
cards. With Kernel-managed credentials, user_id may only reference a user
47+
already enrolled by a wallet in this organization under the same configuration.
48+
The user and configuration bindings cannot be changed after creation. Import
49+
validation is read-only and runs before creation: a failed validation leaves no
50+
wallet or reserved key, so the user_id can be corrected and retried. Concurrent
51+
imports of the same key may both validate, but create at most one wallet and
52+
connected event.
4553
"""
4654

4755
type: Required[Literal["wallet"]]
@@ -162,7 +170,7 @@ class WalletVaultItemRequestSpecAgentCardWalletVaultItemSpecProviderConfig(Typed
162170
class WalletVaultItemRequestSpecAgentCardWalletVaultItemSpec(TypedDict, total=False):
163171
"""AgentCard wallet.
164172
165-
Omit provider_config to use Kernel-managed credentials, or select a customer-owned configuration. Mode (sandbox vs live) is determined by the selected credential; there is no per-item test flag. Without user_id, creation returns a hosted enrollment action and Kernel polls until the user connects. user_id may only reference a user already enrolled by a wallet in this organization under the same configuration.
173+
Omit provider_config to use Kernel-managed credentials, or select a customer-owned configuration. Mode (sandbox vs live) is determined by the selected credential; there is no per-item test flag. Without user_id, creation returns a hosted enrollment action and Kernel polls until the user connects. With a customer-owned provider_config, user_id imports an existing connection after verifying access with the selected credentials in their sandbox or live mode; no hosted enrollment is needed, even if the connected user has no stored cards. With Kernel-managed credentials, user_id may only reference a user already enrolled by a wallet in this organization under the same configuration. The user and configuration bindings cannot be changed after creation. Import validation is read-only and runs before creation: a failed validation leaves no wallet or reserved key, so the user_id can be corrected and retried. Concurrent imports of the same key may both validate, but create at most one wallet and connected event.
166174
"""
167175

168176
provider: Required[Literal["agentcard"]]

‎src/kernel/types/vaults/vault_item.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,16 @@ class WalletVaultItem(BaseModel):
8686
customer-owned configuration. Mode (sandbox vs live) is determined by the
8787
selected credential; there is no per-item test flag. Without user_id, creation
8888
returns a hosted enrollment action and Kernel polls until the user connects.
89-
user_id may only reference a user already enrolled by a wallet in this
90-
organization under the same configuration.
89+
With a customer-owned provider_config, user_id imports an existing connection
90+
after verifying access with the selected credentials in their sandbox or live
91+
mode; no hosted enrollment is needed, even if the connected user has no stored
92+
cards. With Kernel-managed credentials, user_id may only reference a user
93+
already enrolled by a wallet in this organization under the same configuration.
94+
The user and configuration bindings cannot be changed after creation. Import
95+
validation is read-only and runs before creation: a failed validation leaves no
96+
wallet or reserved key, so the user_id can be corrected and retried. Concurrent
97+
imports of the same key may both validate, but create at most one wallet and
98+
connected event.
9199
"""
92100

93101
state: WalletVaultItemState

‎src/kernel/types/vaults/vault_item_operation_response.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,16 @@ class WalletVaultItem(BaseModel):
8888
customer-owned configuration. Mode (sandbox vs live) is determined by the
8989
selected credential; there is no per-item test flag. Without user_id, creation
9090
returns a hosted enrollment action and Kernel polls until the user connects.
91-
user_id may only reference a user already enrolled by a wallet in this
92-
organization under the same configuration.
91+
With a customer-owned provider_config, user_id imports an existing connection
92+
after verifying access with the selected credentials in their sandbox or live
93+
mode; no hosted enrollment is needed, even if the connected user has no stored
94+
cards. With Kernel-managed credentials, user_id may only reference a user
95+
already enrolled by a wallet in this organization under the same configuration.
96+
The user and configuration bindings cannot be changed after creation. Import
97+
validation is read-only and runs before creation: a failed validation leaves no
98+
wallet or reserved key, so the user_id can be corrected and retried. Concurrent
99+
imports of the same key may both validate, but create at most one wallet and
100+
connected event.
93101
"""
94102

95103
state: WalletVaultItemState

‎src/kernel/types/vaults/wallet_vault_item_spec.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AgentCardWalletVaultItemSpecProviderConfig(BaseModel):
8181
class AgentCardWalletVaultItemSpec(BaseModel):
8282
"""AgentCard wallet.
8383
84-
Omit provider_config to use Kernel-managed credentials, or select a customer-owned configuration. Mode (sandbox vs live) is determined by the selected credential; there is no per-item test flag. Without user_id, creation returns a hosted enrollment action and Kernel polls until the user connects. user_id may only reference a user already enrolled by a wallet in this organization under the same configuration.
84+
Omit provider_config to use Kernel-managed credentials, or select a customer-owned configuration. Mode (sandbox vs live) is determined by the selected credential; there is no per-item test flag. Without user_id, creation returns a hosted enrollment action and Kernel polls until the user connects. With a customer-owned provider_config, user_id imports an existing connection after verifying access with the selected credentials in their sandbox or live mode; no hosted enrollment is needed, even if the connected user has no stored cards. With Kernel-managed credentials, user_id may only reference a user already enrolled by a wallet in this organization under the same configuration. The user and configuration bindings cannot be changed after creation. Import validation is read-only and runs before creation: a failed validation leaves no wallet or reserved key, so the user_id can be corrected and retried. Concurrent imports of the same key may both validate, but create at most one wallet and connected event.
8585
"""
8686

8787
provider: Literal["agentcard"]

0 commit comments

Comments
 (0)