Skip to content

Commit

Permalink
Merge pull request #1728 from Infisical/daniel/cli-get-folders-improv…
Browse files Browse the repository at this point in the history
…ement

Feat: Allow "secrets folders get" command to be used with service token & universal auth
  • Loading branch information
DanielHougaard authored Apr 24, 2024
2 parents f27d9f8 + f04f3ae commit 5178663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 0 additions & 4 deletions cli/packages/cmd/folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ var folderCmd = &cobra.Command{
var getCmd = &cobra.Command{
Use: "get",
Short: "Get folders in a directory",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
util.RequireLocalWorkspaceFile()
util.RequireLogin()
},
Run: func(cmd *cobra.Command, args []string) {

environmentName, _ := cmd.Flags().GetString("env")
Expand Down
7 changes: 2 additions & 5 deletions cli/packages/util/folders.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package util

import (
"fmt"
"os"
"strings"

"github.com/Infisical/infisical-merge/packages/api"
Expand All @@ -13,13 +12,11 @@ import (

func GetAllFolders(params models.GetAllFoldersParameters) ([]models.SingleFolder, error) {

if params.InfisicalToken == "" {
params.InfisicalToken = os.Getenv(INFISICAL_TOKEN_NAME)
}

var foldersToReturn []models.SingleFolder
var folderErr error
if params.InfisicalToken == "" && params.UniversalAuthAccessToken == "" {
RequireLogin()
RequireLocalWorkspaceFile()

log.Debug().Msg("GetAllFolders: Trying to fetch folders using logged in details")

Expand Down

0 comments on commit 5178663

Please sign in to comment.