mirror of
https://github.com/bitwarden/server.git
synced 2026-02-04 02:05:30 -06:00
Direct Claude to read specific docs instead of duplicate or boilerplating
This commit is contained in:
parent
ce1756a7bb
commit
6e7d5b0b87
@ -1,42 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
DbSeederUtility is the CLI wrapper for the Seeder library. It exposes seed-recipes as command-line commands using CommandDotNet.
|
|
||||||
|
|
||||||
**For Seeder library patterns (Factories, Recipes, Models, etc.), read `/util/Seeder/CLAUDE.md`.**
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build
|
|
||||||
dotnet build util/DbSeederUtility/DbSeederUtility.csproj
|
|
||||||
|
|
||||||
# Run (from repo root)
|
|
||||||
dotnet run --project util/DbSeederUtility -- <command> [options]
|
|
||||||
|
|
||||||
# Get help
|
|
||||||
dotnet run --project util/DbSeederUtility -- --help
|
|
||||||
dotnet run --project util/DbSeederUtility -- vault-organization --help
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
| File | Purpose |
|
|
||||||
|------|---------|
|
|
||||||
| `Program.cs` | CommandDotNet entry point. Each `[Command]` method maps to a Recipe |
|
|
||||||
| `*Args.cs` | CLI argument models implementing `IArgumentModel`. Validate input and convert to `*Options` |
|
|
||||||
| `ServiceCollectionExtension.cs` | DI setup for database context, AutoMapper, password hasher |
|
|
||||||
|
|
||||||
## Adding a New Command
|
|
||||||
|
|
||||||
1. Create `{CommandName}Args.cs` with CLI options using `[Option]` attributes
|
|
||||||
2. Add `Validate()` method for input validation
|
|
||||||
3. Add `ToOptions()` method to convert to Seeder library options type
|
|
||||||
4. Add `[Command]` method in `Program.cs` that instantiates the Recipe and calls `Seed()`
|
|
||||||
|
|
||||||
## CLI Examples
|
|
||||||
|
|
||||||
See `README.md` for full usage examples. Default login: `owner@{domain}` with password `asdfasdfasdf`.
|
|
||||||
@ -1,11 +1,11 @@
|
|||||||
# CLAUDE.md
|
# Bitwarden Seeder Library - Claude Code Configuration
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Quick Reference
|
## Quick Reference
|
||||||
|
|
||||||
**For detailed pattern descriptions (Factories, Recipes, Models, Scenes, Queries, Data), read `README.md`.**
|
**For detailed pattern descriptions (Factories, Recipes, Models, Scenes, Queries, Data), read `README.md`.**
|
||||||
|
|
||||||
|
**For detailed usages of the Seeder library, read `util/DbSeederUtility/README.md` and `util/SeederApi/README.md`**
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -47,6 +47,7 @@ Recipes follow strict rules:
|
|||||||
**Critical:** Unencrypted vault data never leaves the client. The server never sees plaintext.
|
**Critical:** Unencrypted vault data never leaves the client. The server never sees plaintext.
|
||||||
|
|
||||||
The Seeder uses the Rust SDK via FFI because it must behave like a real Bitwarden client:
|
The Seeder uses the Rust SDK via FFI because it must behave like a real Bitwarden client:
|
||||||
|
|
||||||
1. Generate encryption keys (like client account setup)
|
1. Generate encryption keys (like client account setup)
|
||||||
2. Encrypt vault data client-side (same SDK as real clients)
|
2. Encrypt vault data client-side (same SDK as real clients)
|
||||||
3. Store only encrypted result
|
3. Store only encrypted result
|
||||||
@ -62,7 +63,7 @@ Shared logic: `CipherEncryption.cs`, `EncryptedCipherDtoExtensions.cs`
|
|||||||
## Rust SDK Version Alignment
|
## Rust SDK Version Alignment
|
||||||
|
|
||||||
| Component | Version Source |
|
| Component | Version Source |
|
||||||
|-------------|-------------------------------------------|
|
| ----------- | ----------------------------------------- |
|
||||||
| Server Shim | `util/RustSdk/rust/Cargo.toml` git rev |
|
| Server Shim | `util/RustSdk/rust/Cargo.toml` git rev |
|
||||||
| Clients | `@bitwarden/sdk-internal` in clients repo |
|
| Clients | `@bitwarden/sdk-internal` in clients repo |
|
||||||
|
|
||||||
@ -71,6 +72,7 @@ Before modifying SDK integration, run `RustSdkCipherTests` to validate roundtrip
|
|||||||
## Deterministic Data Generation
|
## Deterministic Data Generation
|
||||||
|
|
||||||
Same domain = same seed = reproducible data:
|
Same domain = same seed = reproducible data:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
_seed = options.Seed ?? StableHash.ToInt32(options.Domain);
|
_seed = options.Seed ?? StableHash.ToInt32(options.Domain);
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user