Skip to content

Commit

Permalink
Merge c3b36cf into 05690f3
Browse files Browse the repository at this point in the history
  • Loading branch information
spbsoluble authored Sep 8, 2024
2 parents 05690f3 + c3b36cf commit 5524375
Show file tree
Hide file tree
Showing 13 changed files with 4,307 additions and 2,176 deletions.
148 changes: 79 additions & 69 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,6 @@ jobs:
run: echo "Running tests for KF 11.x.x"

### Store Type Tests
Test_StoreTypes_KFC_11_2_0:
runs-on: ubuntu-latest
needs:
- build
- kf_11_x_x
env:
SECRET_NAME: "command-config-1120-clean"
KEYFACTOR_HOSTNAME: "int1120-test-clean.kfdelivery.com"
KEYFACTOR_DOMAIN: "command"
KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }}
KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests
run: |
unset KFUTIL_DEBUG
go test -v ./cmd -run "^Test_StoreTypes*"
Test_StoreTypes_KFC_11_1_2:
runs-on: ubuntu-latest
needs:
Expand All @@ -182,15 +163,15 @@ jobs:
### Store Tests
Test_Stores_KFC_11_2_0:
Test_Stores_KFC_11_1_2:
runs-on: ubuntu-latest
needs:
- build
- kf_11_x_x
- Test_StoreTypes_KFC_11_2_0
- Test_StoreTypes_KFC_11_1_2
env:
SECRET_NAME: "command-config-1120"
KEYFACTOR_HOSTNAME: "integrations1120-lab.kfdelivery.com"
SECRET_NAME: "command-config-1112"
KEYFACTOR_HOSTNAME: "integrations1112-lab.kfdelivery.com"
KEYFACTOR_DOMAIN: "command"
KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }}
KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }}
Expand All @@ -199,7 +180,9 @@ jobs:
uses: actions/checkout@v4
- name: Run tests
run: go test -v ./cmd -run "^Test_Stores_*"
Test_Stores_KFC_11_1_2:

### PAM Tests
Test_PAM_KFC_11_1_2:
runs-on: ubuntu-latest
needs:
- build
Expand All @@ -215,18 +198,50 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests
run: go test -v ./cmd -run "^Test_Stores_*"
run: |
unset KFUTIL_DEBUG
go test -v ./cmd -run "^Test_PAM*"
### PAM Tests
Test_PAM_KFC_11_2_0:
### PAM Tests AKV Auth Provider
Test_AKV_PAM_KFC_11_1_2:
runs-on: self-hosted
needs:
- Test_PAM_KFC_11_1_2
env:
SECRET_NAME: "command-config-1112-az"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install dependencies
run: go mod download && go mod tidy
- name: Get secret from Azure Key Vault
run: |
. ./examples/auth/akv/akv_auth.sh
cat $HOME/.keyfactor/command_config.json
- name: Install kfutil
run: |
make install
- name: Run tests
run: |
go test -v ./cmd -run "^Test_PAM*"
## KFC 12.x.x
### Store Type Tests
Test_StoreTypes_KFC_12_2_0:
runs-on: ubuntu-latest
needs:
- build
- kf_11_x_x
- Test_StoreTypes_KFC_11_2_0
env:
SECRET_NAME: "command-config-1120"
KEYFACTOR_HOSTNAME: "integrations1120-lab.kfdelivery.com"
SECRET_NAME: "command-config-1220-clean"
KEYFACTOR_HOSTNAME: "int1220-test-clean.kfdelivery.com"
KEYFACTOR_DOMAIN: "command"
KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }}
KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }}
Expand All @@ -236,64 +251,57 @@ jobs:
- name: Run tests
run: |
unset KFUTIL_DEBUG
go test -v ./cmd -run "^Test_PAM*"
go test -v ./cmd -run "^Test_StoreTypes*"
Test_PAM_KFC_11_1_2:
### Store Tests
Test_Stores_KFC_12_2_0:
runs-on: ubuntu-latest
needs:
- build
- kf_11_x_x
- Test_StoreTypes_KFC_11_1_2
- Test_StoreTypes_KFC_12_2_0
env:
SECRET_NAME: "command-config-1112"
KEYFACTOR_HOSTNAME: "integrations1112-lab.kfdelivery.com"
SECRET_NAME: "command-config-1220"
KEYFACTOR_HOSTNAME: "integrations1220-lab.kfdelivery.com"
KEYFACTOR_DOMAIN: "command"
KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }}
KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests
run: |
unset KFUTIL_DEBUG
go test -v ./cmd -run "^Test_PAM*"
run: go test -v ./cmd -run "^Test_Stores_*"

### PAM Tests AKV Auth Provider
Test_AKV_PAM_KFC_11_2_0:
runs-on: self-hosted
### PAM Tests
Test_PAM_KFC_12_2_0:
runs-on: ubuntu-latest
needs:
- Test_PAM_KFC_11_2_0
- build
- kf_11_x_x
- Test_StoreTypes_KFC_12_2_0
env:
SECRET_NAME: "command-config-1120-az"
SECRET_NAME: "command-config-1220"
KEYFACTOR_HOSTNAME: "integrations1220-lab.kfdelivery.com"
KEYFACTOR_DOMAIN: "command"
KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }}
KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install dependencies
run: go mod download && go mod tidy
- name: Get secret from Azure Key Vault
run: |
. ./examples/auth/akv/akv_auth.sh
cat $HOME/.keyfactor/command_config.json
- name: Install kfutil
run: |
make install
- name: Run tests
run: |
unset KFUTIL_DEBUG
go test -v ./cmd -run "^Test_PAM*"
Test_AKV_PAM_KFC_11_1_2:
### PAM Tests AKV Auth Provider
Test_AKV_PAM_KFC_12_2_0:
runs-on: self-hosted
needs:
- Test_PAM_KFC_11_1_2
- Test_PAM_KFC_12_2_0
env:
SECRET_NAME: "command-config-1112-az"
SECRET_NAME: "command-config-1220-az"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -315,16 +323,18 @@ jobs:
go test -v ./cmd -run "^Test_PAM*"
# Tester Install Script
Test_Install_Script:
runs-on: ubuntu-latest
steps:
- name: Test Quick Install Script
run: |
bash <(curl -s https://raw.githubusercontent.com/Keyfactor/kfutil/${GITHUB_REF_NAME}/install.sh)
which kfutil
kfutil version
rm $(which kfutil)
Test_Install_Script:
runs-on: ubuntu-latest
steps:
- name: Test Quick Install Script
run: |
sudo apt update && sudo apt upgrade -y && sudo apt install -y curl wget unzip jq openssl && sudo apt clean
bash <(curl -s https://raw.githubusercontent.com/Keyfactor/kfutil/${GITHUB_REF_NAME}/install.sh)
which kfutil
kfutil version
rm $(which kfutil)
# Package Tests
Test_Kfutil_pkg:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.4.1
## Fixes
- `stores export --all`: Now properly exports all stores where previously it would only export the first page of stores.

# v1.4.0
## Features

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,4 @@ alternatively you can specify the parent command
cobra-cli add <my-new-command> -p '<parent>Cmd'
```
27 changes: 14 additions & 13 deletions cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ package cmd
import "fmt"

const (
ColorRed = "\033[31m"
ColorWhite = "\033[37m"
DefaultAPIPath = "KeyfactorAPI"
DefaultConfigFileName = "command_config.json"
FailedAuthMsg = "Login failed!"
SuccessfulAuthMsg = "Login successful!"
XKeyfactorRequestedWith = "APIClient"
XKeyfactorApiVersion = "1"
FlagGitRef = "git-ref"
FlagFromFile = "from-file"
DebugFuncEnter = "entered: %s"
DebugFuncExit = "exiting: %s"
DebugFuncCall = "calling: %s"
ColorRed = "\033[31m"
ColorWhite = "\033[37m"
DefaultAPIPath = "KeyfactorAPI"
DefaultConfigFileName = "command_config.json"
DefaultStoreTypesFileName = "store_types.json"
FailedAuthMsg = "Login failed!"
SuccessfulAuthMsg = "Login successful!"
XKeyfactorRequestedWith = "APIClient"
XKeyfactorApiVersion = "1"
FlagGitRef = "git-ref"
FlagFromFile = "from-file"
DebugFuncEnter = "entered: %s"
DebugFuncExit = "exiting: %s"
DebugFuncCall = "calling: %s"
)

var ProviderTypeChoices = []string{
Expand Down
Loading

0 comments on commit 5524375

Please sign in to comment.