vercel-labs / vercel-labs/native

Expose secure credentials through Zig UiApp effects

Open
#272 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Zig
Stars
7.7k
Forks
314
Avg merge
5h
Merged PRs (30d)
13

Description

Problem

Native SDK already exposes platform credential stores through PlatformServices and runtime methods, but a Zig UiApp.update has no typed effects-channel API. Native-only apps therefore need an app-specific bridge or must smuggle a runtime handle into update.

Proposed API

Add Zig-only effects:

  • fx.setCredential
  • fx.getCredential
  • fx.deleteCredential

Every request keeps an explicit caller key plus the platform credential key:

.{
    .key = credential_fx_key,
    .service = "com.example.notes.openai",
    .account = "default",
    .on_result = Effects.credentialMsg(.credential_result),
}

Set additionally accepts secret. Results carry operation, outcome, an ephemeral secret only for a successful get, and dropped-terminal accounting. Outcomes are ok, not_found, failed, rejected, recording_unsupported, and cancelled.

The effects use the existing shared keyed slots, platform credential callbacks, validation limits, fake executor, and session replay machinery. Set inputs are copied and securely wiped after the synchronous platform call; successful get buffers are wiped before release.

Session recording boundary

Credential reads are rejected with recording_unsupported before the OS credential store is touched while session recording is active. Set/delete remain available, but journal records contain only operation/outcome metadata and never secret bytes. Replay feeds the recorded metadata terminal and never consults a live credential store.

This only protects the credential-effect result boundary. It does not claim to redact secrets independently placed in ordinary UI input events or other application data.

Scope

  • Zig UiApp effects only.
  • No TypeScript Cmd or bytecode API.
  • No credentialStatus operation.
  • No new platform backend: Keychain, Secret Service/libsecret, Credential Manager, and the null platform already implement the needed service callbacks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Zig UiApp.update effects channel and trace the existing shared keyed slots, platform credential callbacks, fake executor, and session replay machinery. Verify how credential requests and terminal results are represented, then confirm that recording rejects reads, metadata excludes secret bytes, and successful gets are wiped before release.

Written by the indexing model from the issue text.

Assessment

Tech stack
zig
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.