Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddheshk02 committed Nov 27, 2023
1 parent 497f6e7 commit 7817dc6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "Securelee-cli",
Version: "v1.1.5",
Version: "v1.1.6",
Short: "\nA CLI based Vault App for storing your Secret Messages or Keys Securely.",
Long: `A CLI based Vault App for storing your Secret Messages or Keys Securely.`,
// Uncomment the following line if your bare application
Expand All @@ -28,7 +28,7 @@ var rootCmd = &cobra.Command{

renderStr, _ := ascii.RenderOpts("Securelee.", options)
fmt.Print(renderStr)
fmt.Print(" > v1.1.5")
fmt.Print(" > v1.1.6")
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var versionCmd = &cobra.Command{
Short: "Version of the Securelee CLI.",
Long: `Version of the Securelee CLI.`,
Run: func(cmd *cobra.Command, args []string) {
color.Cyan("\n > Securelee - v1.1.5")
color.Cyan("\n > Securelee - v1.1.6")
fmt.Print("\n")
},
}
Expand Down
46 changes: 22 additions & 24 deletions lib/init.go
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
package lib

import (
"log"
"os"

"github.com/joho/godotenv"
"github.com/pangeacyber/pangea-go/pangea-sdk/v2/pangea"
"github.com/pangeacyber/pangea-go/pangea-sdk/v2/service/authn"
"github.com/pangeacyber/pangea-go/pangea-sdk/v2/service/vault"
)

func Init() *authn.AuthN {
err := godotenv.Load(".env")
if err != nil {
log.Fatal("\033[31m", "Error loading .env file", "\033[0m")
}
// err := godotenv.Load(".env")
// if err != nil {
// log.Fatal("\033[31m", "Error loading .env file", "\033[0m")
// }
// Get token
token := os.Getenv("PANGEA_AUTHN_TOKEN")
if token == "" {
log.Fatal("\033[31m", "Unauthorized: No token present", "\033[0m")
}

// token := os.Getenv("PANGEA_AUTHN_TOKEN")
// if token == "" {
// log.Fatal("\033[31m", "Unauthorized: No token present", "\033[0m")
// }
token := "pts_xajlrac4we4mufoebqgejbrh2ieq72c4"
domain := "aws.us.pangea.cloud"
// Create config and client
client := authn.New(&pangea.Config{
Token: token,
Domain: os.Getenv("PANGEA_DOMAIN"),
Domain: domain,
})

return client
}

func InitVault() vault.Client {
err := godotenv.Load(".env")
if err != nil {
log.Fatal("\033[31m", "Error loading .env file", "\033[0m")
}
// err := godotenv.Load(".env")
// if err != nil {
// log.Fatal("\033[31m", "Error loading .env file", "\033[0m")
// }
// Get token
token := os.Getenv("PANGEA_VAULT_TOKEN")
if token == "" {
log.Fatal("\033[31m", "Unauthorized: No token present", "\033[0m")
}

// token := os.Getenv("PANGEA_VAULT_TOKEN")
// if token == "" {
// log.Fatal("\033[31m", "Unauthorized: No token present", "\033[0m")
// }
token := "pts_xajlrac4we4mufoebqgejbrh2ieq72c4"
domain := "aws.us.pangea.cloud"
// Create config and client
client := vault.New(&pangea.Config{
Token: token,
Domain: os.Getenv("PANGEA_DOMAIN"),
Domain: domain,
})

return client
Expand Down

0 comments on commit 7817dc6

Please sign in to comment.