Skip to content
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

Api logout #424

Closed
wants to merge 101 commits into from
Closed

Api logout #424

wants to merge 101 commits into from

Conversation

rashmod
Copy link

@rashmod rashmod commented Sep 13, 2024

User description

Description

Added a logout endpoint

Fixes #223

Future Improvements

we can extend the add and remove cookie function in the future if we need to have more cookies

Mentions

@rajdip-b

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

PR Type

enhancement, tests, configuration changes, dependencies, error handling, formatting


Description

  • Implemented a logout endpoint in the AuthController.
  • Enhanced authority checks across multiple services to support multiple authorities.
  • Added comprehensive test cases for various controllers, including secret, event, and variable controllers.
  • Introduced pagination and metadata handling in several services.
  • Added new components and utilities for UI enhancements, such as PriceCard, AnimatedTab, and Accordion.
  • Improved error handling in services like MailService and IntegrationFactory.
  • Updated ESLint and Prettier configurations for consistent code style.
  • Added GitHub Actions workflows for API deployment and validation.
  • Defined TypeScript types for API interactions and CLI configurations.
  • Updated package dependencies and scripts for testing and deployment.

Changes walkthrough 📝

Relevant files
Tests
25 files
secret.e2e.spec.ts
Enhance secret controller tests with metadata checks and new cases.

apps/api/src/secret/secret.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Added new test cases for handling non-existing environments and
    projects.
  • Refactored test cases to use response.items instead of response[0].
  • +276/-35
    event.e2e.spec.ts
    Update event controller tests with metadata validation.   

    apps/api/src/event/event.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Refactored test cases to use response.items instead of response[0].
  • +145/-8 
    variable.e2e.spec.ts
    Enhance variable controller tests with metadata checks and new cases.

    apps/api/src/variable/variable.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Added new test cases for handling non-existing environments and
    projects.
  • Refactored test cases to use response.items instead of response[0].
  • +202/-22
    workspace.e2e.spec.ts
    Update workspace controller tests with metadata validation.

    apps/api/src/workspace/workspace.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Refactored test cases to use response.items instead of response[0].
  • +76/-52 
    project.e2e.spec.ts
    Enhance project controller tests with metadata checks.     

    apps/api/src/project/project.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Refactored test cases to use response.items instead of response[0].
  • +44/-58 
    api-key.e2e.spec.ts
    Extend API key tests with duplicate name and access checks.

    apps/api/src/api-key/api-key.e2e.spec.ts

  • Added test cases for API key creation and update with duplicate names.
  • Added test cases for accessing live updates with API keys.
  • Refactored test cases to use updated API key endpoints.
  • +90/-10 
    environment.e2e.spec.ts
    Update environment controller tests with metadata validation.

    apps/api/src/environment/environment.e2e.spec.ts

  • Added QueryTransformPipe to global pipes.
  • Updated test cases to check for metadata in responses.
  • Refactored test cases to use response.items instead of response[0].
  • +22/-22 
    variable.spec.ts
    Add comprehensive tests for variable controller in API client.

    packages/api-client/tests/variable.spec.ts

  • Added new test suite for variable controller.
  • Implemented tests for creating, updating, and deleting variables.
  • Added tests for fetching variables by project and environment.
  • +230/-0 
    paginate.spec.ts
    Add unit tests for pagination utility function.                   

    apps/api/src/common/paginate.spec.ts

  • Added unit tests for paginate function.
  • Tested pagination logic with various scenarios.
  • +104/-0 
    cache.service.spec.ts
    Add initial tests for CacheService with Redis mock.           

    apps/api/src/cache/cache.service.spec.ts

  • Added basic test setup for CacheService.
  • Mocked Redis client for testing.
  • +34/-0   
    secret.spec.ts
    Add comprehensive tests for `SecretController` operations

    packages/api-client/tests/secret.spec.ts

  • Added tests for SecretController covering CRUD operations.
  • Implemented setup and teardown logic for test environments.
  • Verified secret creation, update, rollback, and deletion.
  • +238/-0 
    environment.spec.ts
    Implement tests for `EnvironmentController` CRUD operations

    packages/api-client/tests/environment.spec.ts

  • Introduced tests for EnvironmentController CRUD operations.
  • Verified environment creation, update, and deletion.
  • Checked metadata and pagination in environment listing.
  • +229/-0 
    project.spec.ts
    Add tests for `ProjectController` lifecycle operations     

    packages/api-client/tests/project.spec.ts

  • Added tests for ProjectController covering project lifecycle.
  • Included tests for project creation, fetching, and deletion.
  • Verified project forking and unlinking functionality.
  • +263/-0 
    integration.spec.ts
    Implement integration tests for `IntegrationController` operations

    packages/api-client/tests/integration.spec.ts

  • Added integration tests for IntegrationController.
  • Verified integration creation, update, and deletion.
  • Checked retrieval of integrations within a workspace.
  • +175/-0 
    event.spec.ts
    Add tests for `EventController` event fetching                     

    packages/api-client/tests/event.spec.ts

  • Added tests for EventController covering event fetching.
  • Verified event retrieval for various sources like project and
    environment.
  • Ensured correct event metadata is returned.
  • +150/-0 
    workspace-role.e2e.spec.ts
    Enhance workspace role tests with pagination and query transformation

    apps/api/src/workspace-role/workspace-role.e2e.spec.ts

  • Updated workspace role tests with pagination metadata checks.
  • Integrated QueryTransformPipe for query transformation.
  • Enhanced test assertions for role retrieval.
  • +38/-5   
    integration.e2e.spec.ts
    Extend integration tests with pagination and query transformation.

    apps/api/src/integration/integration.e2e.spec.ts

  • Added a test case for fetching all integrations with pagination.
  • Utilized QueryTransformPipe for global query transformation.
  • +31/-0   
    setup.ts
    Create setup script for API client testing.                           

    packages/api-client/tests/config/setup.ts

  • Added setup script for API client tests.
  • Configures Docker and database for testing environment.
  • +58/-0   
    auth.controller.spec.ts
    Enhance auth controller tests with cache service mock.     

    apps/api/src/auth/controller/auth.controller.spec.ts

  • Added mock for CacheService in auth controller tests.
  • Updated test setup with Redis client mock.
  • +16/-1   
    auth.service.spec.ts
    Enhance auth service tests with cache service mock.           

    apps/api/src/auth/service/auth.service.spec.ts

  • Added mock for CacheService in auth service tests.
  • Updated test setup with Redis client mock.
  • +16/-1   
    user.e2e.spec.ts
    Extend user tests with admin workspace creation logic.     

    apps/api/src/user/user.e2e.spec.ts

  • Added test case for skipping workspace creation for admin users.
  • Validated absence of default workspace for admin users.
  • +20/-0   
    jest.config.ts
    Setup Jest configuration for API client testing.                 

    packages/api-client/jest.config.ts

  • Added Jest configuration for API client tests.
  • Configured module name mapping and test environment.
  • +20/-0   
    teardown.ts
    Create teardown script for API client testing.                     

    packages/api-client/tests/config/teardown.ts

  • Added teardown script for API client tests.
  • Handles Docker cleanup after tests.
  • +21/-0   
    feedback.e2e.spec.ts
    Update feedback e2e tests with consistent test data.         

    apps/api/src/feedback/feedback.e2e.spec.ts

  • Updated test user email for feedback controller tests.
  • Ensured consistency with test data.
  • +1/-1     
    auth.guard.spec.ts
    Update AuthGuard test with additional dependencies.           

    apps/api/src/auth/guard/auth/auth.guard.spec.ts

    • Updated test to include additional dependencies in AuthGuard.
    +1/-1     
    Enhancement
    82 files
    authority-checker.service.ts
    Refactor authority checks to support multiple authorities.

    apps/api/src/common/authority-checker.service.ts

  • Replaced single authority checks with multiple authorities.
  • Added detailed JSDoc comments for authority check methods.
  • Introduced checkHasPermission method for permission validation.
  • Improved error handling with InternalServerErrorException.
  • +119/-111
    secret.service.ts
    Refactor secret service for enhanced authority checks and pagination.

    apps/api/src/secret/service/secret.service.ts

  • Replaced single authority checks with multiple authorities.
  • Added methods for fetching secrets by project and environment.
  • Implemented pagination and metadata in secret fetching methods.
  • Improved error handling and response structure.
  • +176/-30
    variable.service.ts
    Refactor variable service for enhanced authority checks and
    pagination.

    apps/api/src/variable/service/variable.service.ts

  • Replaced single authority checks with multiple authorities.
  • Added methods for fetching variables by project and environment.
  • Implemented pagination and metadata in variable fetching methods.
  • Improved error handling and response structure.
  • +158/-28
    workspace.service.ts
    Enhance workspace service with authority checks and pagination.

    apps/api/src/workspace/service/workspace.service.ts

  • Replaced single authority checks with multiple authorities.
  • Implemented pagination and metadata in workspace member fetching
    methods.
  • Added validation for workspace roles.
  • +126/-16
    environment.controller.ts
    Adjust default pagination start for environment controller.

    apps/api/src/environment/controller/environment.controller.ts

    • Changed default page query parameter from 1 to 0.
    +1/-1     
    index.tsx
    Implement `PriceCard` component for pricing display           

    apps/web/src/components/pricing/card/index.tsx

  • Added a new PriceCard component to display pricing information.
  • Utilized various SVG components for visual elements.
  • Implemented conditional rendering for pricing details and features.
  • Introduced a button with dynamic label based on price.
  • +178/-0 
    run.command.ts
    Introduce `RunCommand` for executing commands with socket support

    apps/cli/src/commands/run.command.ts

  • Added RunCommand class extending BaseCommand.
  • Implemented socket connection and command execution logic.
  • Integrated configuration fetching and decryption.
  • Managed process environmental variables and command restart logic.
  • +251/-0 
    project.service.ts
    Enhance project service with pagination and improved authority checks

    apps/api/src/project/service/project.service.ts

  • Enhanced authority checks with multiple authorities.
  • Added pagination and metadata for project forks.
  • Improved error handling with NotFoundException and
    UnauthorizedException.
  • Refactored project fetching logic for better performance.
  • +100/-33
    environment.service.ts
    Enhance environment service with pagination and improved authority
    checks

    apps/api/src/environment/service/environment.service.ts

  • Enhanced environment service with pagination and metadata.
  • Improved authority checks with multiple authorities.
  • Refactored environment fetching logic for better performance.
  • +48/-19 
    paginate.ts
    Add pagination utility for generating metadata and links 

    apps/api/src/common/paginate.ts

  • Introduced paginate function to handle pagination metadata.
  • Implemented query string conversion for pagination links.
  • Added interface for paginated metadata.
  • +76/-0   
    api-key.service.ts
    Improve API key service with uniqueness check and better error
    handling

    apps/api/src/api-key/service/api-key.service.ts

  • Added uniqueness check for API key names.
  • Improved error handling with ConflictException and NotFoundException.
  • Enhanced pagination with limitMaxItemsPerPage.
  • +58/-14 
    command.tsx
    Refactor `Command` component for better type handling and styling

    apps/platform/src/components/ui/command.tsx

  • Updated Command component with improved type handling.
  • Refactored forwardRef usage for better type inference.
  • Enhanced component styling and className handling.
  • +30/-29 
    base.command.ts
    Add `BaseCommand` class for CLI command structure               

    apps/cli/src/commands/base.command.ts

  • Introduced BaseCommand class for CLI command structure.
  • Implemented global context field setting for API requests.
  • Defined abstract methods for command customization.
  • +158/-0 
    project.ts
    Implement `ProjectController` for project API management 

    packages/api-client/src/controllers/project.ts

  • Implemented ProjectController for managing project API interactions.
  • Added methods for project creation, update, and deletion.
  • Included functionality for project forking and synchronization.
  • +149/-0 
    integration.service.ts
    Enhance integration service with pagination and improved authority
    checks

    apps/api/src/integration/service/integration.service.ts

  • Enhanced integration service with pagination and metadata.
  • Improved authority checks with multiple authorities.
  • Refactored integration fetching logic for better performance.
  • +42/-12 
    create.profile.ts
    Add `CreateProfile` command for CLI profile management     

    apps/cli/src/commands/profile/create.profile.ts

  • Added CreateProfile command for creating CLI profiles.
  • Implemented input validation and profile configuration writing.
  • Supported setting profiles as default.
  • +140/-0 
    auth.guard.ts
    Enhance `AuthGuard` with caching and improved error handling

    apps/api/src/auth/guard/auth/auth.guard.ts

  • Enhanced AuthGuard with caching for user retrieval.
  • Improved error messages for API key validation.
  • Integrated CacheService for user caching.
  • +15/-9   
    project.types.d.ts
    Define TypeScript types for project API interactions         

    packages/api-client/src/types/project.types.d.ts

  • Defined TypeScript types for project-related API requests and
    responses.
  • Included types for project creation, update, and deletion.
  • Added types for project forking and synchronization.
  • +161/-0 
    page.tsx
    Add `SecretPage` component for project secret management 

    apps/platform/src/app/(main)/project/[project]/@secret/page.tsx

  • Added SecretPage component for displaying project secrets.
  • Implemented accordion UI for secret details.
  • Integrated API call to fetch secrets by project ID.
  • +123/-0 
    secret.ts
    Implement `SecretController` for secret API management     

    packages/api-client/src/controllers/secret.ts

  • Implemented SecretController for managing secret API interactions.
  • Added methods for secret creation, update, and deletion.
  • Included functionality for secret rollback and retrieval.
  • +101/-0 
    variable.ts
    Implement `VariableController` for variable API management

    packages/api-client/src/controllers/variable.ts

  • Implemented VariableController for managing variable API interactions.
  • Added methods for variable creation, update, and deletion.
  • Included functionality for variable rollback and retrieval.
  • +100/-0 
    cache.service.ts
    Add `CacheService` for user caching with Redis                     

    apps/api/src/cache/cache.service.ts

  • Added CacheService for managing user cache with Redis.
  • Implemented methods for setting, getting, and deleting user cache.
  • Integrated cache clearing and module destruction handling.
  • +54/-0   
    configuration.ts
    Add utility functions for configuration file management   

    apps/cli/src/util/configuration.ts

  • Added utility functions for fetching and writing configuration files.
  • Implemented methods for profile and private key configurations.
  • Supported directory creation and file existence checks.
  • +94/-0   
    integration.types.d.ts
    Define TypeScript types for integration API interactions 

    packages/api-client/src/types/integration.types.d.ts

  • Defined TypeScript types for integration-related API requests and
    responses.
  • Included types for integration creation, update, and deletion.
  • Added types for integration retrieval and event notifications.
  • +130/-0 
    list.profile.ts
    Add `ListProfile` command for CLI profile listing               

    apps/cli/src/commands/profile/list.profile.ts

  • Added ListProfile command for listing CLI profiles.
  • Implemented verbose option for detailed profile information.
  • Utilized cli-table for formatted output.
  • +102/-0 
    event.service.ts
    Enhance event service with pagination and improved authority checks

    apps/api/src/event/service/event.service.ts

  • Enhanced event service with pagination and metadata.
  • Improved authority checks with multiple authorities.
  • Refactored event fetching logic for better performance.
  • +24/-3   
    cache.module.ts
    Add `CacheModule` for providing caching services                 

    apps/api/src/cache/cache.module.ts

  • Introduced CacheModule to provide CacheService.
  • Marked as a global module for application-wide access.
  • +9/-0     
    animated-tabs.tsx
    Introduce AnimatedTab component with motion effects.         

    apps/web/src/components/ui/animated-tabs.tsx

  • Added a new AnimatedTab component using framer-motion.
  • The component renders tabs with animation effects.
  • Utilizes cn utility for conditional class names.
  • +68/-0   
    init.command.ts
    Add InitCommand for project configuration initialization.

    apps/cli/src/commands/init.command.ts

  • Added InitCommand class to initialize project configurations.
  • Supports options for workspace, project, environment, and private key.
  • Includes logic for handling existing configurations.
  • +116/-0 
    workspace-role.service.ts
    Implement pagination and authority updates in WorkspaceRoleService.

    apps/api/src/workspace-role/service/workspace-role.service.ts

  • Added pagination support for workspace roles.
  • Modified authority checks to use an array of authorities.
  • Introduced metadata calculation for pagination.
  • +36/-10 
    user.service.ts
    Enhance UserService with dummy user creation and pagination.

    apps/api/src/user/service/user.service.ts

  • Added a method to create a dummy user for test environments.
  • Updated user update methods to streamline return values.
  • Applied pagination limit to user fetching methods.
  • +27/-9   
    page.tsx
    Refactor project API interactions in main page.                   

    apps/platform/src/app/(main)/page.tsx

  • Refactored project fetching and creation logic.
  • Replaced direct API calls with Projects utility functions.
  • Removed redundant zod schema validation.
  • +4/-39   
    change-notifier.socket.ts
    Improve client registration and cache handling in ChangeNotifier.

    apps/api/src/socket/change-notifier.socket.ts

  • Enhanced client registration with detailed response.
  • Added workspace, project, and environment checks.
  • Adjusted cron job frequency for cache rehydration.
  • +29/-12 
    environment.ts
    Introduce EnvironmentController for managing environments.

    packages/api-client/src/controllers/environment.ts

  • Implemented EnvironmentController for environment API interactions.
  • Added methods for CRUD operations on environments.
  • +89/-0   
    page.tsx
    Create pricing page with animated tab navigation.               

    apps/web/src/app/(main)/pricing/page.tsx

  • Added a new pricing page with animated tabs.
  • Utilized AnimatedTab component for tab navigation.
  • Displayed pricing cards based on active tab.
  • +68/-0   
    integration.ts
    Develop IntegrationController for integration management.

    packages/api-client/src/controllers/integration.ts

  • Added IntegrationController for managing integrations.
  • Implemented methods for CRUD operations on integrations.
  • +84/-0   
    client.ts
    Introduce APIClient for handling HTTP requests.                   

    packages/api-client/src/core/client.ts

  • Created APIClient class for HTTP requests.
  • Implemented methods for GET, POST, PUT, and DELETE requests.
  • +86/-0   
    update.profile.ts
    Implement UpdateProfile command for CLI profile management.

    apps/cli/src/commands/profile/update.profile.ts

  • Added UpdateProfile command for updating CLI profiles.
  • Supports updating profile name, API key, and base URL.
  • +93/-0   
    projects.ts
    Add project API utility functions for platform.                   

    apps/platform/src/lib/api-functions/projects.ts

  • Implemented utility functions for project API interactions.
  • Functions include fetching projects by workspace ID and creating
    projects.
  • +77/-0   
    create.environment.ts
    Implement CreateEnvironment command for environment creation.

    apps/cli/src/commands/environment/create.environment.ts

  • Added CreateEnvironment command for creating environments.
  • Utilizes EnvironmentController for API interaction.
  • +97/-0   
    layout.tsx
    Improve project layout with dynamic content and data fetching.

    apps/platform/src/app/(main)/project/[project]/layout.tsx

  • Enhanced project layout with dynamic tab content.
  • Fetched project details using Projects utility.
  • +35/-9   
    accordion.tsx
    Introduce Accordion component for collapsible UI sections.

    apps/platform/src/components/ui/accordion.tsx

  • Added Accordion component using radix-ui.
  • Supports collapsible sections with customizable triggers.
  • +56/-0   
    variable.controller.ts
    Enhance VariableController with additional endpoints.       

    apps/api/src/variable/controller/variable.controller.ts

  • Updated VariableController with new endpoints.
  • Added methods for fetching variables by project and environment.
  • +37/-2   
    encrypt-text.tsx
    Improve EncryptText component with dynamic styling.           

    apps/web/src/components/ui/encrypt-text.tsx

  • Enhanced EncryptText component with dynamic width calculation.
  • Improved text scrambling effect on hover.
  • +22/-10 
    update.environment.ts
    Implement UpdateEnvironment command for environment updates.

    apps/cli/src/commands/environment/update.environment.ts

  • Added UpdateEnvironment command for updating environments.
  • Utilizes EnvironmentController for API interaction.
  • +82/-0   
    list.environment.ts
    Implement ListEnvironment command for environment listing.

    apps/cli/src/commands/environment/list.environment.ts

  • Added ListEnvironment command for listing environments.
  • Utilizes EnvironmentController for API interaction.
  • +69/-0   
    delete.profile.ts
    Implement DeleteProfile command for CLI profile deletion.

    apps/cli/src/commands/profile/delete.profile.ts

  • Added DeleteProfile command for deleting CLI profiles.
  • Includes confirmation for deleting default profiles.
  • +56/-0   
    api-key.controller.ts
    Enhance ApiKeyController with additional endpoints.           

    apps/api/src/api-key/controller/api-key.controller.ts

  • Updated API key controller with new endpoints.
  • Added endpoint to check access for live updates.
  • +21/-7   
    auth.service.ts
    Enhance AuthService with caching for user login.                 

    apps/api/src/auth/service/auth.service.ts

  • Integrated cache service for user login.
  • Cached user data upon successful login.
  • +4/-2     
    get.environment.ts
    Implement GetEnvironment command for environment retrieval.

    apps/cli/src/commands/environment/get.environment.ts

  • Added GetEnvironment command for fetching environment details.
  • Utilizes EnvironmentController for API interaction.
  • +62/-0   
    secret.controller.ts
    Enhance SecretController with additional endpoints.           

    apps/api/src/secret/controller/secret.controller.ts

  • Updated SecretController with new endpoints.
  • Added methods for fetching secrets by project and environment.
  • +35/-1   
    delete.environment.ts
    Implement DeleteEnvironment command for environment deletion.

    apps/cli/src/commands/environment/delete.environment.ts

  • Added DeleteEnvironment command for deleting environments.
  • Utilizes EnvironmentController for API interaction.
  • +55/-0   
    tooltip.tsx
    Introduce Tooltip component for enhanced UI interactions.

    apps/platform/src/components/ui/tooltip.tsx

  • Added Tooltip component using radix-ui.
  • Supports customizable tooltip content and positioning.
  • +27/-0   
    page.tsx
    Enhance OTP page with error notifications and input handling.

    apps/platform/src/app/auth/otp/page.tsx

  • Added toast notification for OTP errors.
  • Improved OTP input handling and submission.
  • +7/-2     
    input-otp.tsx
    Refactor InputOTP component with improved typing and styling.

    apps/platform/src/components/ui/input-otp.tsx

  • Updated InputOTP component with type-safe props.
  • Improved styling and container class handling.
  • +15/-13 
    index.tsx
    Enhance ProjectCard component with ID-based linking.         

    apps/platform/src/components/dashboard/projectCard/index.tsx

  • Updated ProjectCard component to use project ID for links.
  • Improved avatar rendering with project ID.
  • +4/-4     
    auth.controller.ts
    Implement logout endpoint in AuthController.                         

    apps/api/src/auth/controller/auth.controller.ts

  • Added logout endpoint to auth controller.
  • Utilized removeCookie utility for clearing cookies.
  • +8/-0     
    use.profile.ts
    Implement UseProfile command for setting default profile.

    apps/cli/src/commands/profile/use.profile.ts

  • Added UseProfile command for setting default CLI profile.
  • Updates configuration with the selected profile.
  • +41/-0   
    logger.ts
    Introduce Logger utility for consistent logging.                 

    apps/cli/src/util/logger.ts

  • Added Logger namespace for logging utilities.
  • Supports log, info, error, and warn methods with timestamps.
  • +37/-0   
    index.tsx
    Enhance Navbar with pricing link and project tabs.             

    apps/platform/src/components/shared/navbar/index.tsx

  • Updated navbar to include pricing link.
  • Added project-specific tabs for navigation.
  • +12/-3   
    integration.controller.ts
    Refine IntegrationController with pagination adjustments.

    apps/api/src/integration/controller/integration.controller.ts

  • Adjusted default pagination settings for integrations.
  • Removed redundant comments in the controller.
  • +1/-2     
    event.ts
    Develop EventController for event management.                       

    packages/api-client/src/controllers/event.ts

  • Added EventController for managing event API interactions.
  • Implemented method for fetching events by workspace ID and source.
  • +27/-0   
    combobox.tsx
    Enhance Combobox component with improved error handling. 

    apps/platform/src/components/ui/combobox.tsx

  • Improved error handling in workspace fetching.
  • Updated workspace display logic with nullish coalescing.
  • +4/-1     
    secrets.ts
    Implement secret fetching utility for platform.                   

    apps/platform/src/lib/api-functions/secrets.ts

  • Added utility function to fetch secrets by project ID.
  • Utilized zod schema for data validation.
  • +26/-0   
    index.ts
    Initialize CLI application with command setup.                     

    apps/cli/src/index.ts

  • Initialized CLI application with command registration.
  • Configured options for profile, API key, and base URL.
  • +25/-0   
    app.module.ts
    Integrate CacheModule into application module.                     

    apps/api/src/app/app.module.ts

  • Added CacheModule to the application module.
  • Enhanced module imports with caching capabilities.
  • +3/-1     
    environment.command.ts
    Implement EnvironmentCommand for environment management. 

    apps/cli/src/commands/environment.command.ts

  • Added EnvironmentCommand for managing environments.
  • Included subcommands for creating, updating, and listing environments.

  • +26/-0   
    layout.tsx
    Improve main layout styling for responsiveness.                   

    apps/platform/src/app/(main)/layout.tsx

  • Adjusted layout styling for better responsiveness.
  • Updated height settings for different screen sizes.
  • +2/-2     
    profile.command.ts
    Implement ProfileCommand for CLI profile management.         

    apps/cli/src/commands/profile.command.ts

  • Added ProfileCommand for managing CLI profiles.
  • Included subcommands for creating, updating, and deleting profiles.
  • +26/-0   
    create-user.ts
    Update user creation logic for admin users.                           

    apps/api/src/common/create-user.ts

  • Modified user creation to skip workspace for admin users.
  • Adjusted return type to optionally include default workspace.
  • +6/-5     
    response-parser.ts
    Implement response parser utility for API client.               

    packages/api-client/src/core/response-parser.ts

  • Added parseResponse utility for handling API responses.
  • Supports parsing JSON responses and handling errors.
  • +26/-0   
    profile.ts
    Add profile utility functions for CLI.                                     

    apps/cli/src/util/profile.ts

  • Added utility functions for profile existence and default checks.
  • Included function to retrieve the default profile.
  • +24/-0   
    decrypt.ts
    Implement decrypt utility for ECC decryption.                       

    apps/cli/src/util/decrypt.ts

  • Added decrypt utility function for ECC decryption.
  • Utilizes eccrypto library for decryption process.
  • +23/-0   
    project.controller.ts
    Refactor project controller fork endpoints.                           

    apps/api/src/project/controller/project.controller.ts

  • Updated project controller endpoints for fork operations.
  • Changed HTTP methods for sync and unlink fork actions.
  • +2/-2     
    redis.provider.ts
    Simplify Redis client setup in RedisProvider.                       

    apps/api/src/provider/redis.provider.ts

  • Simplified Redis client creation by duplicating subscriber.
  • Removed redundant password configuration.
  • +2/-6     
    index.ts
    Export API client controllers for external use.                   

    packages/api-client/src/index.ts

  • Exported controllers for environment, secret, and other entities.
  • Facilitated access to API client controllers.
  • +15/-0   
    socket.types.ts
    Update socket types with client registration response.     

    apps/api/src/socket/socket.types.ts

  • Added ClientRegisteredResponse interface for socket communication.
  • Updated change notification interface with plaintext flag.
  • +7/-1     
    index.tsx
    Add pricing link to the navbar.                                                   

    apps/web/src/components/shared/navbar/index.tsx

    • Added a new link to the pricing page in the navbar.
    +3/-0     
    remove-cookie.ts
    Implement removeCookie utility for response handling.       

    apps/api/src/common/remove-cookie.ts

  • Added utility function to remove cookies from response.
  • Clears the token cookie from the response.
  • +8/-0     
    page.tsx
    Add placeholder for variable page component.                         

    apps/platform/src/app/(main)/project/[project]/@variable/page.tsx

    • Added a placeholder component for the variable page.
    +7/-0     
    route.ts
    Implement health check route for API.                                       

    apps/platform/src/app/api/health/route.ts

    • Added a health check route returning a JSON response.
    +5/-0     
    limit-max-items-per-page.ts
    Implement utility for limiting items per page.                     

    apps/api/src/common/limit-max-items-per-page.ts

    • Added utility function to limit maximum items per page.
    +6/-0     
    Configuration changes
    6 files
    pricing.ts
    Define pricing data for subscription plans                             

    apps/web/src/constants/pricing.ts

  • Defined pricing data for different subscription plans.
  • Included monthly and yearly pricing options.
  • Specified features and limits for each plan.
  • +113/-0 
    constants.ts
    Define constant for API base URL.                                               

    apps/cli/src/util/constants.ts

    • Defined a constant for the API base URL.
    +1/-0     
    .eslintrc.js
    Add ESLint configuration for CLI project.                               

    apps/cli/.eslintrc.js

  • Added ESLint configuration for the CLI project.
  • Configured TypeScript parser and plugins.
  • +31/-0   
    .eslintrc.js
    Add ESLint configuration for API client project.                 

    packages/api-client/.eslintrc.js

  • Added ESLint configuration for the API client project.
  • Configured TypeScript parser and plugins.
  • +26/-0   
    prettier.config.js
    Update Prettier configuration with end-of-line setting.   

    prettier.config.js

    • Updated Prettier configuration to include end-of-line setting.
    +1/-0     
    deploy-api.yml
    Add GitHub Actions workflow for API deployment.                   

    .github/workflows/deploy-api.yml

  • Added GitHub Actions workflow for deploying the API.
  • Configured build and deployment steps for the API.
  • +94/-0   
    Dependencies
    15 files
    secret.types.d.ts
    Add TypeScript definitions for secret management.               

    packages/api-client/src/types/secret.types.d.ts

  • Defined types for secret management requests and responses.
  • Included interfaces for creating, updating, and deleting secrets.
  • +121/-0 
    variable.types.d.ts
    Add TypeScript definitions for variable management.           

    packages/api-client/src/types/variable.types.d.ts

  • Defined types for variable management requests and responses.
  • Included interfaces for creating, updating, and deleting variables.
  • +121/-0 
    index.ts
    Update and extend type definitions for platform.                 

    apps/platform/src/types/index.ts

  • Updated type definitions for various entities.
  • Added new types for secrets and versions.
  • +38/-5   
    event.types.d.ts
    Add TypeScript definitions for event management.                 

    packages/api-client/src/types/event.types.d.ts

  • Defined types for event management requests and responses.
  • Included enums for event sources, triggers, and severities.
  • +82/-0   
    environment.types.d.ts
    Add TypeScript definitions for environment management.     

    packages/api-client/src/types/environment.types.d.ts

  • Defined types for environment management requests and responses.
  • Included interfaces for creating, updating, and deleting environments.

  • +77/-0   
    pricing.ts
    Add TypeScript definitions for pricing components.             

    apps/web/src/types/pricing.ts

  • Defined types for pricing card and tab data.
  • Included interfaces for pricing features and specifications.
  • +32/-0   
    index.types.d.ts
    Add TypeScript definitions for CLI configurations.             

    apps/cli/src/types/index.types.d.ts

  • Defined types for project configuration and profiles.
  • Included pagination metadata interface.
  • +33/-0   
    index.types.d.ts
    Add TypeScript definitions for API client responses.         

    packages/api-client/src/types/index.types.d.ts

  • Defined types for pagination and API responses.
  • Included interfaces for response errors and client responses.
  • +28/-0   
    run.types.d.ts
    Add TypeScript definitions for run command.                           

    apps/cli/src/types/command/run.types.d.ts

  • Defined types for run command configurations.
  • Included interfaces for client registration and run data.
  • +17/-0   
    index.tsx
    Add SVG imports for pricing components.                                   

    apps/web/public/pricing/index.tsx

  • Added SVG imports for pricing-related icons.
  • Facilitated use of SVGs in pricing components.
  • +8/-0     
    command.types.d.ts
    Add TypeScript definitions for CLI command types.               

    apps/cli/src/types/command/command.types.d.ts

  • Defined types for CLI command options and arguments.
  • Included interface for command action data.
  • +16/-0   
    index.ts
    Add SVG imports for secret components.                                     

    apps/platform/public/svg/secret/index.ts

    • Added SVG imports for secret-related icons.
    +4/-0     
    index.ts
    Export pricing constants for application use.                       

    apps/web/src/constants/index.ts

    • Exported pricing constants for use in the application.
    +1/-0     
    index.ts
    Export pricing types for application use.                               

    apps/web/src/types/index.ts

    • Exported pricing types for use in the application.
    +1/-0     
    package.json
    Update package.json with new dependencies and scripts.     

    apps/api/package.json

  • Updated dependencies and scripts in package.json.
  • Adjusted Prisma and Docker commands for testing.
  • +6/-18   
    Error handling
    3 files
    integration.factory.ts
    Enhance error handling in IntegrationFactory.                       

    apps/api/src/integration/plugins/factory/integration.factory.ts

  • Replaced error throwing with InternalServerErrorException.
  • Improved error handling for unknown integration types.
  • +2/-1     
    mail.service.ts
    Enhance error handling in MailService.                                     

    apps/api/src/mail/services/mail.service.ts

  • Replaced error throwing with InternalServerErrorException.
  • Improved error handling for email sending failures.
  • +8/-2     
    create-event.ts
    Enhance error handling in createEvent function.                   

    apps/api/src/common/create-event.ts

  • Replaced error throwing with InternalServerErrorException.
  • Improved error handling for event creation.
  • +3/-1     
    Formatting
    3 files
    main.ts
    Refactor main.ts for consistent import style.                       

    apps/api/src/main.ts

  • Updated import for cookie-parser to default import.
  • Improved consistency in import statements.
  • +1/-1     
    logger.service.ts
    Refactor logger service imports for consistency.                 

    apps/api/src/common/logger.service.ts

  • Refactored imports for chalk and moment to use default imports.
  • +2/-2     
    workspace-storage.ts
    Add newline at end of workspace-storage.ts file.                 

    apps/platform/src/lib/workspace-storage.ts

    • Added a newline at the end of the file.
    +1/-1     
    Additional files (token-limit)
    56 files
    package-lock.json
    ...                                                                                                           

    apps/api/package-lock.json

    ...

    +1667/-0
    package-lock.json
    ...                                                                                                           

    apps/cli/package-lock.json

    ...

    +534/-0 
    CHANGELOG.md
    ...                                                                                                           

    CHANGELOG.md

    ...

    +139/-0 
    page.mdx
    ...                                                                                                           

    apps/web/src/app/(main)/(mdx)/privacy/page.mdx

    ...

    +44/-26 
    package.json
    ...                                                                                                           

    package.json

    ...

    +35/-6   
    package.json
    ...                                                                                                           

    apps/platform/package.json

    ...

    +63/-60 
    deploy-platform.yml
    ...                                                                                                           

    .github/workflows/deploy-platform.yml

    ...

    +73/-0   
    environment-variables.md
    ...                                                                                                           

    docs/contributing-to-keyshade/environment-variables.md

    ...

    +17/-9   
    cli.md
    ...                                                                                                           

    docs/contributing-to-keyshade/design-of-our-code/cli.md

    ...

    +84/-0   
    validate-api-client.yaml
    ...                                                                                                           

    .github/workflows/validate-api-client.yaml

    ...

    +68/-0   
    validate-cli.yaml
    ...                                                                                                           

    .github/workflows/validate-cli.yaml

    ...

    +65/-0   
    validate-platform.yaml
    ...                                                                                                           

    .github/workflows/validate-platform.yaml

    ...

    +61/-0   
    profile.md
    ...                                                                                                           

    docs/cli/profile.md

    ...

    +127/-0 
    deploy-web.yml
    ...                                                                                                           

    .github/workflows/deploy-web.yml

    ...

    +24/-4   
    api_a31bdb66-69e3-469b-afb4-f2051385e634
    ...                                                                                                           

    .postman/api_a31bdb66-69e3-469b-afb4-f2051385e634

    ...

    +1/-1     
    how-the-cli-works.md
    ...                                                                                                           

    docs/internals/how-the-cli-works.md

    ...

    +59/-0   
    auto-assign.yaml
    ...                                                                                                           

    .github/workflows/auto-assign.yaml

    ...

    +40/-4   
    validate-api.yaml
    ...                                                                                                           

    .github/workflows/validate-api.yaml

    ...

    +9/-10   
    Dockerfile
    ...                                                                                                           

    apps/platform/Dockerfile

    ...

    +57/-0   
    base.json
    ...                                                                                                           

    packages/tsconfig/base.json

    ...

    +31/-20 
    SUMMARY.md
    ...                                                                                                           

    docs/SUMMARY.md

    ...

    +16/-1   
    organization-of-code.md
    ...                                                                                                           

    docs/contributing-to-keyshade/design-of-our-code/organization-of-code.md

    ...

    +6/-5     
    schema.prisma
    ...                                                                                                           

    apps/api/src/prisma/schema.prisma

    ...

    +15/-13 
    setting-things-up.md
    ...                                                                                                           

    docs/contributing-to-keyshade/setting-things-up.md

    ...

    +37/-0   
    validate-web.yaml
    ...                                                                                                           

    .github/workflows/validate-web.yaml

    ...

    +18/-6   
    package.json
    ...                                                                                                           

    apps/cli/package.json

    ...

    +37/-0   
    introduction.md
    ...                                                                                                           

    docs/cli/introduction.md

    ...

    +31/-0   
    README.md
    ...                                                                                                           

    README.md

    ...

    +1/-3     
    web.md
    ...                                                                                                           

    docs/contributing-to-keyshade/design-of-our-code/web.md

    ...

    +51/-0   
    package.json
    ...                                                                                                           

    apps/web/package.json

    ...

    +2/-5     
    .env.example
    ...                                                                                                           

    .env.example

    ...

    +9/-7     
    init.md
    ...                                                                                                           

    docs/cli/init.md

    ...

    +37/-0   
    running-the-web-app.md
    ...                                                                                                           

    docs/contributing-to-keyshade/running-things-locally/running-the-web-app.md

    ...

    +41/-0   
    docker-ci.yml
    ...                                                                                                           

    .github/workflows/docker-ci.yml

    ...

    +22/-0   
    api-testing.md
    ...                                                                                                           

    docs/contributing-to-keyshade/running-things-locally/api-testing.md

    ...

    +1/-1     
    running-the-api.md
    ...                                                                                                           

    docs/contributing-to-keyshade/running-things-locally/running-the-api.md

    ...

    +4/-9     
    docker-compose.yml
    ...                                                                                                           

    docker-compose.yml

    ...

    +9/-4     
    pnpm-lock.yaml
    ...                                                                                                           

    pnpm-lock.yaml

    ...

    +1/-3     
    package.json
    ...                                                                                                           

    packages/api-client/package.json

    ...

    +17/-0   
    tsconfig.json
    ...                                                                                                           

    apps/api/tsconfig.json

    ...

    +4/-3     
    .swcrc
    ...                                                                                                           

    apps/cli/.swcrc

    ...

    +26/-0   
    architecture-of-keyshade.md
    ...                                                                                                           

    docs/internals/architecture-of-keyshade.md

    ...

    +5/-5     
    run.md
    ...                                                                                                           

    docs/cli/run.md

    ...

    +25/-0   
    tsconfig.json
    ...                                                                                                           

    apps/cli/tsconfig.json

    ...

    +20/-0   
    tsconfig.json
    ...                                                                                                           

    packages/api-client/tsconfig.json

    ...

    +17/-0   
    running-the-cli.md
    ...                                                                                                           

    docs/contributing-to-keyshade/running-things-locally/running-the-cli.md

    ...

    +22/-0   
    tsconfig.spec.json
    ...                                                                                                           

    packages/api-client/tsconfig.spec.json

    ...

    +14/-0   
    README.md
    ...                                                                                                           

    docs/contributing-to-keyshade/running-things-locally/README.md

    ...

    +2/-0     
    migration.sql
    ...                                                                                                           

    apps/api/src/prisma/migrations/20240627131325_add_unique_key_in_api_key/migration.sql

    ...

    +8/-0     
    package-lock.json
    ...                                                                                                           

    packages/api-client/package-lock.json

    ...

    +12/-0   
    turbo.json
    ...                                                                                                           

    turbo.json

    ...

    +6/-0     
    README.md
    ...                                                                                                           

    docs/contributing-to-keyshade/design-of-our-code/README.md

    ...

    +3/-0     
    tsconfig.app.json
    ...                                                                                                           

    apps/api/tsconfig.app.json

    ...

    +1/-1     
    pre-commit
    ...                                                                                                           

    .husky/pre-commit

    ...

    +1/-1     
    tsconfig.spec.json
    ...                                                                                                           

    apps/api/tsconfig.spec.json

    ...

    +1/-1     
    Dockerfile
    ...                                                                                                           

    apps/web/Dockerfile

    ...

    +1/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    rajdip-b and others added 30 commits June 12, 2024 13:43
    ## [2.0.0](keyshade-xyz/keyshade@v1.4.0...v2.0.0) (2024-06-12)
    
    ### ⚠ BREAKING CHANGES
    
    * **api:** Refactor environment, [secure] and variable functionality
    
    ### 🚀 Features
    
    * **platform:** Workspace integrate ([keyshade-xyz#241](keyshade-xyz#241)) ([6107e7d](keyshade-xyz@6107e7d))
    
    ### 📚 Documentation
    
    * Fix broken links in README.md ([9266788](keyshade-xyz@9266788))
    * Modified environment-variable.md ([keyshade-xyz#256](keyshade-xyz#256)) ([4974756](keyshade-xyz@4974756))
    
    ### 🔧 Miscellaneous Chores
    
    * Added docker build and run commands to` package.json` ([keyshade-xyz#258](keyshade-xyz#258)) ([af61791](keyshade-xyz@af61791))
    * **api:** Fix inconsistencies in zod schema ([keyshade-xyz#240](keyshade-xyz#240)) ([f3a3632](keyshade-xyz@f3a3632))
    * **ci:** Update deploy web ([e80d47d](keyshade-xyz@e80d47d))
    * **docker:** Grant correct permissions to docker image ([keyshade-xyz#251](keyshade-xyz#251)) ([49546aa](keyshade-xyz@49546aa))
    * Update GitHub Action plugin versions  ([keyshade-xyz#263](keyshade-xyz#263)) ([020bbf6](keyshade-xyz@020bbf6))
    * Update package versions for release ([93785be](keyshade-xyz@93785be))
    
    ### 🔨 Code Refactoring
    
    * **api:** Refactor environment, [secure] and variable functionality ([keyshade-xyz#270](keyshade-xyz#270)) ([55a6d37](keyshade-xyz@55a6d37))
    * **api:** Replace for loop with array indexing while decrypting [secure]s during bulk fetch [keyshade-xyz#265](keyshade-xyz#265) ([keyshade-xyz#266](keyshade-xyz#266)) ([62a1731](keyshade-xyz@62a1731))
    * **api:** Update return type while fetching [secure]s and variables ([keyshade-xyz#264](keyshade-xyz#264)) ([fd36abd](keyshade-xyz@fd36abd))
    ## [2.1.0](keyshade-xyz/keyshade@v2.0.0...v2.1.0) (2024-06-27)
    
    ### 🚀 Features
    
    * **api:** Add `requireRestart` parameter ([keyshade-xyz#286](keyshade-xyz#286)) ([fb447a1](keyshade-xyz@fb447a1))
    * **cli:** Added CLI ([keyshade-xyz#289](keyshade-xyz#289)) ([1143d95](keyshade-xyz@1143d95))
    * **workflows:** Tag user on attempt's reply body ([9d01698](keyshade-xyz@9d01698))
    
    ### 🐛 Bug Fixes
    
    * **web:** Resolve encryption glitch in footer text  ([keyshade-xyz#267](keyshade-xyz#267)) ([2b5cb39](keyshade-xyz@2b5cb39))
    
    ### 📚 Documentation
    
    * added running-the-web-app.md ([keyshade-xyz#269](keyshade-xyz#269)) ([755ea12](keyshade-xyz@755ea12))
    Co-authored-by: Sawan Bhattacharya <[email protected]>
    Co-authored-by: Rajdip Bhattacharya <[email protected]>
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Code Refactoring
    The AuthorityCheckerService has been significantly refactored to handle multiple authorities. The checkHasPermission method has been added to centralize authority checking logic. This change affects multiple methods and could potentially introduce bugs if not properly tested.

    API Changes
    The SecretService has undergone significant changes, including new methods for handling revisions and changes to existing methods. These changes may affect API consumers and should be carefully reviewed for backwards compatibility.

    API Changes
    Similar to the SecretService, the VariableService has also undergone significant changes, including new methods and modifications to existing ones. These changes should be reviewed for potential impacts on API consumers.

    @rajdip-b
    Copy link
    Member

    OMG bro :)

    @rajdip-b
    Copy link
    Member

    Can you just do it on a new branch from develop? This is like ages old

    @keyshade-xyz keyshade-xyz deleted a comment from codiumai-pr-agent-free bot Sep 13, 2024
    @rashmod
    Copy link
    Author

    rashmod commented Sep 13, 2024

    i fetched the upstream changes and merged them with the local develop branch but I am getting merge conflicts in files I did not even edit...? how do I resolve this

    @rajdip-b
    Copy link
    Member

    I would recommend you to delete your fork and do it over again. You can copy the features your wrote into a single file and paste it over in the new branch.

    @rashmod
    Copy link
    Author

    rashmod commented Sep 23, 2024

    sorry for the late reply. okay i will do that then

    @rajdip-b
    Copy link
    Member

    rajdip-b commented Nov 2, 2024

    Hey buddy, any updates on this?

    @rajdip-b rajdip-b closed this Nov 13, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    API: Add logout endpoint