BlockMate Snippets
Advanced code snippets management with smart organization, tagging, and security features for Visual Studio Code.
🚀 Quick Start Guide
📋 Essential Commands:
Ctrl+Shift+S - Save selected code as snippet
Ctrl+Shift+M - Open modern snippet management interface
Ctrl+Shift+Q - Quick snippet creation with folder selection
Ctrl+Shift+I - Insert existing snippets
🎯 Key Features:
- 📁 Smart Folder Organization - Automatic categorization by file type
- 🔍 Real-time Search - Instant search across all snippets
- 🏷️ Tag System - Organize snippets with custom tags
- 🛡️ AES-256 Encryption - Enterprise-grade security
- 📊 Modern UI - Beautiful dark/light theme with smooth animations
- 📈 Usage Analytics - Track snippet usage with detailed statistics
- 🔗 Share Links - Create shareable links for snippets
💡 Pro Tips:
- Auto-Assignment: Snippets automatically assigned to appropriate folders
- Modern Interface: Glassmorphism design with hover effects
- Performance: Optimized for large snippet collections
- Security: Built-in encryption and audit logging
🛡️ SECURITY NOTICE
IMPORTANT: This extension contains advanced security testing and monitoring features. Please read this section carefully before use.
🚨 CRITICAL SECURITY NOTICE:
This extension provides advanced security features including:
✅ AES-256 Encryption - Enterprise-grade security for your snippets
✅ PIN Protection - Secure access control
✅ Audit Logging - Comprehensive security event tracking and monitoring
✅ Rate Limiting - Prevent abuse and ensure system stability
✅ CSP Testing - Content Security Policy testing and validation
✅ JWT Authentication - Token-based authentication with session management
✅ Security Headers Testing - Advanced security headers analysis
🎯 LEVEL-BASED SECURITY SYSTEM:
This extension uses a sophisticated level-based security system:
- 🟢 Level 1 (Basic): Core snippet management features
- 🟡 Level 2 (Advanced): Security features like audit logging, rate limiting, CSP testing (requires 20 snippets + 7 days usage)
⚠️ USER RESPONSIBILITY:
By using this extension, you acknowledge that:
- You will only use security features for legitimate testing purposes
- You are responsible for all your actions and their consequences
- You will protect your encryption keys, PIN, and authentication tokens
- You will use security testing features only on systems you own or have explicit permission to test
- You will comply with all applicable laws and regulations
- You will not use these features for malicious purposes or unauthorized access
🛡️ Security Notice
- Data Protection: Ensure your snippets, encryption keys, and security logs are stored securely
- Professional Use: Recommended for developers, security professionals, and authorized testers
- Compliance: Ensure usage complies with your organization's security policies and applicable regulations
- Testing Environment: Use security testing features in controlled, authorized environments only
📋 ACCEPTABLE USE CASES:
✅ Authorized Security Testing - Testing your own systems or systems you have permission to test
✅ Educational Security Research - Learning about security concepts and practices
✅ Development Security Assessment - Assessing security of your own applications
✅ Compliance Testing - Testing for regulatory compliance requirements
✅ Security Training - Educational purposes in controlled environments
❌ Unauthorized System Access - Testing systems without permission
❌ Malicious Attacks - Using features for harmful purposes
❌ Illegal Activities - Any use that violates laws or regulations
❌ Unauthorized Penetration Testing - Testing systems you don't own or have permission to test
📜 TERMS OF USE:
- Legal and authorized use only
- Protect your data and credentials
- Use security features responsibly and ethically
- Test only systems you own or have permission to test
- Comply with all applicable laws and regulations
- Accept full legal responsibility for your actions
By using this extension, you acknowledge that you have read, understood, and agree to these terms. Misuse may result in legal consequences.
🚀 Features
✨ Smart Snippet Management
- Easy Creation: Select code and save as snippet with
Ctrl+Shift+S
- Smart Organization: Tag and categorize snippets for easy discovery
- File Type Support: Specify which file types each snippet works with
- Usage Tracking: Monitor how often snippets are used with detailed analytics
- Favorites System: Mark and organize your most-used snippets
- 🔍 Automatic Folder Assignment: Snippets automatically assigned to appropriate folders based on file type
🔍 Advanced Search & Filtering
- Real-time Search: Search snippets by name, prefix, or description
- Dynamic Tag Filtering: Filter by tags with auto-populated dropdown
- File Type Filtering: Show only snippets for specific file types
- Favorites Tab: Dedicated view for your favorite snippets
- Combined Filters: Use multiple filters simultaneously
🛡️ Security Features
- AES-256 Encryption: Enterprise-grade encryption for all snippet data
- XSS Protection: HTML escaping prevents malicious code injection
- Path Traversal Protection: Secure file path validation
- Input Validation: Length limits and dangerous pattern detection
- Content Security Policy: CSP headers for webview protection
- Rate Limiting: Prevents abuse of extension features with configurable limits
- Secure Key Management: Automatic encryption key generation and storage
- 🔍 Audit Logging: Comprehensive security event tracking and monitoring
- 🔐 JWT Authentication System: Local token-based authentication with session management
- 🔄 Encryption Key Rotation: Automatic encryption key rotation for enhanced security
- 📊 Audit Trail System: Comprehensive logging of all security events and user actions
- 🛡️ Security Headers Optimization: Advanced security headers management for webviews
🔐 Level-Based Security System
BlockMate Snippets uses a sophisticated level-based security system to gradually unlock advanced features:
- Core Snippet Management: Create, edit, delete, and organize snippets
- Folder Management: Create and manage snippet folders
- Basic Encryption: AES-256 encryption for snippet data
- PIN Protection: Optional PIN-based access control
- Snippet Sharing: Create and manage share links
- Usage Analytics: Track snippet usage with detailed statistics
🟡 Level 2 (Advanced) - Requires 20 Snippets + 7 Days Usage
- Audit Logging: Comprehensive security event tracking
- Rate Limiting: Advanced rate limiting and abuse prevention
- CSP Testing: Content Security Policy testing tools
- JWT Authentication: Token-based authentication system
- Advanced Encryption: Enhanced encryption features
- Security Headers Testing: Advanced security headers analysis
🎯 How to Upgrade Levels
- Start with Level 1: All basic features are available immediately
- Create Snippets: Each snippet brings you closer to Level 2
- Use the Extension: Regular usage builds your experience
- Check Progress: Use "BlockMate: Upgrade Level" command to see requirements
- Upgrade Automatically: Meet requirements to unlock advanced features
📊 Modern Management Interface
- Dark/Light Theme UI: Modern, eye-friendly interface with theme switching
- Real-time Statistics: Live usage and storage statistics with detailed analytics
- Export/Import: Backup and share your snippet collections
- Responsive Design: Works on all screen sizes
- Hover Effects: Interactive UI elements with smooth animations
- ✏️ Edit & Delete Actions: Inline edit and delete buttons for each snippet
- 🔄 Real-time Updates: Instant UI updates after edit/delete operations
- ✅ Confirmation Dialogs: Safe delete operations with user confirmation
🔗 Snippet Sharing & Links
- 🔗 Share Links: Create shareable links for individual snippets
- 📋 One-Click Copy: Copy share links to clipboard instantly
- 🔑 Secure Tokens: Unique tokens for each shared snippet
- 📊 Link Management: View, manage, and delete all your share links
📁 Smart Folder Organization
- 📂 Folder System: Organize snippets into custom folders by project, language, or purpose
- 🎯 Folder Preview: Visual sidebar showing all folders with snippet counts
- 🔄 Quick Access: Click folders to manage snippets, add new ones, or view contents
- 🏷️ Smart Categorization: Automatically suggest folders based on snippet content
- 📊 Folder Statistics: Track snippet counts and usage per folder
- 🌳 Hierarchical Nested Structure: Create unlimited nested folder levels with visual hierarchy
- 📁 Automatic Assignment: Snippets automatically assigned to appropriate folders based on file type
🌳 Multi-Level Nested Folder System
BlockMate Snippets supports unlimited nested folder levels with a modern tree structure:
🎯 Key Features:
- Unlimited Depth: Create folders within folders with no level restrictions
- Visual Hierarchy: Clear indentation and visual indicators for each level
- Smart Context Menu: Right-click any folder for quick actions
- Expand/Collapse: Click to expand or collapse nested folders
🖱️ Interaction Methods:
- Left Click: View snippets in folder or expand/collapse nested folders
- Right Click: Open context menu with folder-specific actions
- Context Menu Actions:
- 📁 Create Subfolder: Add nested folder at any level
- ✏️ Edit Folder: Modify folder name, icon, or color
- 🗑️ Delete Folder: Remove folder (snippets moved to parent)
- 📝 View Snippets: Browse snippets in this folder
📊 Example Nested Structure:
📁 Frontend Development
├── 📁 React Components
│ ├── 📁 UI Components
│ │ ├── 📁 Buttons
│ │ ├── 📁 Forms
│ │ └── 📁 Navigation
│ ├── 📁 Hooks
│ └── 📁 Utilities
├── 📁 CSS/Styling
│ ├── 📁 Animations
│ └── 📁 Layout
└── 📁 JavaScript Utils
├── 📁 Array Methods
└── 📁 Date Handling
📈 Usage Analytics
BlockMate Snippets includes comprehensive usage analytics to help you understand how your snippets are being used and optimize your workflow.
📊 Real-time Statistics Dashboard
- 📈 Total Usage: Track overall snippet copy count across all snippets
- 📅 Daily Usage: Monitor today's snippet usage with automatic daily reset
- 📊 Weekly Usage: Track this week's usage with automatic weekly reset
- 📈 Monthly Usage: Monitor this month's usage with automatic monthly reset
- 🎯 Individual Snippet Stats: Each snippet shows its own usage statistics
📋 Detailed Usage Tracking
- 📊 Copy Count: Track how many times each snippet has been copied
- 🕒 Last Used: See when each snippet was last used with timestamp
- 📅 Created Date: Track when snippets were created
- 📈 Usage History: Complete history of all snippet interactions
- 🎯 Context Tracking: Record usage context including file types
📊 Usage Analytics Features
- 🔄 Automatic Updates: Statistics update in real-time when snippets are copied
- 📈 Usage Trends: Monitor snippet popularity and usage patterns over time
- 🎯 Performance Insights: Identify your most-used and least-used snippets
- 📊 Visual Dashboard: Modern statistics cards with live updates
- 🕒 Time-based Analysis: View usage data with timestamps and context
🎯 How Usage Analytics Works
- Copy Tracking: Every time you copy a snippet, usage statistics are automatically updated
- Real-time Updates: Statistics refresh immediately in the management interface
- Automatic Reset: Daily, weekly, and monthly counters reset automatically
- Historical Data: Complete usage history is maintained for analysis
- Context Recording: Usage context including file types is recorded for insights
- ⚡ Dynamic Performance Algorithm: Automatically adapts to your system and data size
- 📊 Performance Optimization: Track and optimize extension performance
- 🔄 Smart Caching: Intelligent cache management based on data size
- 📈 Performance Reports: Detailed performance analysis and recommendations
- 🧹 Storage Optimization: Automatic storage cleanup and organization
🎮 Commands Reference
📋 Essential Commands
Command |
Shortcut |
Description |
Category |
Save as Code Snippet |
Ctrl+Shift+S |
Save selected code as a new snippet |
Core |
Manage Snippets |
Ctrl+Shift+M |
Open snippet management interface |
Core |
Insert Snippet |
Ctrl+Shift+I |
Insert snippet from quick pick |
Core |
Quick Create Snippet |
Ctrl+Shift+Q |
Quick snippet creation with folder selection |
Core |
Manage Folders |
- |
Create and manage snippet folders |
Organization |
Create Share Link |
- |
Generate shareable link for snippet |
Sharing |
Manage Share Links |
- |
View and manage all share links |
Sharing |
Upgrade Level |
- |
Check and upgrade your security level |
Security |
🔧 Additional Commands
Security & Encryption:
- Manage Encryption, PIN Protection, JWT Authentication, Key Rotation, Audit Trail
Testing & Monitoring:
- Test Audit Logging, Security Test Suite, Rate Limiting Dashboard
Advanced Security:
- Audit Logging, Rate Limiting, CSP Testing, JWT Authentication
For complete list of commands, use Command Palette (Ctrl+Shift+P ) and search "BlockMate"
🎯 Command Categories
- Core Commands: Essential snippet management commands for daily use
- Organization Commands: Folder management and snippet organization features
- Security Commands: Encryption, PIN protection, security testing, and monitoring features
- Sharing Commands: Snippet sharing, link management, and collaboration features
- Performance Commands: Performance optimization and analytics features
🚀 Recent Features
✏️ Inline Edit & Delete Actions
- ✏️ Edit Button: Green edit button for each snippet with full editing capabilities
- 🗑️ Delete Button: Red delete button with safe confirmation dialog
- 🔄 Real-time Updates: Changes immediately reflected in the interface
- 📁 Folder Selection: Choose from all available folders or create new ones
- 🏷️ Tag Management: Add, remove, or modify tags with comma-separated input
🎨 Enhanced Icon System
- Updated Technology Icons: Modern, recognizable icons for React, Python, and other technologies
- Consistent Display: Icons appear consistently across all interfaces
- SVG-Based: Scalable vector graphics for crisp display at any size
- Color-Coded: Each technology has its distinct color scheme for easy identification
🔍 Enhanced Search Operators
- Clickable Operators: Click search operators to add them to search input
- Smart Replacement: Clicking an operator replaces existing operators of the same type
- Available Operators:
tag: , type: , created: , title: , desc: , body: , has: , no:
📁 Improved Tab Management
- Individual Tab Titles: Each folder shows its own name in tab titles
- Unique Panel Management: Each folder opens in its own webview panel
- Better Navigation: Easy identification of open folder tabs
📁 Automatic Folder Assignment
- Silent Assignment: Snippets automatically assigned to appropriate folders based on file type
- File Type Detection: Automatic detection based on current file extension
- No User Interaction: Works seamlessly in the background
- Instant Results: Snippets appear in correct folders immediately
🎨 UI/UX Optimizations
- Responsive Design: Optimized for all screen sizes and devices
- Compact Button System: Streamlined interface with smaller, efficient buttons
- Mobile Optimization: Touch-friendly design for mobile devices
- Performance Improvements: Faster loading and smoother interactions
- Theme Switching: Dark and light theme support with automatic preference saving
- Smart Batch Processing: Automatically adjusts batch size based on snippet count
- Dynamic Cache Management: Cache TTL adapts to data size (15s - 60s)
- Universal Compatibility: Works optimally for all user types and system sizes
🔍 Fuzzy Search System
Our extension now includes an Intelligent Fuzzy Search System that provides smart matching with typo tolerance and relevance scoring.
Key Features:
- Typo Tolerance: Find snippets even with spelling mistakes
- Relevance Scoring: Results sorted by relevance
- Multi-field Search: Searches across name, description, tags, and prefix
- Word Boundary Matching: Smart partial word matching
- Levenshtein Distance: Character-based similarity matching
How it Works:
- Exact Match: Perfect matches get highest priority
- Substring Match: Partial matches with high relevance
- Fuzzy Match: Similar words with calculated similarity scores
- Word Boundary: Matches at word boundaries for better accuracy
📊 Usage Analytics Integration
- 📈 Real-time Statistics: Live usage tracking with daily, weekly, and monthly counts
- 📋 Usage History: Complete tracking of all snippet interactions with timestamps
- 🎯 Performance Metrics: Detailed analytics for snippet popularity and usage patterns
- 📊 Context Tracking: Record usage context including file types and timestamps
- 🔄 Automatic Updates: Statistics update immediately when snippets are copied
- 📊 Visual Dashboard: Modern statistics cards with live updates in management interface
- 🕒 Time-based Analysis: View usage trends and patterns over time
- 📈 Usage Insights: Identify most-used and least-used snippets for optimization
🔗 Enhanced Sharing System
- URI Handler:
blockmate://snippet/[encrypted-data] format
- Cross-Platform: Works on Windows, Mac, and Linux
- Automatic Import: Click links to automatically import snippets
- Secure Tokens: Unique, encrypted tokens for each share
🛠️ Installation
From VSIX File (Recommended)
- Download VSIX: Download the latest
.vsix file from Releases
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X )
- Click "..." menu and select "Install from VSIX..."
- Select the downloaded .vsix file
- Restart VS Code
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X )
- Search for "BlockMate Snippets"
- Click "Install"
From Source
git clone https://github.com/code-town3/blockmate-snippets.git
cd blockmate-snippets
npm install
npm run compile
npx vsce package
📖 Usage
🚀 Getting Started with Folders
Step 1: Access the Folder Preview
- Open VS Code
- Look for BlockMate Icon: Find the blue "B" icon in the left activity bar
- Click the Icon: This opens the folder preview sidebar
- View Your Folders: See all existing folders with snippet counts
Step 2: Create Your First Folder
- Open Command Palette:
Ctrl+Shift+P (Windows/Linux) / Cmd+Shift+P (Mac)
- Type: "BlockMate: Manage Folders"
- Select the Command
- Click "Create New Folder"
- Enter Folder Name: e.g., "React Components", "Database Queries", "Utility Functions"
- Add Description (optional): e.g., "Common React component templates"
- Save the Folder
Step 3: Add Snippets to Folders
- Select Code: Highlight code you want to save
- Quick Create: Press
Ctrl+Shift+Q
- Fill Details:
- Name: "React Button Component"
- Prefix: "rbtn" (auto-generated if left empty)
- Description: "Reusable button component with props"
- Tags: "react, component, button"
- Select Folder: Choose your newly created folder
- Save Snippet
Step 4: Organize and Manage
- Click Folder in Sidebar: See folder options
- Choose Action:
- "Open Folder Manager" - Full management
- "View Snippets" - See all snippets in folder
- "Add Snippet" - Quick add to this folder
Step 5: Create Nested Folders (Advanced)
- Right-click any folder in the sidebar
- Select "Create Subfolder" from the context menu
- Enter subfolder name: e.g., "Components", "Hooks", "Utils"
- Save the subfolder
- Expand/Collapse: Click the folder to expand or collapse nested structure
Creating Snippets
Method 1: Standard Creation
- Select Code: Highlight the code you want to save as a snippet
- Save Snippet:
- Right-click and select "Save as Code Snippet"
- Or use
Ctrl+Shift+S (Windows/Linux) / Cmd+Shift+S (Mac)
- Configure Snippet:
- Enter a name (e.g., "React Functional Component")
- Set a prefix (e.g., "rfc")
- Add description (optional)
- Add tags (e.g., "react, frontend, component")
- Specify file types (e.g., "js, jsx, ts, tsx")
- Select Folder: Choose which folder to save the snippet in
Method 2: Quick Create Snippet
- Select Code: Highlight the code you want to save
- Quick Create: Use
Ctrl+Shift+Q (Windows/Linux) / Cmd+Shift+Q (Mac)
- Configure Snippet:
- Enter snippet name
- Set prefix (auto-generated from name if not specified)
- Add description
- Add tags
- Select Folder: Choose from available folders or create new one
Using Snippets
Method 1: Quick Pick
- Use
Ctrl+Shift+I to open snippet picker
- Search and select from available snippets
Method 2: Direct Prefix
- Type the snippet prefix (e.g., "rfc")
- Press
Tab or Enter to insert
Managing Snippets
Open Manager:
- Use
Ctrl+Shift+M (Windows/Linux) / Cmd+Shift+M (Mac)
- Or run "BlockMate: Manage Snippets" command
Features Available:
- 🔍 Fuzzy Search: Intelligent fuzzy matching with typo tolerance
- Search: Real-time search across all snippets
- Tag Filtering: Dropdown with all available tags
- File Type Filtering: Filter by specific file types
- Favorites Tab: Dedicated view for favorite snippets
- Statistics: Live usage and storage statistics with detailed analytics
- Export/Import: Backup and share collections
- ✏️ Edit Snippets: Inline edit button for each snippet
- 🗑️ Delete Snippets: Safe delete with confirmation dialog
- ⭐ Toggle Favorites: Quick favorite/unfavorite actions
- 🎨 Theme Switching: Toggle between dark and light themes
📁 Managing Folders
Accessing Folder Management
Command Palette Method:
- Press
Ctrl+Shift+P (Windows/Linux) / Cmd+Shift+P (Mac)
- Type "BlockMate: Manage Folders"
- Select the command
Sidebar Method:
- Click the BlockMate icon in the activity bar (left sidebar)
- Click on any folder in the preview
- Select "Open Folder Manager" from the options
Folder Management Features
📂 Creating Folders:
- Click "Create New Folder" in the folder manager
- Enter folder name (e.g., "React Components", "Database Queries")
- Add optional description
- 🌳 Create Nested Folders: Right-click any folder → "Create Subfolder"
🔄 Managing Existing Folders:
- Rename: Change folder name and description
- Delete: Remove folder (snippets moved to parent folder)
- Move Snippets: Transfer snippets between folders
- View Statistics: See snippet count and usage per folder
📊 Folder Preview Sidebar:
- Visual Overview: See all folders with snippet counts
- Quick Actions: Click folders for instant access to:
- "Open Folder Manager" - Full folder management
- "View Snippets" - See all snippets in that folder
- "Add Snippet" - Quick snippet creation in that folder
Folder Organization Tips
🏷️ Best Practices:
- Project-based: Create folders for each project (e.g., "E-commerce App", "Blog System")
- Language-based: Organize by programming language (e.g., "JavaScript", "Python", "SQL")
- Function-based: Group by purpose (e.g., "Authentication", "Database", "UI Components")
🔗 Managing Share Links
Create Share Link:
- Method 1: Select code → Right-click → "Create Share Link"
- Method 2:
Ctrl+Shift+L → Select snippet → Create link
- Method 3: Command Palette → "BlockMate: Create Share Link"
Available Actions:
- 🔗 Create Link: Generate unique share link for any snippet
- 📋 Copy Link: One-click copy to clipboard
- 🗑️ Delete Link: Remove share link permanently
- 📊 Link Info: View detailed link information and properties
Link Management:
- View All Links:
Ctrl+Shift+K or "BlockMate: Manage Share Links"
- Link Properties: See creation date, snippet name, and description
- Secure Tokens: Each link has a unique, secure token
- Link Format:
blockmate://snippet/{token}
📥 Opening Shared Snippets
Open Shared Snippet:
- Method 1: Click on a shared snippet link
- Method 2: Command Palette → "BlockMate: Open Shared Snippet from URL"
- Method 3: Paste the link in the input dialog
Available Actions When Opening:
- 📊 View Details: See snippet information and code preview
- 🔗 Create New Link: Create a new share link for this snippet
- 💾 Save as File: Save the snippet to your local file system
Manual File Saving:
When you choose "💾 Save as File", the extension will:
- Open a save dialog with the correct file extension
- Suggest a filename based on the snippet name
- Allow you to choose the save location
- Automatically open the saved file in VS Code
💡 Tip: The extension automatically detects the correct file extension based on the snippet's language (JavaScript → .js , TypeScript → .ts , Python → .py , etc.)
🔐 Managing Encryption
Open Encryption Manager:
- Use
Ctrl+Shift+P to open command palette
- Run "BlockMate: Manage Encryption" command
Available Actions:
- 🔓 Enable Encryption: Enable AES-256 encryption for all snippets
- 🔒 Disable Encryption: Disable encryption (snippets stored in plain text)
- 🔑 Change Encryption Key: Generate new key and re-encrypt all snippets
- 📊 Encryption Status: View current encryption status and key information
Encryption Process:
- When enabled, all snippet data (body, description) is automatically encrypted
- Encryption keys are securely stored in VS Code's secure storage
- Snippets are automatically decrypted when viewed in the interface
- Key changes trigger automatic re-encryption of all existing snippets
⚙️ Configuration
Settings
Add these to your VS Code settings:
{
"blockmate.snippets.storagePath": "",
"blockmate.snippets.autoBackup": true,
"blockmate.snippets.maxSnippets": 1000,
"blockmate.snippets.enableEncryption": false,
"blockmate.snippets.encryptionKey": ""
}
🔐 Encryption Management
BlockMate Snippets includes enterprise-grade AES-256 encryption for your snippet data.
Enabling Encryption
- Open Command Palette:
Ctrl+Shift+P
- Run Command: "BlockMate: Manage Encryption"
- Select: "🔓 Enable Encryption"
- Confirm: Click "Yes" to enable AES-256 encryption
Encryption Features
- AES-256-CBC: Military-grade encryption algorithm
- PBKDF2: 10,000 iterations for key derivation
- Random Salt + IV: Unique salt and initialization vector for each encryption
- Secure Storage: Keys stored in VS Code's secure storage
- Automatic Re-encryption: All snippets automatically re-encrypted when key changes
Keybindings
Default keybindings (can be customized):
{
"key": "ctrl+shift+s",
"command": "blockmate.saveSnippet",
"when": "editorHasSelection"
},
{
"key": "ctrl+shift+m",
"command": "blockmate.manageSnippets"
},
{
"key": "ctrl+shift+i",
"command": "blockmate.insertSnippet"
},
{
"key": "ctrl+shift+q",
"command": "blockmate.quickCreateSnippet",
"when": "editorHasSelection"
}
🔐 PIN Protection
BlockMate Snippets includes optional PIN protection for enhanced security. PIN protection is disabled by default - you can enable it anytime through the command palette.
🔒 How PIN Protection Works
- Optional Security: PIN protection is completely optional and disabled by default
- Snippet Access Control: When enabled, requires PIN to access, save, or manage snippets
- 30-Minute Sessions: Once verified, PIN remains valid for 30 minutes
- Emergency Recovery: Use emergency code to reset PIN if forgotten
- VS Code Unaffected: PIN protection only affects snippet access, not VS Code functionality
🚀 Getting Started
For users who don't want PIN protection:
- Simply use the extension normally - no PIN required
- All snippet features work without any security prompts
For users who want PIN protection:
- Open Command Palette:
Ctrl+Shift+P
- Run Command: "BlockMate: Manage PIN Protection"
- Select: "🔐 Enable PIN Protection"
- Set PIN: Enter a 4-8 digit PIN
- Set Emergency Code: Enter an 8-12 digit emergency code
🔑 PIN Protection Features
- PIN Verification: 4-8 digit PIN for snippet access
- Emergency Code: 8-12 digit backup code for PIN recovery
- Session Management: 30-minute PIN sessions to avoid frequent prompts
- Lockout Protection: Temporary lockout after multiple failed attempts
- Secure Storage: PIN and emergency codes stored using VS Code's secure storage
- Forgot PIN Recovery: Reset PIN using emergency code
🔒 Security Features
🔐 AES-256 Encryption
BlockMate Snippets provides enterprise-grade encryption for your snippet data:
- AES-256-CBC Algorithm: Military-grade encryption standard
- PBKDF2 Key Derivation: 10,000 iterations for enhanced security
- Random Salt + IV: Unique salt and initialization vector for each encryption
- Secure Key Storage: Encryption keys stored in VS Code's secure storage
- Automatic Encryption: All snippet data (body, description) automatically encrypted
- Key Rotation: Easy encryption key change with automatic re-encryption
- Length Limits: Names (200 chars), descriptions (500 chars), tags (50 chars)
- Dangerous Pattern Detection: Blocks XSS, path traversal, and injection attempts
- Character Validation: Ensures safe input characters
- File Type Validation: Validates file type specifications
Data Protection
- Local Storage: All data stored securely on your machine
- Automatic Backups: Configurable backup system with versioning
- Error Handling: Graceful error handling with user feedback
- Encrypted Storage: Snippet data encrypted at rest using AES-256
Webview Security
- Content Security Policy: CSP headers prevent malicious code execution
- HTML Escaping: All user content is properly escaped
- Sandboxed Environment: Webview runs in isolated environment
🔍 Audit Logging
BlockMate Snippets includes comprehensive audit logging to track security events and user actions:
Event Types Tracked
- PIN Protection Events: PIN attempts, successes, failures, changes, resets
- Snippet Access Events: Create, update, delete, copy, search operations
- Folder Management Events: Create, update, delete, move operations
- Security Events: Encryption changes, rate limit violations, suspicious activity
- System Events: Extension start/stop, configuration changes, errors
Audit Features
- Real-time Logging: All events logged immediately with timestamps
- Event Filtering: Filter events by type, severity, date range, or user
- Statistics Dashboard: View event counts and trends
- Export Capability: Export audit logs for analysis
- Privacy Controls: Clear audit logs when needed
- Automatic Cleanup: Maintains last 10,000 events for performance
🧪 Testing Audit Logging
You can test the audit logging functionality using the built-in test command:
- Open Command Palette:
Ctrl+Shift+P
- Run Command: "BlockMate: Test Audit Logging"
- View Results: Check the output channel for detailed test results
🛡️ Content Security Policy (CSP)
BlockMate Snippets implements comprehensive Content Security Policy protection for all webview interfaces:
CSP Security Features
- Webview Protection: All webviews protected with strict CSP policies
- XSS Prevention: Blocks malicious script execution and injection attacks
- Resource Control: Restricts resource loading to trusted sources only
- Frame Protection: Prevents clickjacking attacks with frame-ancestors directive
- Object Protection: Blocks dangerous object types with object-src 'none'
- Form Protection: Prevents CSRF attacks with form-action restrictions
- Base URI Protection: Prevents base URI manipulation attacks
- HTTPS Enforcement: Automatically upgrades insecure requests to HTTPS
🧪 Testing CSP Security
You can test the CSP implementation using built-in security commands:
- Open Command Palette:
Ctrl+Shift+P
- Run Command: "BlockMate: CSP Security Test"
- View Results: Check the output channel for detailed CSP test results
🚦 Rate Limiting System
BlockMate Snippets includes a comprehensive rate limiting system to prevent abuse and ensure fair usage:
Rate Limiting Features
- Operation Protection: Prevents abuse of snippet and folder operations
- Configurable Limits: Adjustable rate limits for different operation types
- Real-time Monitoring: Live tracking of request rates and violations
- Automatic Reset: Rate limits automatically reset after time windows
- User Feedback: Clear notifications when rate limits are exceeded
- Dashboard Interface: Visual rate limiting management and monitoring
Protected Operations
The rate limiting system protects the following operations:
- Folder Operations: Create, edit, delete folders (5 requests per minute)
- Snippet Operations: Create, edit, delete snippets (10 requests per minute)
- Search Operations: Search queries (20 requests per minute)
- Security Operations: Security feature operations (3 requests per minute)
🧪 Testing Rate Limiting
You can test the rate limiting system using built-in commands:
- Open Command Palette:
Ctrl+Shift+P
- Run Command: "BlockMate: Rate Limiting Dashboard"
- Use Test Buttons: Click test buttons to simulate rate limit scenarios
- View Results: Monitor rate limit status and violations
🎯 Quick Reference Guide
📁 Folder Management Commands
Command |
Shortcut |
Description |
Manage Folders |
Ctrl+Shift+P → "BlockMate: Manage Folders" |
Full folder management interface |
Quick Create Snippet |
Ctrl+Shift+Q |
Fast snippet creation with folder selection |
Save Snippet |
Ctrl+Shift+S |
Standard snippet creation |
Manage Snippets |
Ctrl+Shift+M |
Complete snippet management |
Insert Snippet |
Ctrl+Shift+I |
Insert existing snippets |
🛡️ Security Commands
Command |
Shortcut |
Description |
CSP Security Test |
Ctrl+Shift+P → "BlockMate: CSP Security Test" |
Test Content Security Policy |
Rate Limiting Dashboard |
Ctrl+Shift+P → "BlockMate: Rate Limiting Dashboard" |
Rate limiting management interface |
Test Rate Limit |
Ctrl+Shift+P → "BlockMate: Test Rate Limit" |
Test rate limiting functionality |
Reset Rate Limits |
Ctrl+Shift+P → "BlockMate: Reset Rate Limits" |
Reset all rate limiting counters |
🔧 Folder Workflow
Daily Usage:
- Select Code →
Ctrl+Shift+Q → Choose Folder → Save
- Click Folder in Sidebar → "Add Snippet" → Quick Add
- Click Folder in Sidebar → "View Snippets" → Browse & Use
Organization:
Ctrl+Shift+P → "Manage Folders" → Create/Organize
- Sidebar → Click Folder → "Open Folder Manager"
- Move snippets between folders → Clean up organization
🎨 Folder Organization Examples
Project-Based Structure:
📁 E-commerce App
├── 🗂️ Authentication (5 snippets)
├── 🗂️ Product Management (12 snippets)
├── 🗂️ Shopping Cart (8 snippets)
└── 🗂️ Payment Processing (6 snippets)
Language-Based Structure:
📁 JavaScript
├── 🗂️ React Components (15 snippets)
├── 🗂️ Node.js Utils (10 snippets)
├── 🗂️ ES6 Features (8 snippets)
└── 🗂️ DOM Manipulation (6 snippets)
🌳 Advanced Nested Structure:
📁 Frontend Development
├── 📁 React Ecosystem
│ ├── 📁 Components
│ │ ├── 📁 UI Components
│ │ ├── 📁 Layout Components
│ │ └── 📁 Data Components
│ ├── 📁 Hooks
│ └── 📁 Utilities
├── 📁 Styling
│ ├── 📁 CSS
│ ├── 📁 SCSS
│ └── 📁 Styled Components
└── 📁 JavaScript Utils
├── 📁 Array Methods
├── 📁 Date Handling
└── 📁 DOM Manipulation
🔐 JWT Authentication System
BlockMate Snippets includes a comprehensive local JWT (JSON Web Token) authentication system for enhanced security and session management.
🎯 Key Features:
- 🔐 Local Authentication: No cloud services required - works completely offline
- ⏰ Session Management: 30-minute sessions with auto-refresh capability
- 🛡️ Secure Storage: Tokens stored securely using VS Code's built-in secure storage
- 🔑 Machine-Specific IDs: Unique user IDs generated based on your system
- 📋 Permission System: Granular read/write permissions with role-based access
- 🔄 Token Refresh: Automatic token renewal to maintain session continuity
- 🔒 HMAC-SHA256: Industry-standard signature verification for token integrity
🚀 Getting Started:
- Open JWT Dashboard: Use
Ctrl+Shift+P → "BlockMate: JWT Authentication Dashboard"
- Initialize Authentication: Click "Initialize Auth" to create your first session
- Test Authentication: Verify your session is working with "Test Authentication"
- Manage Sessions: Use the dashboard to refresh, logout, or force re-authentication
📊 Dashboard Features:
Authentication Actions:
- 🔐 Initialize Auth: Create new JWT authentication session
- ✅ Test Authentication: Verify current session status
- 📋 Token Details: View detailed token information and expiration
- 🔄 Refresh Token: Renew current session (extends by 30 minutes)
Management Actions:
- 🛡️ Test Permissions: Check read/write permission status
- 🔄 Force Re-Auth: Create completely new session
- 🔓 Logout: End current session and clear authentication
🛡️ Security Benefits:
- Session Isolation: Each session is isolated with unique tokens
- Automatic Expiration: Sessions expire after 30 minutes of inactivity
- Secure Storage: Tokens stored in VS Code's encrypted storage
- Permission Validation: All operations validate user permissions
- Token Integrity: HMAC-SHA256 ensures token authenticity
⌨️ Keyboard Shortcuts
Command |
Windows/Linux |
Mac |
Description |
Save Snippet |
Ctrl+Shift+S |
Cmd+Shift+S |
Save selected code as snippet |
Manage Snippets |
Ctrl+Shift+M |
Cmd+Shift+M |
Open snippet management interface |
Insert Snippet |
Ctrl+Shift+I |
Cmd+Shift+I |
Insert existing snippets |
Quick Create Snippet |
Ctrl+Shift+Q |
Cmd+Shift+Q |
Fast snippet creation with folder selection |
Create Share Link |
Ctrl+Shift+L |
Cmd+Shift+L |
Create shareable link for snippet |
Manage Share Links |
Ctrl+Shift+K |
Cmd+Shift+K |
Manage all share links |
📞 Support
- Contact: Reach out to the development team
- Documentation: See this README for usage instructions
- Feedback: Share your experience and suggestions
⚠️ Known Issues
🔧 Current Version (v0.0.68):
Minor Console Warnings:
- Some console warnings may appear in the developer console
- These warnings do not affect functionality or user experience
- All features work correctly despite these warnings
- Will be addressed in the next version
Note: These are development-level warnings and do not impact the extension's performance or usability for end users.
Made with ❤️ by Lielisk Team
| |