Skip to content

Commit

Permalink
chore: Update license year, and bump AKV runner go version
Browse files Browse the repository at this point in the history
Signed-off-by: sbailey <1661003+spbsoluble@users.noreply.github.com>
  • Loading branch information
spbsoluble committed Feb 8, 2024
1 parent c371b88 commit 404c5d3
Show file tree
Hide file tree
Showing 38 changed files with 64 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"
- name: Install dependencies
run: go mod download && go mod tidy
- name: Get secret from Azure Key Vault
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"
- name: Install dependencies
run: go mod download && go mod tidy
- name: Get secret from Azure Key Vault
Expand Down
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
3 changes: 2 additions & 1 deletion 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 @@ -25,6 +25,7 @@ const (
XKeyfactorRequestedWith = "APIClient"
XKeyfactorApiVersion = "1"
FlagGitRef = "git-ref"
FlagFromFile = "from-file"
)

var ProviderTypeChoices = []string{
Expand Down
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
2 changes: 1 addition & 1 deletion cmd/export.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
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
2 changes: 1 addition & 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
2 changes: 1 addition & 1 deletion cmd/import.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
2 changes: 1 addition & 1 deletion cmd/inventory.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
2 changes: 1 addition & 1 deletion cmd/login.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
2 changes: 1 addition & 1 deletion cmd/login_test.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
2 changes: 1 addition & 1 deletion cmd/logout.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
2 changes: 1 addition & 1 deletion cmd/models.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
2 changes: 1 addition & 1 deletion cmd/orchs.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
2 changes: 1 addition & 1 deletion cmd/orchs_ext.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/orchs_ext_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
32 changes: 18 additions & 14 deletions cmd/pam.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 @@ -31,6 +31,10 @@ type JSONImportableObject interface {
keyfactor.CSSCMSDataModelModelsProvider
}

const (
convertResponseMsg = "Converting PAM Provider response to JSON"
)

var pamCmd = &cobra.Command{
Use: "pam",
Short: "Keyfactor PAM Provider APIs.",
Expand Down Expand Up @@ -107,7 +111,7 @@ https://github.com/Keyfactor/hashicorp-vault-pam/blob/main/integration-manifest.
isExperimental := false

// Specific flags
pamConfigFile, _ := cmd.Flags().GetString("from-file")
pamConfigFile, _ := cmd.Flags().GetString(FlagFromFile)
pamProviderName, _ := cmd.Flags().GetString("name")
repoName, _ := cmd.Flags().GetString("repo")
branchName, _ := cmd.Flags().GetString("branch")
Expand Down Expand Up @@ -158,9 +162,9 @@ https://github.com/Keyfactor/hashicorp-vault-pam/blob/main/integration-manifest.
}
} else {
log.Debug().Str("pamConfigFile", pamConfigFile).
Msg("call: GetTypeFromConfigFile()")
Msg(fmt.Sprintf("call: %s", "GetTypeFromConfigFile()"))
pamProviderType, err = GetTypeFromConfigFile(pamConfigFile, pamProviderType)
log.Debug().Msg("returned: GetTypeFromConfigFile()")
log.Debug().Msg(fmt.Sprintf("returned: %s", "GetTypeFromConfigFile()"))
if err != nil {
log.Error().Err(err).Send()
return err
Expand Down Expand Up @@ -289,7 +293,7 @@ var pamProvidersGetCmd = &cobra.Command{
return err
}

log.Debug().Msg("Converting PAM Provider response to JSON")
log.Debug().Msg(convertResponseMsg)
jsonString, mErr := json.Marshal(pamProvider)
if mErr != nil {
log.Error().Err(mErr).Send()
Expand All @@ -311,7 +315,7 @@ var pamProvidersCreateCmd = &cobra.Command{
isExperimental := false

// Specific flags
pamConfigFile, _ := cmd.Flags().GetString("from-file")
pamConfigFile, _ := cmd.Flags().GetString(FlagFromFile)

// Debug + expEnabled checks
informDebug(debugFlag)
Expand Down Expand Up @@ -354,7 +358,7 @@ var pamProvidersCreateCmd = &cobra.Command{
return returnHttpErr(httpResponse, cErr)
}

log.Debug().Msg("Converting PAM Provider response to JSON")
log.Debug().Msg(convertResponseMsg)
jsonString, mErr := json.Marshal(createdPamProvider)
if mErr != nil {
log.Error().Err(mErr).Msg("invalid API response from Keyfactor Command")
Expand All @@ -375,7 +379,7 @@ var pamProvidersUpdateCmd = &cobra.Command{
isExperimental := false

// Specific flags
pamConfigFile, _ := cmd.Flags().GetString("from-file")
pamConfigFile, _ := cmd.Flags().GetString(FlagFromFile)

// Debug + expEnabled checks
informDebug(debugFlag)
Expand Down Expand Up @@ -416,7 +420,7 @@ var pamProvidersUpdateCmd = &cobra.Command{
returnHttpErr(httpResponse, err)
}

log.Debug().Msg("Converting PAM Provider response to JSON")
log.Debug().Msg(convertResponseMsg)
jsonString, mErr := json.Marshal(createdPamProvider)
if mErr != nil {
log.Error().Err(mErr).Msg("invalid API response from Keyfactor Command")
Expand Down Expand Up @@ -620,7 +624,7 @@ func init() {

// PAM Provider Types Create
pamCmd.AddCommand(pamTypesCreateCmd)
pamTypesCreateCmd.Flags().StringVarP(&filePath, "from-file", "f", "", "Path to a JSON file containing the PAM Type Object Data.")
pamTypesCreateCmd.Flags().StringVarP(&filePath, FlagFromFile, "f", "", "Path to a JSON file containing the PAM Type Object Data.")
pamTypesCreateCmd.Flags().StringVarP(&name, "name", "n", "", "Name of the PAM Provider Type.")
pamTypesCreateCmd.Flags().StringVarP(&repo, "repo", "r", "", "Keyfactor repository name of the PAM Provider Type.")
pamTypesCreateCmd.Flags().StringVarP(&branch, "branch", "b", "", "Branch name for the repository. Defaults to 'main'.")
Expand All @@ -632,12 +636,12 @@ func init() {
pamProvidersGetCmd.MarkFlagRequired("id")

pamCmd.AddCommand(pamProvidersCreateCmd)
pamProvidersCreateCmd.Flags().StringVarP(&filePath, "from-file", "f", "", "Path to a JSON file containing the PAM Provider Object Data.")
pamProvidersCreateCmd.MarkFlagRequired("from-file")
pamProvidersCreateCmd.Flags().StringVarP(&filePath, FlagFromFile, "f", "", "Path to a JSON file containing the PAM Provider Object Data.")
pamProvidersCreateCmd.MarkFlagRequired(FlagFromFile)

pamCmd.AddCommand(pamProvidersUpdateCmd)
pamProvidersUpdateCmd.Flags().StringVarP(&filePath, "from-file", "f", "", "Path to a JSON file containing the PAM Provider Object Data.")
pamProvidersUpdateCmd.MarkFlagRequired("from-file")
pamProvidersUpdateCmd.Flags().StringVarP(&filePath, FlagFromFile, "f", "", "Path to a JSON file containing the PAM Provider Object Data.")
pamProvidersUpdateCmd.MarkFlagRequired(FlagFromFile)

pamCmd.AddCommand(pamProvidersDeleteCmd)
pamProvidersDeleteCmd.Flags().Int32VarP(&id, "id", "i", 0, "Integer ID of the PAM Provider.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/pam_test.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
2 changes: 1 addition & 1 deletion cmd/root.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
2 changes: 1 addition & 1 deletion cmd/root_test.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
2 changes: 1 addition & 1 deletion cmd/rot.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
2 changes: 1 addition & 1 deletion cmd/rot_test.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
2 changes: 1 addition & 1 deletion cmd/status.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
2 changes: 1 addition & 1 deletion cmd/storeTypes.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
2 changes: 1 addition & 1 deletion cmd/storeTypes_get.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/storeTypes_get_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
8 changes: 7 additions & 1 deletion cmd/storeTypes_test.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 @@ -71,6 +71,12 @@ func Test_StoreTypesListCmd(t *testing.T) {

// verify that the store type is an integer
_, ok := storeType["StoreType"].(float64)
if !ok {
t.Log("StoreType is not a float64")
merr, ook := storeType["StoreType"].(int)
t.Log(merr)
t.Log(ook)
}
assert.True(t, ok, "Expected store type to be an integer")
// verify short name is a string
_, ok = storeType["ShortName"].(string)
Expand Down
2 changes: 1 addition & 1 deletion cmd/stores.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
2 changes: 1 addition & 1 deletion cmd/storesBulkOperations.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
2 changes: 1 addition & 1 deletion cmd/stores_test.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
2 changes: 1 addition & 1 deletion cmd/test.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
2 changes: 1 addition & 1 deletion cmd/version.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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0
github.com/Jeffail/gabs v1.4.0
github.com/Keyfactor/keyfactor-go-client-sdk v1.0.2
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.5
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.6
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/creack/pty v1.1.21
github.com/google/go-cmp v0.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ github.com/Keyfactor/keyfactor-go-client v1.4.3 h1:CmGvWcuIbDRFM0PfYOQH6UdtAgplv
github.com/Keyfactor/keyfactor-go-client v1.4.3/go.mod h1:3ZymLNCaSazglcuYeNfm9nrzn22wcwLjIWURrnUygBo=
github.com/Keyfactor/keyfactor-go-client-sdk v1.0.2 h1:caLlzFCz2L4Dth/9wh+VlypFATmOMmCSQkCPKOKMxw8=
github.com/Keyfactor/keyfactor-go-client-sdk v1.0.2/go.mod h1:Z5pSk8YFGXHbKeQ1wTzVN8A4P/fZmtAwqu3NgBHbDOs=
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.5 h1:2P6e4hOMwjH/+r3bjlm+PFVyFUabXYiAMspwb6HJ81k=
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.5/go.mod h1:3mfxdcwntB532QIATokBEkBCH0eXN2G/cdMZtu9NwNg=
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.6 h1:LQ6M0VKAhOZ7I/nNWC0Mfy+QVEE6YPZpjbnbi65oLw8=
github.com/Keyfactor/keyfactor-go-client/v2 v2.2.6/go.mod h1:3mfxdcwntB532QIATokBEkBCH0eXN2G/cdMZtu9NwNg=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
Expand Down

0 comments on commit 404c5d3

Please sign in to comment.