keyshade icon indicating copy to clipboard operation
keyshade copied to clipboard

feat(api): Added total count of env, vars and secrets of a project

Open yogesh1801 opened this issue 7 months ago • 5 comments

User description

Description

Give a summary of the change that you have made

Fixes #308

Dependencies

Mention any dependencies/packages used

Future Improvements

Mention any improvements to be done in future related to any file/feature

Mentions

Mention and tag the people

Screenshots of relevant screens

Add screenshots of relevant screens

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, Other


Description

  • Added new functions to fetch environments, variables, and secrets of a project with authority checks.
  • Integrated these functions into the project service to append counts of environments, variables, and secrets to the project object.
  • Implemented sorting and searching functionality in the new functions.
  • Included decryption check for secrets in the getAllSecretsOfProject function.

Changes walkthrough 📝

Relevant files
Enhancement
get-environmets-of-project.ts
Add function to fetch project environments with authority check

apps/api/src/common/get-environmets-of-project.ts

  • Added a new function getEnvironmentsOfProject to fetch environments of
    a project.
  • Included authority check for reading environments.
  • Implemented sorting and searching functionality.
  • +37/-0   
    get-secrets-of-project.ts
    Add function to fetch project secrets with decryption check

    apps/api/src/common/get-secrets-of-project.ts

  • Added a new function getAllSecretsOfProject to fetch secrets of a
    project.
  • Included authority check for reading secrets.
  • Implemented decryption check and fetching latest secret versions.
  • +150/-0 
    get-variables-of-project.ts
    Add function to fetch project variables with authority check

    apps/api/src/common/get-variables-of-project.ts

  • Added a new function getAllVariablesOfProject to fetch variables of a
    project.
  • Included authority check for reading variables.
  • Implemented fetching latest variable versions.
  • +123/-0 
    project.service.ts
    Integrate environment, variable, and secret counts in project service

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

  • Integrated new functions to fetch environments, variables, and secrets
    in getProjectsOfUser.
  • Appended counts of environments, variables, and secrets to the project
    object.
  • +47/-1   

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

    yogesh1801 avatar Jul 03 '24 17:07 yogesh1801