[PR #3779] [MERGED] feat: secret variables in environments #4522

Closed
opened 2026-03-17 02:03:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3779
Author: @nivedin
Created: 1/25/2024
Status: Merged
Merged: 2/8/2024
Merged by: @AndrewBastin

Base: release/2023.12.4Head: feat/secret-env-variable


📝 Commits (10+)

  • ceeeebf refactor: update env data schema
  • 35eec63 refactor: add secret toggle to smart env
  • 36b520c refactor: type fix
  • afae225 refactor: update env components
  • e4070fe refactor: add feilds to web platform sync
  • 327f8e4 refactor: add secret env service and persistance
  • ff18186 refactor: add secret env to input tippy
  • 313c5ec refactor: update req runner
  • 07110f8 chore: fix old import env bug
  • ec4e575 refactor: update unsecret method when req run

📊 Changes

55 files changed (+2137 additions, -435 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+8 -0)
📝 packages/hoppscotch-common/src/components/environments/Add.vue (+3 -1)
📝 packages/hoppscotch-common/src/components/environments/ImportExport.vue (+5 -5)
📝 packages/hoppscotch-common/src/components/environments/Selector.vue (+15 -6)
📝 packages/hoppscotch-common/src/components/environments/index.vue (+23 -5)
📝 packages/hoppscotch-common/src/components/environments/my/Details.vue (+221 -79)
📝 packages/hoppscotch-common/src/components/environments/my/Environment.vue (+5 -0)
📝 packages/hoppscotch-common/src/components/environments/my/index.vue (+9 -2)
📝 packages/hoppscotch-common/src/components/environments/teams/Details.vue (+262 -119)
📝 packages/hoppscotch-common/src/components/environments/teams/Environment.vue (+8 -1)
📝 packages/hoppscotch-common/src/components/environments/teams/index.vue (+9 -2)
📝 packages/hoppscotch-common/src/components/http/CodegenModal.vue (+2 -0)
📝 packages/hoppscotch-common/src/components/http/Headers.vue (+3 -2)
📝 packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue (+1 -1)
📝 packages/hoppscotch-common/src/components/http/TabHead.vue (+0 -1)
📝 packages/hoppscotch-common/src/components/http/TestResult.vue (+6 -5)
📝 packages/hoppscotch-common/src/components/smart/EnvInput.vue (+88 -27)
📝 packages/hoppscotch-common/src/composables/codemirror.ts (+7 -0)
📝 packages/hoppscotch-common/src/helpers/RequestRunner.ts (+87 -10)
📝 packages/hoppscotch-common/src/helpers/actions.ts (+8 -1)

...and 35 more files

📄 Description

Closes HFE-220 HFE-393 HFE-358

Description

A user will now be able to create a secret variable in the personal environment;
Any owner or editor will now be able to create a “secret” variable. in a team environment;

  1. A normal environment variable: This is the current implementation of environment variables. Normal variables in team environments are shared across the team workspace.
  2. A secret environment variable: The value of the secret environment variable will be masked and never synced to servers/DB.

This PR also add a additional check in the environment inspector which alerts the user if a environment variable has empty value.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3779 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 1/25/2024 **Status:** ✅ Merged **Merged:** 2/8/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.4` ← **Head:** `feat/secret-env-variable` --- ### 📝 Commits (10+) - [`ceeeebf`](https://github.com/hoppscotch/hoppscotch/commit/ceeeebf46c4eeb9c739f9b605e5d5fbd0a00f8e6) refactor: update env data schema - [`35eec63`](https://github.com/hoppscotch/hoppscotch/commit/35eec6386da1e3e5ce69fcbe2f23d99b22121460) refactor: add secret toggle to smart env - [`36b520c`](https://github.com/hoppscotch/hoppscotch/commit/36b520c8a42baa20689973acfd17d1d32cd2ff0d) refactor: type fix - [`afae225`](https://github.com/hoppscotch/hoppscotch/commit/afae2250df4a0a0ff9597f0b031e3135ee5d4a81) refactor: update env components - [`e4070fe`](https://github.com/hoppscotch/hoppscotch/commit/e4070fe36c8f57d0d4bf05bb1ddbda6a3d8453f9) refactor: add feilds to web platform sync - [`327f8e4`](https://github.com/hoppscotch/hoppscotch/commit/327f8e499fb67161a37033608fde6dff7c27b8b4) refactor: add secret env service and persistance - [`ff18186`](https://github.com/hoppscotch/hoppscotch/commit/ff18186f55f265a802efd9ec53407af36fa3cf5a) refactor: add secret env to input tippy - [`313c5ec`](https://github.com/hoppscotch/hoppscotch/commit/313c5ec08a09e8779576376c60ffe083045add51) refactor: update req runner - [`07110f8`](https://github.com/hoppscotch/hoppscotch/commit/07110f8e68622369444f4c397c993dfbf29e57c3) chore: fix old import env bug - [`ec4e575`](https://github.com/hoppscotch/hoppscotch/commit/ec4e575d8443ddd5f78c6b4f1855d4c65ac58ddc) refactor: update unsecret method when req run ### 📊 Changes **55 files changed** (+2137 additions, -435 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+8 -0) 📝 `packages/hoppscotch-common/src/components/environments/Add.vue` (+3 -1) 📝 `packages/hoppscotch-common/src/components/environments/ImportExport.vue` (+5 -5) 📝 `packages/hoppscotch-common/src/components/environments/Selector.vue` (+15 -6) 📝 `packages/hoppscotch-common/src/components/environments/index.vue` (+23 -5) 📝 `packages/hoppscotch-common/src/components/environments/my/Details.vue` (+221 -79) 📝 `packages/hoppscotch-common/src/components/environments/my/Environment.vue` (+5 -0) 📝 `packages/hoppscotch-common/src/components/environments/my/index.vue` (+9 -2) 📝 `packages/hoppscotch-common/src/components/environments/teams/Details.vue` (+262 -119) 📝 `packages/hoppscotch-common/src/components/environments/teams/Environment.vue` (+8 -1) 📝 `packages/hoppscotch-common/src/components/environments/teams/index.vue` (+9 -2) 📝 `packages/hoppscotch-common/src/components/http/CodegenModal.vue` (+2 -0) 📝 `packages/hoppscotch-common/src/components/http/Headers.vue` (+3 -2) 📝 `packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/components/http/TabHead.vue` (+0 -1) 📝 `packages/hoppscotch-common/src/components/http/TestResult.vue` (+6 -5) 📝 `packages/hoppscotch-common/src/components/smart/EnvInput.vue` (+88 -27) 📝 `packages/hoppscotch-common/src/composables/codemirror.ts` (+7 -0) 📝 `packages/hoppscotch-common/src/helpers/RequestRunner.ts` (+87 -10) 📝 `packages/hoppscotch-common/src/helpers/actions.ts` (+8 -1) _...and 35 more files_ </details> ### 📄 Description Closes HFE-220 HFE-393 HFE-358 ### Description **A user** will now be able to create a secret variable in the **personal environment**; **Any owner or editor** will now be able to create a “**secret**” variable. in a **team environment**; 1. A normal environment variable: This is the current implementation of environment variables. Normal variables in team environments are shared across the team workspace. 2. A secret environment variable: The value of the secret environment variable will be masked and never synced to servers/DB. This PR also add a additional check in the environment inspector which alerts the user if a environment variable has empty value. ### Checks - [x] My pull request adheres to the code style of this project - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:03:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4522
No description provided.