Skip to content

Latest commit

 

History

History
250 lines (186 loc) · 14.9 KB

File metadata and controls

250 lines (186 loc) · 14.9 KB

nullvariant-vscode-extensions

CI Security Platform SLSA 3 Sigstore SBOM OpenSSF Scorecard OpenSSF Best Practices Harden-Runner Snyk monitored Socket.dev GitGuardian Renovate FOSSA License FOSSA Security codecov Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%)

VS Code extensions by Null;Variant.

Extensions

Git ID Switcher

Git ID Switcher Switch between multiple Git identities with one click. Manage multiple GitHub accounts, SSH keys, GPG signing, and automatically apply identity to Git Submodules.

Open VSX Registry License: MIT Karesansui Architecture
26 Languages 🇺🇸 🇯🇵 🇨🇳 🇹🇼 🇰🇷 🇩🇪 🇫🇷 🇪🇸 🇧🇷 🇮🇹 🇷🇺 🇵🇱 🇹🇷 🇨🇿 🇭🇺 🇧🇬 🇺🇦 🌍 🌺 🐻 🐉 🖖 🐱 🏴‍☠️ 🎭

📖 Documentation | 🏗 Architecture | 🛡 Threat Model | 🌐 Languages | 🤝 Contributing | 📦 Marketplace | 📦 Open VSX

Git ID Switcher Demo

Quick Start for Developers

Get started in 5 steps:

# 1. Clone
git clone https://github.com/nullvariant/nullvariant-vscode-extensions.git
cd nullvariant-vscode-extensions

# 2. Install dependencies (from repository root)
npm install

# 3. Compile
npm run compile:all

# 4. Run tests
npm run test:all

# 5. Start watch mode for development
npm run watch:all

For linting: npm run lint:all

Extension Initialization Flow

flowchart TD
    A[Extension Activated] --> B{Workspace Trusted?}
    B -->|No| C[Restricted Mode]
    B -->|Yes| D[initializeState]
    D --> E{Saved Identity?}
    E -->|Yes| I[Apply Identity]
    E -->|No| F{Detect from Git Config?}
    F -->|Yes| I
    F -->|No| G{Detect from SSH Agent?}
    G -->|Yes| I
    G -->|No| H[No Identity]
    I --> J[Update Status Bar]
    H --> J
    J --> K[Ready]
Loading

Development

Prerequisites

  • Node.js 20+

Working on an extension

cd extensions/git-id-switcher

# Install dependencies
npm install

# Compile
npm run compile

# Watch mode
npm run watch

# Package as VSIX
npm run package

Testing locally

Manual Testing

  1. Open the extension folder in VS Code
  2. Press F5 to launch Extension Development Host
  3. Test the extension in the new window

Unit Tests

cd extensions/git-id-switcher
npm run test

E2E Tests

E2E tests run in an actual VS Code environment using @vscode/test-electron:

cd extensions/git-id-switcher
npm run test:e2e

Note: On first run, VS Code will be downloaded automatically (~100MB). Subsequent runs use the cached version.

Git Hooks Setup

This repository uses custom git hooks for release safety. After cloning, run:

git config core.hooksPath .githooks

This enables the pre-push hook that prevents pushing version bumps without release tags.

Repository Structure

nullvariant-vscode-extensions/
├── extensions/
│   └── git-id-switcher/
├── .github/workflows/
│   ├── ci.yml
│   └── publish.yml
├── .githooks/
│   └── pre-push
├── LICENSE
└── README.md

Publishing (Maintainers Only)

Note: The main branch is protected. All changes must go through a Pull Request.

Extensions are automatically published when a release tag is pushed:

  1. Ensure all changes are merged to main via Pull Request
  2. Create and push a release tag from the latest main:
git checkout main
git pull origin main
git tag git-id-switcher-v1.0.0
git push origin git-id-switcher-v1.0.0

The publish workflow will automatically build and publish the extension to VS Code Marketplace and Open VSX.

Supply Chain Security

Every release includes cryptographic verification artifacts:

Artifact Description
*.vsix The extension package
*.vsix.intoto.jsonl SLSA Level 3 build provenance
*.vsix.bundle Cosign keyless signature (Sigstore)
sbom-cyclonedx.json CycloneDX SBOM with attestation

Verify VSIX signature (Cosign)

# Download the VSIX and its .bundle from the GitHub Release, then:
cosign verify-blob git-id-switcher-<version>.vsix \
  --bundle git-id-switcher-<version>.vsix.bundle \
  --certificate-identity-regexp="https://github.com/nullvariant/nullvariant-vscode-extensions/" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com"

Verify SLSA provenance (GitHub CLI)

gh attestation verify git-id-switcher-<version>.vsix \
  --repo nullvariant/nullvariant-vscode-extensions

Verify SBOM attestation (GitHub CLI)

gh attestation verify git-id-switcher-<version>.vsix \
  --repo nullvariant/nullvariant-vscode-extensions \
  --predicate-type https://cyclonedx.org/bom

Extension Fingerprint

Use this information to verify you have the authentic Git ID Switcher extension:

Field Value
Publisher nullvariant
Extension ID nullvariant.git-id-switcher
Repository https://github.com/nullvariant/nullvariant-vscode-extensions
Marketplace https://marketplace.visualstudio.com/items?itemName=nullvariant.git-id-switcher
Open VSX https://open-vsx.org/extension/nullvariant/git-id-switcher

If you find an extension with a similar name from a different publisher, please report it (see SECURITY.md).

See Also

License

MIT