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

Import/Export Sub CLIs #145

Open
wants to merge 21 commits into
base: release-1.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
340 changes: 100 additions & 240 deletions .github/workflows/tests.yml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions artifacts/pam/pam-create-template-v11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "string",
"remote": true,
"area": 0,
"services": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"providerTypeParamValues": [
{
"id": 0,
"value": "string",
"instanceId": 0,
"instanceGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"providerTypeParam": {
"id": 0,
"name": "string",
"displayName": "string",
"instanceLevel": true
}
}
],
"securedAreaId": 0
}
2 changes: 1 addition & 1 deletion cmd/auth_providers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/certificates.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
12 changes: 10 additions & 2 deletions cmd/constants.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,10 @@
// limitations under the License.
package cmd

import "fmt"
import (
"fmt"
"time"
)

const (
ColorRed = "\033[31m"
Expand All @@ -25,6 +28,10 @@ const (
XKeyfactorRequestedWith = "APIClient"
XKeyfactorApiVersion = "1"
FlagGitRef = "git-ref"
FlagFromFile = "from-file"
DebugFuncEnter = "entered: %s"
DebugFuncExit = "exiting: %s"
DebugFuncCall = "calling: %s"
)

var ProviderTypeChoices = []string{
Expand All @@ -36,4 +43,5 @@ var ValidAuthProviders = [2]string{"azure-id", "azid"}
var (
StoreTypeReadError = fmt.Errorf("error reading store type from configuration file")
InvalidInputError = fmt.Errorf("invalid input")
CLINow = time.Now().Unix()
)
2 changes: 1 addition & 1 deletion cmd/containers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
392 changes: 273 additions & 119 deletions cmd/export.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/helm.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The Keyfactor Command Authors.
Copyright 2024 The Keyfactor Command Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/helm_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The Keyfactor Command Authors.
Copyright 2024 The Keyfactor Command Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/helm_uo.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The Keyfactor Command Authors.
Copyright 2024 The Keyfactor Command Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/helm_uo_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The Keyfactor Command Authors.
Copyright 2024 The Keyfactor Command Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 5 additions & 1 deletion cmd/helpers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cmd Copyright 2023 Keyfactor
// Copyright 2024 Keyfactor
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -388,6 +388,10 @@ func writeJSONFile(filename string, data interface{}) error {
}

func returnHttpErr(resp *http.Response, err error) error {
if resp == nil {
log.Error().Err(err).Msg("unable to create PAM provider - no response")
return err
}
if resp.Body != nil {
body, _ := io.ReadAll(resp.Body)
log.Error().Err(err).Str("httpResponseCode", resp.Status).
Expand Down
Loading
Loading