Skip to content

Commit

Permalink
Feature/update go modules (#6)
Browse files Browse the repository at this point in the history
* adding in alpine into build

* updating tag in action

* updating build for containers plugin

* Updating readme and workflow

* Updating readme and workflow

* Adding in version file

* Adding change log

* Updating golang version and modules + tidy up

* Adding back value to go.sum

* updating ci to build with go 1.21

* Bumping version

* Removing commented import
  • Loading branch information
kingcdavid authored Apr 4, 2024
1 parent db39b0c commit 8dab8af
Show file tree
Hide file tree
Showing 13 changed files with 461 additions and 1,337 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.private
vault
main
release/*
.vscode
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.1] - 2024-03-27
### Changed
- Updated all go dependancies
- Stubbed TestCase and TestStep from github.com/hashicorp/vault/helper/testhelpers/logical to avoid loading vault as a module
- Updated action to build with golang version 1.21

### Fixed
- Fixed test_and_cover.sh script to exit 1 on any error


## [v1.0.1] - 2024-03-27
### Changed
Expand Down
5 changes: 2 additions & 3 deletions backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"encoding/base64"
"encoding/json"
"encoding/pem"
"io/ioutil"
"net/url"
"os"
"strings"
Expand Down Expand Up @@ -42,12 +41,12 @@ func loadAtlasTestCreds() (*TestCreds, error) {
json.NewDecoder(apif).Decode(&apiOut)

// Read Cert
clientCertFile, err := ioutil.ReadFile(testKeyLocation + "cert.pem")
clientCertFile, err := os.ReadFile(testKeyLocation + "cert.pem")
if err != nil {
return nil, err
}

clientCertKeyFile, err := ioutil.ReadFile(testKeyLocation + "key.pem")
clientCertKeyFile, err := os.ReadFile(testKeyLocation + "key.pem")
if err != nil {
return nil, err
}
Expand Down
12 changes: 7 additions & 5 deletions cert_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ type dataBundle struct {
}

// creationParameters are the values provided by vault issuance calls, this comes from Vault PKI;
// maintained to support translation and future parameter support.
//
// maintained to support translation and future parameter support.
type creationParameters struct {
Subject pkix.Name
DNSNames []string
Expand Down Expand Up @@ -431,7 +432,8 @@ func parseOtherSANs(others []string) (map[string][]string, error) {
}

// trustChainToBlocks is an atlas helper, that converts the pem trust chain to golang certificate blocks.
// It uses some Vault PKI helpers, which is why it resides here.
//
// It uses some Vault PKI helpers, which is why it resides here.
func trustChainToBlocks(ctx context.Context, client atlas.Client) ([]*certutil.CertBlock, error) {
trustChain, err := client.GetTrustChain(ctx)
if err != nil {
Expand All @@ -452,8 +454,9 @@ func trustChainToBlocks(ctx context.Context, client atlas.Client) ([]*certutil.C
// generateCert Generates a Keypair and Issues a certificate through ATLAS.
//
// This code is derrived from Vault PKI to maintain interface support. CA validation behavior
// has been removed as Atlas holds the CA, and CSR generation has been ported to a struct to support reusability,
// finnally Issuance goes through the atlas client which is appended to the pre-existing signature.
//
// has been removed as Atlas holds the CA, and CSR generation has been ported to a struct to support reusability,
// finnally Issuance goes through the atlas client which is appended to the pre-existing signature.
func generateCert(ctx context.Context,
b *Backend,
data *dataBundle,
Expand Down Expand Up @@ -1026,7 +1029,6 @@ func addKeyUsages(data *dataBundle, certTemplate *x509.Certificate) {
}

// addPolicyIdentifiers adds certificate policies extension
//
func addPolicyIdentifiers(data *dataBundle, certTemplate *x509.Certificate) {
for _, oidstr := range data.params.PolicyIdentifiers {
oid, err := stringToOid(oidstr)
Expand Down
96 changes: 83 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,92 @@
module github.com/globalsign/atlas-hashicorp-vault

go 1.12
go 1.21

require (
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef
github.com/davecgh/go-spew v1.1.1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/fatih/structs v1.1.0
github.com/go-test/deep v1.0.7
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-hclog v0.14.1
github.com/hashicorp/vault v1.6.0
github.com/hashicorp/vault/api v1.0.5-0.20201001211907-38d91b749c77
github.com/hashicorp/vault/sdk v0.1.14-0.20201109203410-5e6e24692b32
github.com/mitchellh/mapstructure v1.3.3
github.com/go-test/deep v1.1.0
github.com/hashicorp/errwrap v1.1.0
github.com/hashicorp/go-hclog v1.6.2
github.com/hashicorp/vault/api v1.12.2
github.com/hashicorp/vault/sdk v0.11.0
github.com/mitchellh/mapstructure v1.5.0
github.com/ryanuber/go-glob v1.0.0
github.com/stretchr/testify v1.6.1
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
golang.org/x/net v0.0.0-20200625001655-4c5254603344
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.21.0
golang.org/x/net v0.22.0
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v25.0.2+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/frankban/quicktest v1.14.6 // indirect
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-kms-wrapping/entropy/v2 v2.0.1 // indirect
github.com/hashicorp/go-kms-wrapping/v2 v2.0.16 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/mlock v0.1.3 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect
github.com/hashicorp/go-secure-stdlib/plugincontainer v0.3.0 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.6 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/joshlf/go-acl v0.0.0-20200411065538-eae00ae38531 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/globalsign/atlas-hashicorp-vault v0.0.0 => ./
Loading

0 comments on commit 8dab8af

Please sign in to comment.