Skip to content

Commit

Permalink
fix(management): When invalid cluster alias is given, fail immediately
Browse files Browse the repository at this point in the history
fix(pam): Support for "remote" PAM.
chore: Update copyright year to 2024
fix(manifest): Adding `SeparateChain, IncludeCertChain`, properties.
  • Loading branch information
spbsoluble committed Feb 20, 2024
1 parent 538247f commit d94803e
Show file tree
Hide file tree
Showing 14 changed files with 796 additions and 511 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/keyfactor-merge-store-types.yml

This file was deleted.

115 changes: 115 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

.PHONY: all
all: build

# Required environemnt variables for the project
ENV_VARS := AZURE_TENANT_ID AZURE_CLIENT_SECRET AZURE_CLIENT_ID AZURE_APP_GATEWAY_RESOURCE_ID

##@ General

# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Development

.PHONY: reset
reset: ## Reset the environment
@echo "Resetting..."
@rm -rf test.env
@rm -rf .env

.PHONY: setup
setup: ## Setup the environment for development
@if [ ! -f .test.env ]; then \
echo "Creating .test.env file..."; \
> .env; \
for var in $(ENV_VARS); do \
echo -n "Enter value for $$var: "; \
read value; \
echo "export $$var=$$value" >> .test.env; \
done; \
echo ".test.env file created with input values."; \
fi
@if [ ! -f .env ]; then \
echo "PROJECT_ROOT=$$(pwd)" >> .env; \
echo "Select a project to target:"; \
PS3="Enter your choice: "; \
select opt in $$(ls */*.csproj); do \
if [ -n "$$opt" ]; then \
echo "You have selected $$opt"; \
echo "PROJECT_FILE=$$opt" >> .env; \
break; \
else \
echo "Invalid selection. Please try again."; \
fi; \
done; \
echo "PROJECT_NAME=$$(basename $$(dirname $$(grep PROJECT_FILE .env | cut -d '=' -f 2)))" >> .env; \
fi

.PHONY: newtest
newtest: setup ## Create a new test project
@source .env; \
testProjectName="$$PROJECT_NAME".Tests; \
echo "Creating new xUnit project called $$testProjectName"; \
dotnet new xunit -o $$testProjectName; \
dotnet sln add $$testProjectName/$$testProjectName.csproj; \
dotnet add $$testProjectName reference $$PROJECT_FILE;

.PHONY: installpackage
installpackage: ## Install a package to the project
@source .env; \
echo "Select a project to install the package into"; \
PS3="Selection: "; \
select opt in $$(ls */*.csproj); do \
if [ -n "$$opt" ]; then \
echo "You have selected $$opt"; \
break; \
else \
echo "Invalid selection. Please try again."; \
fi; \
done; \
echo "Enter the package name to install: "; \
read packageName; \
echo "Installing $$packageName to $$opt"; \
dotnet add $$opt package $$packageName;

.PHONY: testall
testall: ## Run all tests.
@source .env; \
source .test.env; \
dotnet test

.PHONY: test
test: ## Run a single test.
@source .env; \
source .test.env; \
dotnet test --no-restore --list-tests | \
grep -A 1000 "The following Tests are available:" | \
awk 'NR>1' | \
cut -d ' ' -f 5- | \
sed 's/(.*//i' | \
sort | uniq | \
fzf | \
xargs -I {} dotnet test --filter {} --logger "console;verbosity=detailed"

##@ Build

.PHONY: build
build: ## Build the test project
dotnet build
102 changes: 93 additions & 9 deletions integration-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"update_catalog": true,
"support_level": "kf-supported",
"release_dir": "kubernetes-orchestrator-extension\\bin\\Release",
"release_dir": "k8s-orchestrator\\bin\\Release",
"about": {
"orchestrator": {
"keyfactor_platform_version": "10.x",
Expand Down Expand Up @@ -135,6 +135,20 @@
"Remove": true
},
"Properties": [
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand Down Expand Up @@ -244,6 +258,20 @@
"DefaultValue": null,
"Required": false
},
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand Down Expand Up @@ -305,6 +333,20 @@
"DefaultValue": "default",
"Required": false
},
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand Down Expand Up @@ -358,6 +400,14 @@
"Remove": true
},
"Properties": [
{
"Name": "KubeSecretType",
"DisplayName": "Kube Secret Type",
"Type": "String",
"DependsOn": "",
"DefaultValue": "pkcs12",
"Required": true
},
{
"Name": "KubeSecretKey",
"DisplayName": "Kube Secret Key",
Expand Down Expand Up @@ -398,6 +448,20 @@
"DefaultValue": null,
"Required": false
},
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand All @@ -422,14 +486,6 @@
"DefaultValue": "true",
"Required": true
},
{
"Name": "KubeSecretType",
"DisplayName": "Kube Secret Type",
"Type": "String",
"DependsOn": "",
"DefaultValue": "pkcs12",
"Required": true
},
{
"Name": "StorePasswordPath",
"DisplayName": "StorePasswordPath",
Expand Down Expand Up @@ -491,6 +547,20 @@
"DefaultValue": "secret",
"Required": true
},
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand Down Expand Up @@ -568,6 +638,20 @@
"DefaultValue": "tls_secret",
"Required": true
},
{
"Name": "SeparateChain",
"DisplayName": "Separate Certificate Chain",
"Type": "Bool",
"DefaultValue": "false",
"Required": false
},
{
"Name": "IncludeCertChain",
"DisplayName": "Include Certificate Chain",
"Type": "Bool",
"DefaultValue": "true",
"Required": false
},
{
"Name": "ServerUsername",
"DisplayName": "Server Username",
Expand Down
Loading

0 comments on commit d94803e

Please sign in to comment.