Repository navigation
Conversation
The provider-keys screens now take a scope: the caller's own keys, or one organization's. An organization's keys are readable by every member and writable by a billing role, which is the rule every byok procedure applies. The org hub's BYOK row opens that screen with the organization's scope. Azure, AWS Bedrock and Google Vertex get native forms for their credential fields, validated by the same schemas the web BYOK form uses (moved into app-shared and re-exported at the old path). The provider picker no longer sends structured providers to the web, and the dead Manage-on-web row, its copy, and the unused provider predicate are gone. A key row can now replace its value, which is the only edit the server allows: the stored credential is never returned, so the form re-collects it.
|
bot: Android proof on a local stack with a fake owner and member organization: personal and organization keys added, edited, and deleted; the member sees a read-only list; Azure, Bedrock, and Vertex forms submitted to the server; secret inputs masked with no keyboard suggestion strip. Design gate contact sheets attached (0 errors, 0 warnings). |
| provider_id: provider.id, | ||
| api_key: credential.apiKey, | ||
| }) | ||
| : update.mutateAsync({ ...scopeInput, id: keyId, api_key: credential.apiKey })); |
There was a problem hiding this comment.
[WARNING]: Replacing an Azure key silently deletes its model mappings
byok.update overwrites the whole stored credential (encrypted_api_key_envelope in byok-router.ts), and this path sends only what the form collected. The edit form starts with an empty mappingsRef because the server never returns the stored credential, so rotating an Azure key without retyping every deployment mapping stores { apiKey, resourceName } and drops modelMappings. The list still shows the key, but requests for the mapped gateway models stop resolving. Warn in editKeyDescription that mappings must be re-entered (or leave them out of the replacement) for Azure.
| }); | ||
| }; | ||
|
|
||
| const permissionDenied = scope.kind === 'organization' && !isResolving && !permissions.canView; |
There was a problem hiding this comment.
[WARNING]: An organization-list failure is reported as a missing membership, with no retry
canView is just role !== undefined, while useOrgBoundary derives isResolving only from isLoaded/isLoading. If organizations.list errors (or is stale and has not yet learned a new membership), role stays undefined after resolution, so this branch renders a terminal variant='permission' state with no retry. It is also evaluated before keys.isError/keys.data, so successfully loaded keys are discarded. OrganizationBoundary treats isError as retryable and integrations-screen.tsx splits the two causes; this should do the same. The check in provider-key-new-screen.tsx:104 turns a billing role into a permission refusal under the same conditions.
| {...CREDENTIAL_INPUT_PROPS} | ||
| secureTextEntry={field.secret} | ||
| multiline={field.multiline} | ||
| showSoftInputOnFocus={!field.multiline} |
There was a problem hiding this comment.
[WARNING] — security (users): showSoftInputOnFocus is Android-only, so the Vertex private key raises a keyboard on iOS
React Native documents showSoftInputOnFocus as an Android-only TextInput prop; iOS ignores it. Focusing this multiline privateKey field therefore opens the software keyboard on iOS, and iOS does not mask a multiline secureTextEntry either (as credential-input-props.ts notes). The PEM is displayed in clear and editable through the IME on iOS, which contradicts the 'no keyboard ever sees or learns its value' rationale for making the field paste-only. Use a masked multiline input on iOS, or document the iOS limitation instead of relying on the prop.
| return; | ||
| } | ||
| if (credential.tag !== 'ready') { | ||
| attempt.fail({ kind: 'refused', message: t('profile.providerKeys.apiKeyRequired') }); |
There was a problem hiding this comment.
[SUGGESTION]: A refused structured credential reports 'Enter the key.'
readCredential() returns { tag: 'refused' } when credentialProblem rejects the assembled shape, but this branch shows apiKeyRequired ('Enter the key.') and sets no field error. The reachable case is Azure: filling only one side of a mapping row makes credentialProblem return invalid-model-mapping (credential-fields.test.ts covers it), yet the API key is filled and the reader is told to enter the key. Surface the problem code, or use invalidCredentials for refused as the missing-field branch already does.
| const apiKey = keyRef.current.trim(); | ||
| return apiKey === '' ? { tag: 'missing', field: 'apiKey' } : { tag: 'ready', apiKey }; | ||
| } | ||
| const missing = firstMissingField(form, valuesRef.current); |
There was a problem hiding this comment.
[SUGGESTION]: Switching Bedrock's authentication method leaves stale values the form no longer shows
valuesRef is shared across both Bedrock forms and is not cleared when authMode changes, while the remounted fields start empty (uncontrolled inputs). Type an API key, switch to access keys and back: the API key field is blank but firstMissingField still sees the old entry, so Save succeeds with a credential the reader cannot see. Clear the draft entries for fields the next form does not render when the mode changes.
|
|
||
| export default function ProviderKeyAddRoute() { | ||
| return <ProviderKeyProviderPickerScreen />; | ||
| const { org } = useLocalSearchParams<{ org?: string }>(); |
There was a problem hiding this comment.
[SUGGESTION]: Normalize the org query param
Every other ?org= route uses normalizeOrgQueryParam (integrations.tsx, organization/usage.tsx, organization/credit-activity.tsx) and types the param string | string[]. Here a repeated ?org= arrives as an array, is treated as a truthy organization id, and then fails the router's z.string().uuid() instead of selecting the first value. provider-keys.tsx:6 has the same gap.
| disabled={pending} | ||
| error={fieldErrors.apiKey} | ||
| onChangeText={value => { | ||
| keyRef.current = value; |
There was a problem hiding this comment.
[SUGGESTION]: A stale save failure stays on screen while the reader corrects the value
The previous form cleared its submit error on every keystroke; now save.failure (a server refusal or a required-field message) and fieldErrors are only retired at the next submit. useSurfaceFeedback exposes clearWhere for this. Retire the failure once the reader edits the credential so the refusal is not shown beside a value that has already changed. The structured form's onChangeText in provider-key-credential-form.tsx has the same gap.
Code Review SummaryStatus: 7 Issues Found | Recommendation: Address before merge Executive SummaryThe highest-risk issues are silent loss of an existing Azure key's model mappings when its credential is replaced, and organization-list failures being shown as a non-retryable "not a member" state, followed by the Vertex private key unexpectedly raising a keyboard on iOS. Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (23 code files + 87 locale catalogs)
Fix these issues in Kilo Cloud Reviewed by deepseek-flash-latest · Input: 171.2K · Output: 47.1K · Cached: 6M Review guidance: REVIEW.md from base branch |







What
Provider keys (BYOK) no longer hand off to the web: the account screens cover personal and organization scopes natively, and the Azure, Bedrock, and Vertex credentials get native forms.
provider-keys,provider-key-add, andprovider-key-newtake?org=. Any organization member can read its keys; only an owner, admin, or billing manager can add, replace, enable or disable, test, or delete them, the same rulebyok-routerapplies. A member who opens the form gets the permission state, not an input the server would refuse. The org hub's BYOK row moves to the in-app rows with the same role gate.@kilocode/app-shared/byok-credentialsowns the Azure, Bedrock (API key or access-key pair), and Vertex schemas and the one validation both apps run;web-sharedre-exports them so every web import path is unchanged, and the web manager runs the shared check. The native form collects the same fields and stores the same JSON. The "Manage on web" row, its copy, and the URL helpers are removed.Why
Web hand-offs interrupt the user, and the web pages show navigation that leads to billing pages.
Verification
app-sharedcredential tests: pass.Production prerequisites
None.