Skip to content

Commit 84a69ad

Browse files
feat: Add passkey credential fields and PATCH field add/remove
Stainless-Generated-From: 8a555252c3a00ef277f917b1e70b8f3026866e77
1 parent de4fc58 commit 84a69ad

15 files changed

Lines changed: 181 additions & 65 deletions

‎api.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ from kernel.types.vaults import (
576576
CredentialAccountVaultItemRequest,
577577
CredentialCollectionAction,
578578
CredentialVaultFieldDefinition,
579+
CredentialVaultFieldDefinitionInput,
579580
CredentialVaultFieldInput,
580581
CredentialVaultFieldState,
581582
CredentialVaultFieldType,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
from .authorize_vault_item_operation_request_param import (
9393
AuthorizeVaultItemOperationRequestParam as AuthorizeVaultItemOperationRequestParam,
9494
)
95+
from .credential_vault_field_definition_input_param import (
96+
CredentialVaultFieldDefinitionInputParam as CredentialVaultFieldDefinitionInputParam,
97+
)
9598
from .kernel_credential_vault_item_spec_input_param import (
9699
KernelCredentialVaultItemSpecInputParam as KernelCredentialVaultItemSpecInputParam,
97100
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CollectVaultItemOperationRequestParam(TypedDict, total=False):
1212
1313
Supported for ready
1414
and pending_collection credential items. Always render the same form from
15-
every form-supported field; totp fields have no form input and are omitted.
15+
every form-supported field; totp and passkey fields have no form input and are omitted.
1616
No caller-selected field subsets or form overrides are accepted.
1717
Reuse an active Kernel-hosted session or renew an expired session atomically.
1818
Customer-hosted forms use their own backend and ordinary item GET/PATCH. Opening

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
class CredentialCollectionAction(BaseModel):
1212
"""
1313
One schema-derived form for the item, available in ready or pending_collection
14-
state. Render every form-supported field as editable; omit totp fields and
15-
preserve their stored seeds. Prefill non-sensitive values,
14+
state. Render every form-supported field as editable; omit totp and passkey
15+
fields and preserve their stored values. Prefill non-sensitive values,
1616
and allow existing sensitive values to be preserved or replaced without ever
1717
revealing them. No field subsets or per-request form configuration exist.
1818
Validate required fields against the resulting values, including preserved
1919
secrets. Submit changed values only, using the version used to render the form.
20-
Scoped hosted submission rejects totp edits; seed writes require the ordinary
21-
authenticated item API. Customer forms likewise omit totp from their payloads.
20+
Scoped hosted submission rejects totp and passkey edits; those writes require the ordinary
21+
authenticated item API. Customer forms likewise omit them from their payloads.
2222
Save edits atomically. A successful hosted submission increments the version,
2323
marks ready, and consumes the session; an empty edit may complete collection
2424
while preserving values. A customer form uses PATCH for changed values and

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ class CredentialVaultFieldDefinition(BaseModel):
2525

2626
type: CredentialVaultFieldType
2727
"""
28-
Text, email, and password have form inputs; totp does not and is omitted from
29-
both Kernel-hosted and customer React forms. Password and totp must be
30-
sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
31-
optional trailing padding), not an otpauth URI or current code. Reject invalid
32-
or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
33-
time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
34-
never fill the seed. Custom algorithms, digits, periods, and form enrollment are
35-
unsupported.
28+
Text, email, and password have form inputs; totp and passkey do not and are
29+
omitted from both Kernel-hosted and customer React forms. Password, totp, and
30+
passkey must be sensitive. A totp value is an RFC 4648 Base32 generator seed
31+
(case-insensitive, optional trailing padding), not an otpauth URI or current
32+
code. Reject invalid or empty decoded seeds. Browser fill generates an RFC 6238
33+
code at execution time using HMAC-SHA1, 6 digits, and a 30-second period.
34+
Preserve leading zeros; never fill the seed. Custom algorithms, digits, periods,
35+
and form enrollment are unsupported. A passkey value is a JSON-encoded FIDO
36+
Credential Exchange Format passkey object with unpadded base64url
37+
`credentialId`, `userHandle` (at most 64 bytes), and `key` (a PKCS#8 ECDSA P-256
38+
private key), a lowercase `rpId` domain, and optional `username` and
39+
`userDisplayName`. Other CXF members are ignored. Passkeys are never filled into
40+
pages.
3641
"""
3742

3843
label: Optional[str] = None
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
from .credential_vault_field_type import CredentialVaultFieldType
8+
9+
__all__ = ["CredentialVaultFieldDefinitionInputParam"]
10+
11+
12+
class CredentialVaultFieldDefinitionInputParam(TypedDict, total=False):
13+
"""A field definition without a value.
14+
15+
Field updates add fields with this shape and set their values in `fields`.
16+
"""
17+
18+
name: Required[str]
19+
"""Unique stable field name used to key values, updates, and browser fills."""
20+
21+
type: Required[CredentialVaultFieldType]
22+
"""
23+
Text, email, and password have form inputs; totp and passkey do not and are
24+
omitted from both Kernel-hosted and customer React forms. Password, totp, and
25+
passkey must be sensitive. A totp value is an RFC 4648 Base32 generator seed
26+
(case-insensitive, optional trailing padding), not an otpauth URI or current
27+
code. Reject invalid or empty decoded seeds. Browser fill generates an RFC 6238
28+
code at execution time using HMAC-SHA1, 6 digits, and a 30-second period.
29+
Preserve leading zeros; never fill the seed. Custom algorithms, digits, periods,
30+
and form enrollment are unsupported. A passkey value is a JSON-encoded FIDO
31+
Credential Exchange Format passkey object with unpadded base64url
32+
`credentialId`, `userHandle` (at most 64 bytes), and `key` (a PKCS#8 ECDSA P-256
33+
private key), a lowercase `rpId` domain, and optional `username` and
34+
`userDisplayName`. Other CXF members are ignored. Passkeys are never filled into
35+
pages.
36+
"""
37+
38+
label: str
39+
"""Optional human-readable display label.
40+
41+
It is returned as non-secret metadata and never affects value keys, updates, or
42+
browser fills. Use single-line, trimmed display text without control or
43+
formatting characters. The server enforces a 128-byte UTF-8 limit.
44+
"""
45+
46+
required: bool
47+
48+
sensitive: bool
49+
"""
50+
Set false explicitly for ordinary usernames, email addresses, and other
51+
non-secret identifiers. Reserve true for secrets such as passwords, API tokens,
52+
and TOTP seeds. Password, totp, and passkey fields must be true. Omission
53+
defaults to true for safety; do not rely on that default for every field. False
54+
permits API reads and form prefilling.
55+
"""

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

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@ class CredentialVaultFieldInputParam(TypedDict, total=False):
1515

1616
type: Required[CredentialVaultFieldType]
1717
"""
18-
Text, email, and password have form inputs; totp does not and is omitted from
19-
both Kernel-hosted and customer React forms. Password and totp must be
20-
sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
21-
optional trailing padding), not an otpauth URI or current code. Reject invalid
22-
or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
23-
time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
24-
never fill the seed. Custom algorithms, digits, periods, and form enrollment are
25-
unsupported.
18+
Text, email, and password have form inputs; totp and passkey do not and are
19+
omitted from both Kernel-hosted and customer React forms. Password, totp, and
20+
passkey must be sensitive. A totp value is an RFC 4648 Base32 generator seed
21+
(case-insensitive, optional trailing padding), not an otpauth URI or current
22+
code. Reject invalid or empty decoded seeds. Browser fill generates an RFC 6238
23+
code at execution time using HMAC-SHA1, 6 digits, and a 30-second period.
24+
Preserve leading zeros; never fill the seed. Custom algorithms, digits, periods,
25+
and form enrollment are unsupported. A passkey value is a JSON-encoded FIDO
26+
Credential Exchange Format passkey object with unpadded base64url
27+
`credentialId`, `userHandle` (at most 64 bytes), and `key` (a PKCS#8 ECDSA P-256
28+
private key), a lowercase `rpId` domain, and optional `username` and
29+
`userDisplayName`. Other CXF members are ignored. Passkeys are never filled into
30+
pages.
2631
"""
2732

2833
encrypted_value: str
@@ -55,9 +60,9 @@ class CredentialVaultFieldInputParam(TypedDict, total=False):
5560
"""
5661
Set false explicitly for ordinary usernames, email addresses, and other
5762
non-secret identifiers. Reserve true for secrets such as passwords, API tokens,
58-
and TOTP seeds. Password and totp fields must be true. Omission defaults to true
59-
for safety; do not rely on that default for every field. False permits API reads
60-
and form prefilling.
63+
and TOTP seeds. Password, totp, and passkey fields must be true. Omission
64+
defaults to true for safety; do not rely on that default for every field. False
65+
permits API reads and form prefilling.
6166
"""
6267

6368
value: str

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["CredentialVaultFieldType"]
66

7-
CredentialVaultFieldType: TypeAlias = Literal["text", "email", "password", "totp"]
7+
CredentialVaultFieldType: TypeAlias = Literal["text", "email", "password", "totp", "passkey"]

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class CredentialVaultFieldUpdateParam(TypedDict, total=False):
3636
immediately clear the stored value. Clearing a required form-supported field
3737
reopens collection; clearing an optional field does not prevent readiness.
3838
Values must satisfy the declared field type. For totp, value is the generator
39-
seed, never a current code. Clearing a required totp field returns 400 because
40-
it cannot be collected in a form.
39+
seed, never a current code. For passkey, value is the JSON-encoded CXF passkey
40+
object. Clearing a required totp or passkey field returns 400 because it cannot
41+
be collected in a form.
4142
"""

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

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,29 @@ class CredentialVaultItem(BaseModel):
116116
action: Optional[Action] = None
117117
"""
118118
One schema-derived form for the item, available in ready or pending_collection
119-
state. Render every form-supported field as editable; omit totp fields and
120-
preserve their stored seeds. Prefill non-sensitive values, and allow existing
121-
sensitive values to be preserved or replaced without ever revealing them. No
122-
field subsets or per-request form configuration exist. Validate required fields
123-
against the resulting values, including preserved secrets. Submit changed values
124-
only, using the version used to render the form. Scoped hosted submission
125-
rejects totp edits; seed writes require the ordinary authenticated item API.
126-
Customer forms likewise omit totp from their payloads. Save edits atomically. A
127-
successful hosted submission increments the version, marks ready, and consumes
128-
the session; an empty edit may complete collection while preserving values. A
129-
customer form uses PATCH for changed values and does not send an empty PATCH
130-
when nothing changed. Kernel-hosted bearer sessions require no Kernel account
131-
and are bound to the item version. Expired, superseded, consumed, or
132-
deleted-item sessions cannot submit. Authenticated item GET renews expired
133-
active sessions for ready or pending items; pending items always receive an
134-
action. A ready item with no active session omits the action until collect is
135-
invoked. Concurrent renewals return the same link. Renewal changes neither
136-
values nor item version. An expired link cannot renew itself. The hosted form
137-
handles its collection protocol; callers only open the returned URL and do not
138-
extract or submit its token through the public API. For customer-hosted forms,
139-
use @onkernel/vault-react and an authenticated customer backend calling the
140-
ordinary item GET/PATCH API. Kernel does not store customer collection URLs or
141-
authenticate the customer's end users. Treat URLs and submitted values as
142-
secrets and exclude them from logs, traces, and errors.
119+
state. Render every form-supported field as editable; omit totp and passkey
120+
fields and preserve their stored values. Prefill non-sensitive values, and allow
121+
existing sensitive values to be preserved or replaced without ever revealing
122+
them. No field subsets or per-request form configuration exist. Validate
123+
required fields against the resulting values, including preserved secrets.
124+
Submit changed values only, using the version used to render the form. Scoped
125+
hosted submission rejects totp and passkey edits; those writes require the
126+
ordinary authenticated item API. Customer forms likewise omit them from their
127+
payloads. Save edits atomically. A successful hosted submission increments the
128+
version, marks ready, and consumes the session; an empty edit may complete
129+
collection while preserving values. A customer form uses PATCH for changed
130+
values and does not send an empty PATCH when nothing changed. Kernel-hosted
131+
bearer sessions require no Kernel account and are bound to the item version.
132+
Expired, superseded, consumed, or deleted-item sessions cannot submit.
133+
Authenticated item GET renews expired active sessions for ready or pending
134+
items; pending items always receive an action. A ready item with no active
135+
session omits the action until collect is invoked. Concurrent renewals return
136+
the same link. Renewal changes neither values nor item version. An expired link
137+
cannot renew itself. The hosted form handles its collection protocol; callers
138+
only open the returned URL and do not extract or submit its token through the
139+
public API. For customer-hosted forms, use @onkernel/vault-react and an
140+
authenticated customer backend calling the ordinary item GET/PATCH API. Kernel
141+
does not store customer collection URLs or authenticate the customer's end
142+
users. Treat URLs and submitted values as secrets and exclude them from logs,
143+
traces, and errors.
143144
"""

0 commit comments

Comments
 (0)