Skip to content

Commit

Permalink
v0.6.0 release (upgrade Azure array version to 6.1.8. Deactivation fo…
Browse files Browse the repository at this point in the history
…r Azure. Fix for #3)
  • Loading branch information
ps-dbutler committed Aug 3, 2021
1 parent 38976cd commit eb74248
Show file tree
Hide file tree
Showing 1,404 changed files with 15,941 additions and 1,771 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
**/.terraform.lock.hcl

/.build/
/.build-logs/
**/.vscode/

2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ builds:
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
- '-s -w -X github.dev.purestorage.com/FlashArray/terraform-provider-cbs/version.ProviderVersion={{.Version}}'
goos:
- freebsd
- windows
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.6.0 (Aug 3, 2021)

* Update Purity version of cbs_array_azure from 6.1.7 to 6.1.8
* Deactivation now supported for Azure
* Better handling of SecureString fields, fixes issue #3
* Simplified Azure networking parameters
* Multiple Azure parameters were changed as part of deactivation and networking work, as always refer to the [documentation](docs/resources/array_azure.md)

## 0.5.0 (July 20, 2021)

* Update Purity version of cbs_array_azure from 6.1.6 to 6.1.7
Expand Down
65 changes: 53 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
DEV_PKGDIR := $(HOME)/.terraform.d/plugins/terraform.purestorage.com/flasharray/cbs/
DEV_GOBIN := $(DEV_PKGDIR)/99.99/linux_amd64/
SRC_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SHELL=/bin/bash -eEuo pipefail # Set sane shell options
MAKEFLAGS += -j4
TMPBIN=/tmp/bin
TEST_GPG_FINGERPRINT=47F12A8402BBC3906D7C3FAB78C24746203D8F4E
export GNUPGHOME := /tmp/gnupg
export PATH := $(TMPBIN):$(PATH)

default: build

setup-basic:
@mkdir -p .build-logs/


setup-goreleaser:
@curl -sfLO https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh
@bash goreleaser.sh -b $(TMPBIN) &> /dev/null
@rm goreleaser.sh
# Replace with just this after go 1.16:
# @GOBIN=$(TMPBIN) go install github.com/goreleaser/goreleaser@latest

# CI="" for goreleaser will prevent extra control characters from cluttering
# the logs. See https://github.com/goreleaser/goreleaser/blob/b43a2e95ec03261a847fdf9239100d9d36adc60c/cmd/root.go#L15
test-goreleaser-release: setup-goreleaser setup-basic
@mkdir -p $(GNUPGHOME)
@chmod 0700 $(GNUPGHOME)
@gpg --batch --delete-secret-keys $(TEST_GPG_FINGERPRINT) &>/dev/null || true
@gpg --batch --delete-keys $(TEST_GPG_FINGERPRINT) &>/dev/null || true
@gpg --import < testing/private-key.gpg >> .build-logs/goreleaser-release 2>&1
@GPG_FINGERPRINT=$(TEST_GPG_FINGERPRINT) CI="" goreleaser release --debug --snapshot --rm-dist >> .build-logs/goreleaser-release 2>&1

test-goreleaser-check: setup-goreleaser setup-basic
@CI="" goreleaser check >> .build-logs/goreleaser-check 2>&1

build:
go build

Expand All @@ -16,22 +47,32 @@ install-dev:
GOBIN=$(DEV_GOBIN) go install

install-dev-clean:
rm -rvf $(DEV_PKGDIR)
@rm -rvf $(DEV_PKGDIR)

test-acc-mock:
set -a; . testing/mock.env; go test --tags mock,mock_trace ./cbs -v -timeout 120m

# This part just helps reduce noise, we

test-everything-with-mocks: setup-basic
@set -a; . testing/mock.env; TF_LOG=TRACE TF_LOG_PATH="$(SRC_DIR)/.build-logs/terraform" go test --tags mock ./... -v -timeout 120m \
2>&1 | tee .build-logs/acc-mock | grep -vE '^=== RUN|^--- PASS:|^--- SKIP:|^=== PAUSE|^=== CONT|^PASS|^ok|\[no test files\]'

# The redirections and tee/grep stuff above is to help reduce console noise, we filter out all of the nominal messages, so its easier to see any errors
# the full unfiltered log is in .build-logs/acc-mock

test-vet:
go vet ./cbs
go vet -tags mock ./cbs
@go vet ./cbs
@go vet -tags mock ./cbs

# Tests that should run on each pull request
test-pull-request: test-vet test-acc-mock
test-pull-request: test-vet test-everything-with-mocks test-goreleaser-release test-goreleaser-check

reset-mock-db:
@rm -v .build/test.db

tidy:
go get -u
go mod tidy -v
go fmt ./cbs
go fix ./cbs
go clean ./cbs
go clean --tags mock ./cbs
@go get -u
@go mod tidy -v
@go fmt ./cbs
@go fix ./cbs
@go clean ./cbs
@go clean --tags mock ./cbs
31 changes: 31 additions & 0 deletions auth/bootstrap_interface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright 2021, Pure Storage Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package auth

type Bootstrapper interface {
GenerateSecretPayload(host string, pureuserPrivateKey []byte) ([]byte, error)
}

type SecretPayload struct {
UserName string `json:"user_name"`
Issuer string `json:"issuer"`
ClientID string `json:"client_id"`
KeyID string `json:"key_id"`
RestPrivateKey string `json:"rest_private_key"`
}
Loading

0 comments on commit eb74248

Please sign in to comment.