-
-
Notifications
You must be signed in to change notification settings - Fork 235
[WIP] feat: aur package for keyshade #1000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Thanks a lot for this PR! |
@rajdip-b dont merge it yet its present and working but I still need to make some parts better |
Sure thing! |
@Ayash-Bera I have market this PR as draft, once you are done I will mark it as ready for review |
Hey @Ayash-Bera any updates on this PR ?? |
was caught up in some work :( expect a proper soon |
User description
Description
Fixes #999
Added comprehensive Arch Linux installation support through the Arch User Repository (AUR), making keyshade easily accessible to the entire Arch Linux ecosystem. This contribution enables seamless installation for Arch Linux, Manjaro, EndeavourOS, and other Arch-based distributions.
Fixes #[999]
Dependencies
sudo pacman -Syu --noconfirm && \ sudo pacman -S --noconfirm base-devel git nodejs npm python gcc make
Package is live at: https://aur.archlinux.org/packages/keyshade
Screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Enhancement
Description
• Adds comprehensive Arch Linux installation support through the Arch User Repository (AUR)
• Implements complete CLI application with command structure for keyshade management
• Creates base command architecture with shared functionality including error handling and Sentry integration
• Adds workspace management commands (create, list, get, delete, membership operations)
• Implements project management with CRUD operations, fork handling, and environment import
• Provides secret and variable management with encryption, decryption, versioning, and rollback capabilities
• Adds live configuration updates with WebSocket integration for real-time changes
• Implements profile management system for CLI configuration and authentication
• Creates secret scanning functionality to detect hardcoded credentials in files
• Adds environment management within projects with full CRUD operations
• Implements private key management for encryption/decryption operations
• Provides comprehensive pagination, logging, and error reporting utilities
Changes walkthrough 📝
64 files
run.command.ts
Add live configuration update command with WebSocket integration
packages/aur/src/package/src/commands/run.command.ts
• Implements a
RunCommand
class that executes commands with liveconfiguration updates
• Establishes WebSocket connection to receive
real-time configuration changes from the API
• Fetches and decrypts
secrets/variables, then injects them as environment variables
•
Automatically restarts the command process when configuration changes
are detected
base.command.ts
Implement base command class with shared CLI functionality
packages/aur/src/package/src/commands/base.command.ts
• Creates abstract base class for all CLI commands with common
functionality
• Handles global context setup including API key, base
URL, and metrics configuration
• Provides error logging and reporting
capabilities with Sentry integration
• Manages command registration,
options, arguments, and HTTP request validation
scan.command.ts
Add secret scanning command for hardcoded credential detection
packages/aur/src/package/src/commands/scan.command.ts
• Implements secret scanning functionality for detecting hardcoded
secrets in files
• Supports scanning specific files, current Git
changes, or entire project directory
• Integrates with
@keyshade/secret-scan
package for secret detection• Provides ignore
functionality via comments (
keyshade-ignore
,keyshade-ignore-all
)create.profile.ts
Implement profile creation command with validation and prompts
packages/aur/src/package/src/commands/profile/create.profile.ts
• Creates new user profiles with API key, base URL, and metrics
settings
• Validates input using Zod schema for profile name and API
key format
• Supports interactive prompts and command-line options for
profile creation
• Handles profile overwriting with user confirmation
import.project.ts
Add environment file import functionality for projects
packages/aur/src/package/src/commands/project/import.project.ts
• Imports environment variables from
.env
files into keyshade projects• Automatically detects and categorizes secrets vs variables using
secret scanning
• Creates secrets and variables in specified project
and environment
• Provides confirmation prompts and error handling for
import operations
create.secret.ts
Implement secret creation command with multi-environment support
packages/aur/src/package/src/commands/secret/create.secret.ts
• Creates new secrets in keyshade projects with name, note, and
rotation settings
• Supports multiple environment entries with
validation
• Provides interactive prompts for missing required fields
• Includes comprehensive usage examples and error handling
update.secret.ts
Add secret update command with entry management
packages/aur/src/package/src/commands/secret/update.secret.ts
• Updates existing secrets with new values, metadata, and rotation
settings
• Supports adding new environment entries to existing secrets
• Includes decryption options and private key handling
• Validates
entry format and provides detailed usage examples
create.variable.ts
Implement variable creation command with environment entries
packages/aur/src/package/src/commands/variable/create.variable.ts
• Creates new variables in keyshade projects with name and note
•
Supports multiple environment entries with format validation
•
Provides interactive prompts and comprehensive usage examples
•
Handles entry parsing and validation with error reporting
create.project.ts
Add project creation command with environment and access control
packages/aur/src/package/src/commands/project/create.project.ts
• Creates new projects in workspaces with configurable settings
•
Supports environment creation, access levels, and private key storage
• Parses environment specifications with name and description
•
Provides detailed project information upon successful creation
create.role.ts
Implement workspace role creation with project associations
packages/aur/src/package/src/commands/workspace/role/create.role.ts
• Creates workspace roles with authorities and project-environment
associations
• Validates project and environment count matching
•
Supports color coding and detailed role configuration
• Displays
comprehensive role information after creation
update.role.ts
Add workspace role update command with validation
packages/aur/src/package/src/commands/workspace/role/update.role.ts
• Updates existing workspace roles with new authorities and
associations
• Validates project-environment mapping consistency
•
Supports modification of role properties including color and
description
• Provides detailed updated role information display
controller-instance.ts
Create singleton controller instance manager for API clients
packages/aur/src/package/src/util/controller-instance.ts
• Implements singleton pattern for API client controller management
•
Initializes all keyshade API controllers with base URL configuration
•
Provides centralized access to workspace, project, secret, and
variable controllers
• Ensures proper initialization before controller
access
update.variable.ts
Implement variable update command with entry management
packages/aur/src/package/src/commands/variable/update.variable.ts
• Updates existing variables with new values and metadata
• Supports
adding new environment entries with format validation
• Provides
comprehensive usage examples and error handling
• Validates entry
format and handles parsing errors gracefully
revisions.secret.ts
Add secret revision history command with decryption support
packages/aur/src/package/src/commands/secret/revisions.secret.ts
• Fetches and displays all revisions of a specific secret
• Supports
optional value decryption and pagination
• Shows revision history with
version, creation date, and creator information
• Includes
comprehensive usage examples for different scenarios
list.profile.ts
Implement profile listing command with table formatting
packages/aur/src/package/src/commands/profile/list.profile.ts
• Lists all user profiles in a formatted table display
• Supports
verbose mode showing API keys, URLs, and metrics settings
• Highlights
default profile and provides clean table formatting
• Uses CLI table
library for professional output presentation
list.secret.ts
Add secret listing command with decryption and pagination
packages/aur/src/package/src/commands/secret/list.secret.ts
• Lists all secrets within a project with environment-specific values
• Supports optional value decryption and pagination
• Displays secret
metadata including creation date and creator
• Provides comprehensive
usage examples and error handling
configuration.ts
Implement configuration file management utilities
packages/aur/src/package/src/util/configuration.ts
• Manages configuration file operations for profiles and private keys
• Handles cross-platform file path resolution (Windows/Unix)
• Creates
configuration directories and files as needed
• Provides read/write
operations for project root configuration
update.profile.ts
Add profile update command with renaming support
packages/aur/src/package/src/commands/profile/update.profile.ts
• Updates existing user profiles with new settings
• Handles profile
renaming with default profile reference updates
• Validates profile
existence before modification
• Supports updating API key, base URL,
and metrics settings
init.command.ts
Implement project initialization command for live-updates
packages/aur/src/package/src/commands/init.command.ts
• Initializes project configuration for live-updates functionality
•
Creates
keyshade.json
and private key configuration files• Supports
interactive prompts and overwrite protection
• Configures workspace,
project, environment, and decryption settings
revisions.variable.ts
Add variable revision history command with pagination
packages/aur/src/package/src/commands/variable/revisions.variable.ts
• Fetches and displays all revisions of a specific variable
• Shows
revision history with version, creation date, and creator information
• Supports pagination for large revision histories
• Provides
comprehensive usage examples and error handling
rollback.variable.ts
Implement variable rollback command with version control
packages/aur/src/package/src/commands/variable/rollback.variable.ts
• Rolls back variables to previous versions in specific environments
•
Validates required environment and version parameters
• Provides
rollback count information upon success
• Includes comprehensive usage
examples and error handling
rollback.secret.ts
Add secret rollback command with version control
packages/aur/src/package/src/commands/secret/rollback.secret.ts
• Rolls back secrets to previous versions in specific environments
•
Validates required environment and version parameters
• Provides
rollback count information upon success
• Includes comprehensive usage
examples and error handling
create.environment.ts
Implement environment creation command for projects
packages/aur/src/package/src/commands/environment/create.environment.ts
• Creates new environments within projects
• Supports interactive
prompts for missing environment name
• Validates project slug
requirement and provides error handling
• Displays created environment
information with slug and timestamps
list.variable.ts
Add variable listing command with pagination support
packages/aur/src/package/src/commands/variable/list.variable.ts
• Lists all variables within a project with environment-specific
values
• Supports pagination for large variable collections
• Displays
variable metadata including creation date and creator
• Provides
comprehensive usage examples and error handling
update.environment.ts
Add environment update command implementation
packages/aur/src/package/src/commands/environment/update.environment.ts
• Implements
UpdateEnvironment
command class extendingBaseCommand
•
Provides options for updating environment name and description
•
Handles environment slug validation and API calls for environment
updates
get-all-members.membership.ts
Add workspace membership listing command
packages/aur/src/package/src/commands/workspace/membership/get-all-members.membership.ts
• Creates
GetAllMembersOfWorkspaceCommand
to list workspace members•
Includes pagination options and workspace slug argument
• Displays
member emails and their associated roles
transfer-ownership.membership copy.ts
Add workspace ownership transfer command
packages/aur/src/package/src/commands/workspace/membership/transfer-ownership.membership copy.ts
• Implements
TransferOwnershipCommand
for workspace ownership transfer• Accepts workspace slug and new owner email as parameters
• Handles
API calls to transfer workspace ownership
get.role.ts
Add workspace role retrieval command
packages/aur/src/package/src/commands/workspace/role/get.role.ts
• Creates
GetRoleCommand
to fetch specific workspace role details•
Displays role information including authorities and associated
projects
• Takes workspace role slug as argument
list.role.ts
Add workspace role listing command
packages/aur/src/package/src/commands/workspace/role/list.role.ts
• Implements
ListRoleCommand
to list all workspace roles• Includes
pagination support and workspace slug argument
• Displays role names
and slugs in formatted output
delete.profile.ts
Add profile deletion command implementation
packages/aur/src/package/src/commands/profile/delete.profile.ts
• Creates
DeleteProfile
command for removing CLI profiles• Includes
confirmation prompt for default profile deletion
• Handles profile
existence validation and configuration updates
resend-invitation.membership.ts
Add workspace invitation resend command
packages/aur/src/package/src/commands/workspace/membership/resend-invitation.membership.ts
• Implements
ResendInvitationCommand
for workspace invitationmanagement
• Accepts workspace slug and user email as parameters
•
Handles API calls to resend workspace invitations
update.private-key.ts
Add private key update command
packages/aur/src/package/src/commands/config/private-key/update.private-key.ts
• Creates
UpdatePrivateKey
command for modifying stored private keys•
Validates workspace and project parameters are provided
• Updates
private key configuration for workspace-project combinations
list.environment.ts
Add environment listing command implementation
packages/aur/src/package/src/commands/environment/list.environment.ts
• Implements
ListEnvironment
command to display project environments•
Includes pagination options and project slug validation
• Formats
environment output with names and slugs
cancel-invitation.membership.ts
Add workspace invitation cancellation command
packages/aur/src/package/src/commands/workspace/membership/cancel-invitation.membership.ts
• Creates
CancelInvitationCommand
for canceling workspace invitations• Takes workspace slug and user email as parameters
• Handles API
calls to cancel pending invitations
remove.membership.ts
Add workspace user removal command
packages/aur/src/package/src/commands/workspace/membership/remove.membership.ts
• Implements
RemoveUserCommand
for removing users from workspaces•
Accepts comma-separated list of user emails to remove
• Handles bulk
user removal from workspace memberships
sync.project.ts
Add project fork synchronization command
packages/aur/src/package/src/commands/project/sync.project.ts
• Creates
SyncProject
command for synchronizing forked projects•
Provides hard sync option for complete parent project copying
•
Handles API calls to sync forked projects with their parents
get.environment.ts
Add environment retrieval command implementation
packages/aur/src/package/src/commands/environment/get.environment.ts
• Implements
GetEnvironment
command to fetch specific environmentdetails
• Validates environment slug parameter and displays
environment information
• Shows environment metadata including
creation and update timestamps
add.private-key.ts
Add private key addition command
packages/aur/src/package/src/commands/config/private-key/add.private-key.ts
• Creates
AddPrivateKey
command for storing new private keys•
Validates workspace and project parameters are required
• Adds private
key to configuration for workspace-project combinations
get.project.ts
Add project retrieval command implementation
packages/aur/src/package/src/commands/project/get.project.ts
• Implements
GetProject
command to fetch specific project details•
Displays comprehensive project information including keys and access
level
• Takes project slug as argument for project retrieval
delete.private-key.ts
Add private key deletion command
packages/aur/src/package/src/commands/config/private-key/delete.private-key.ts
• Creates
DeletePrivateKey
command for removing stored private keys•
Validates existence of private key before deletion
• Removes private
key from configuration for workspace-project combinations
get.workspace.ts
Add workspace retrieval command implementation
packages/aur/src/package/src/commands/workspace/get.workspace.ts
• Implements
GetWorkspace
command to fetch specific workspace details• Displays workspace information including creation timestamps and
default status
• Takes workspace slug as argument for workspace
retrieval
list-invitations.workspace.ts
Add workspace invitations listing command
packages/aur/src/package/src/commands/workspace/list-invitations.workspace.ts
• Creates
ListInvitations
command to display workspace invitations•
Includes pagination support for invitation listing
• Shows invitation
details with workspace information and invitation dates
list-forks.project.ts
Add project forks listing command
packages/aur/src/package/src/commands/project/list-forks.project.ts
• Implements
ListProjectForks
command to display project forks• Takes
project slug as argument to list all forks of a project
• Formats fork
output with project names and slugs
list.project.ts
Add project listing command implementation
packages/aur/src/package/src/commands/project/list.project.ts
• Creates
ListProject
command to display workspace projects• Takes
workspace slug as argument for project listing
• Shows project names
and slugs in formatted output
list.workspace.ts
Add workspace listing command implementation
packages/aur/src/package/src/commands/workspace/list.workspace.ts
• Implements
ListWorkspace
command to display user workspaces•
Includes pagination support for workspace listing
• Shows workspace
names and slugs in formatted output
sentry.ts
Add Sentry error reporting utility
packages/aur/src/package/src/util/sentry.ts
• Creates
SentryInstance
singleton class for error reporting•
Configures Sentry with environment variables and profiling integration
• Provides static methods for exception capture and initialization
delete.secret.ts
Add secret deletion command implementation
packages/aur/src/package/src/commands/secret/delete.secret.ts
• Implements
DeleteSecret
command for removing secrets• Takes secret
slug as argument and includes usage examples
• Handles API calls to
delete secrets with success confirmation
delete.variable.ts
Add variable deletion command implementation
packages/aur/src/package/src/commands/variable/delete.variable.ts
• Creates
DeleteVariable
command for removing variables• Takes
variable slug as argument and includes usage examples
• Handles API
calls to delete variables with success confirmation
membership.workspace.ts
Add workspace membership command orchestrator
packages/aur/src/package/src/commands/workspace/membership.workspace.ts
• Creates
WorkspaceMembershipCommand
as parent command for membershipoperations
• Registers all membership-related subcommands including
invitations and role management
• Provides centralized access to
workspace membership functionality
index.ts
Add main CLI application entry point
packages/aur/src/package/src/index.ts
• Sets up main CLI entry point with Commander.js configuration
•
Registers all command modules and global options like profile and API
key
• Configures version flag and command parsing for the CLI
application
delete.environment.ts
Add environment deletion command implementation
packages/aur/src/package/src/commands/environment/delete.environment.ts
• Implements
DeleteEnvironment
command for removing environments•
Validates environment slug parameter and handles API deletion calls
•
Provides confirmation of successful environment deletion
accept-invitation.membership.ts
Add workspace invitation acceptance command
packages/aur/src/package/src/commands/workspace/membership/accept-invitation.membership.ts
• Creates
AcceptInvitationCommand
for accepting workspace invitations• Takes workspace slug as argument for invitation acceptance
• Handles
API calls to accept workspace membership invitations
unlink.project.ts
Add project fork unlinking command
packages/aur/src/package/src/commands/project/unlink.project.ts
• Implements
UnlinkProject
command for disconnecting forked projects•
Takes project slug as argument to unlink from parent project
• Handles
API calls to remove fork relationship
leave.membership.ts
Add workspace leave command implementation
packages/aur/src/package/src/commands/workspace/membership/leave.membership.ts
• Creates
LeaveWorkspaceCommand
for leaving workspace memberships•
Takes workspace slug as argument for leaving workspace
• Handles API
calls to remove user from workspace
delete.role.ts
Add workspace role deletion command
packages/aur/src/package/src/commands/workspace/role/delete.role.ts
• Implements
DeleteRoleCommand
for removing workspace roles• Takes
workspace role slug as argument for role deletion
• Handles API calls
to delete workspace roles with confirmation
logger.ts
Add colored logging utility with Sentry integration
packages/aur/src/package/src/util/logger.ts
• Creates
Logger
namespace with colored console logging functions•
Provides log, info, error, warn methods with timestamps
• Integrates
with Sentry for error reporting functionality
use.profile.ts
Add profile activation command implementation
packages/aur/src/package/src/commands/profile/use.profile.ts
• Implements
UseProfile
command for setting default CLI profile•
Validates profile existence and updates configuration
• Sets the
specified profile as the active default profile
delete.workspace.ts
Add workspace deletion command implementation
packages/aur/src/package/src/commands/workspace/delete.workspace.ts
• Creates
DeleteWorkspace
command for removing workspaces• Takes
workspace slug as argument for workspace deletion
• Handles API calls
to delete workspaces with success confirmation
delete.project.ts
Add project deletion command implementation
packages/aur/src/package/src/commands/project/delete.project.ts
• Implements
DeleteProject
command for removing projects• Takes
project slug as argument for project deletion
• Handles API calls to
delete projects with success confirmation
workspace.command.ts
Add workspace command orchestrator
packages/aur/src/package/src/commands/workspace.command.ts
• Creates
WorkspaceCommand
as parent command for workspace operations• Registers all workspace-related subcommands including CRUD
operations
• Provides centralized access to workspace management
functionality
project.command.ts
Add project command orchestrator
packages/aur/src/package/src/commands/project.command.ts
• Creates
ProjectCommand
as parent command for project operations•
Registers all project-related subcommands including CRUD and fork
operations
• Provides centralized access to project management
functionality
decrypt.ts
Add cryptographic decryption utility function
packages/aur/src/package/src/util/decrypt.ts
• Implements
decrypt
function using eccrypto for data decryption•
Handles ECIES decryption with private key and encrypted data parsing
•
Returns decrypted data as string for secret management
pagination-options.ts
Add reusable pagination options configuration
packages/aur/src/package/src/util/pagination-options.ts
• Defines
PAGINATION_OPTION
constant with common pagination commandoptions
• Includes page, limit, order, sort, and search parameters
•
Provides reusable pagination configuration for list commands
secret.command.ts
Add secret command orchestrator
packages/aur/src/package/src/commands/secret.command.ts
• Creates
SecretCommand
as parent command for secret operations•
Registers all secret-related subcommands including CRUD and revision
operations
• Provides centralized access to secret management
functionality
1 files
env.ts
Add environment variable validation utility
packages/aur/src/package/src/util/env.ts
• Defines environment variable validation schema using Zod
• Validates
Sentry configuration variables with proper type checking
• Extends
global NodeJS ProcessEnv interface with typed environment variables
44 files