Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"go get" failure parsing go.mod file #47

Closed
vangent opened this issue Jan 22, 2019 · 17 comments
Closed

"go get" failure parsing go.mod file #47

vangent opened this issue Jan 22, 2019 · 17 comments

Comments

@vangent
Copy link

vangent commented Jan 22, 2019

I have an implicit dependency on this project and when I run go get -u, I get this error:

go: github.com/testcontainers/[email protected]: parsing go.mod: unexpected module path "github.com/testcontainers/testcontainers-go"
@MeneDev
Copy link
Contributor

MeneDev commented Jan 22, 2019

I have an implicit dependency on this project and when I run go get -u, I get this error: ...

@vangent it was renamed from testcontainer to testcontainers (Plural) for consistency reasons.

What's the other project you depend on? I think the right solution would be changing the dependency there. As a quick fix you should be able to override the path in the config of your dependency manager (e.g. Gopkg).

Sent with GitHawk

@vangent
Copy link
Author

vangent commented Jan 23, 2019

I don't know which of my dependencies depend on you. I couldn't tell because "go mod why" failed with the same error. Regardless, I don't own any of them so I couldn't have updated it anyway.

I'm using Go Modules, not a specific dependency manager.

This may just be a side effect of your making a non-backward compatible change, and Go Modules not handling it well.

@VoyTechnology
Copy link

As a temporary workaround you can do this:

in go.mod file:

replace github.com/testcontainers/testcontainer-go => github.com/testcontainers/testcontainers-go v0.0.0-20190108154635-47c0da630f72

It looks like go modules only like tag names with v prefix, so the current 0.0.1 tag does not work. The authors need to re-tag it with v0.0.1.

Thanks to @F21: golang/go#26904 (comment)

@gianarb
Copy link
Member

gianarb commented Jan 23, 2019

Thanks @VoyTechnology I was just looking for that trick!
@vangent sorry about this bad bc break, but changing the name to keep it consistent was kind of a requirement. I hope you will find the library good and you will give it a try!
If the fix works and you are able to understand what project injects our library let me know we will submit a pr to fix it

@vangent
Copy link
Author

vangent commented Jan 23, 2019

Thanks for the tips. It sounds like the only action item for the library author is to retag the release with v0.0.1 instead of 0.0.1, to work well with Go Modules.

@VoyTechnology
Copy link

I think it would be part of the solution, but also finding any libraries which depend on the old version before rename and filing PRs to update them.

@vangent
Copy link
Author

vangent commented Jan 23, 2019

It looks like my problem came from hashicorp -> influxdb:
influxdata/influxdb#11199

@prologic
Copy link

I'm running into this as well from micro/go-plugins#290 :

go: github.com/testcontainers/[email protected]: parsing go.mod: unexpected module path "github.com/testcontainers/testcontainers-go"

@gianarb
Copy link
Member

gianarb commented Feb 27, 2019 via email

@guiguan
Copy link

guiguan commented Feb 27, 2019

@gianarb it looks like a dependency is expecting github.com/testcontainers/testcontainer-go instead of github.com/testcontainers/testcontainers-go when building gocloud.dev. Probably because you renamed the repo. Strange enough, I couldn't use go mod why to figure which sub-module is expecting that. The replace workaround works. Thanks!

@prologic
Copy link

prologic commented Mar 5, 2019

What's the hold-up of getting this fixed for this repo? Can we just re-tag this repo appropriately and move on?

@guiguan
Copy link

guiguan commented Mar 5, 2019

@prologic I think the real problem is not about the tag, but other packages are still using this repo’s old name, the one without s

@prologic
Copy link

prologic commented Mar 5, 2019 via email

@gianarb
Copy link
Member

gianarb commented Mar 7, 2019

There is not a lot that I can do about this issue btw.
Or is somebody has idea just let me know
atm I tagged 0.0.2 and we need to figure out who is using the old name

@VoyTechnology
Copy link

Please please please re-tag with v prefix. v0.0.2

@gianarb
Copy link
Member

gianarb commented Mar 8, 2019 via email

@gianarb
Copy link
Member

gianarb commented Mar 9, 2019

I think we are good for now, And I am gonna keep tagging with the v in front. Sorry about this mess. Closing for now

@gianarb gianarb closed this as completed Mar 9, 2019
al4 added a commit to al4/talebearer that referenced this issue Nov 1, 2021
Talebearer is no longer in use at Starling, and the original repository
has been archived, but I want to preserve the code for my own record.

Initial commit

STAR-9351: Implement read_properties, start writer

STAR-9351: Add input and output file cli args

STAR-9351: Implement WritePropertiesFile

STAR-9351: Start adding vault substitutor

STAR-9351: Initial implementation of vault value replacement

Hard-coded dev token in test....

STAR-9351: Use ! as separator between path and key

STAR-9351: Abstract vault client with interface for testing

STAR-9351: Read vault params from env, fix test

STAR-9351: Fix panic on missing key in Vault

STAR-9351: Add usage to readme

STAR-9351: Add dockerfile, makefile and ssl certs

STAR-9351: Don't specify defaults for file names

STAR-9351: Add help text, build for Linux in makefile

STAR-9351: Add publish to Makefile

STAR-9351: Add tests for substituteValues

STAR-9351: Add more test cases

STAR-9351: Support partial string substitutions

STAR-9351: [readme] s/secrets/secret/g

STAR-9351: [lint] fix missing f

STAR-9351: Sort properties file output

STAR-9351: Implement vault aws auth

STAR-9351: Allow arch to be changed; namespace vault api

STAR-9351: Use new FlagSet for arguments

STAR-9351: Add -inplace option

Also makes writes atomic by writing to a tempfile and renaming

STAR-9351: Fix arguments, improve arg error handling

STAR-9351: Fix make install

STAR-9351: Empty commit to trigger build

STAR-9351: Empty commit to trigger build

STAR-9351: Commit dummy file to trigger build

STAR-9351: Remove -v parameter

As it is not valid for the talebearer app, it causes an error, as
testing is imported without flag.Parse being called. It's complicated 😞

STAR-9351: Testing go get importpath change

STAR-9351: Update build task

STAR-9351: Create symlinks for libc - alpine uses musl

STAR-9351: new dockerfile WIP

STAR-9351: Build statically linked binary inside container

STAR-9351: Go back to previous minimal container

STAR-9351: Detect GOOS using uname

STAR-9351: Can't do interactive with no tty on teamcity

STAR-9351: Move ssl certs to /usr/local/share/ca-certificates

NO-JIRA: Remove dummy file

STAR-9351: Add some more useful logging

And remove the readProperties output as it could (but should not)
contain secrets

STAR-9351: Fix missing token in client

STAR-9351: Copy file

STAR-9351: Fix

STAR-9351: Accept default password

STAR-9351: Default password Catch-all

STAR-9351: Don't exit on sealed vault

Tidy propertiesFile.go

Create tempfile in same directory as destination

This should guarantee that os.Rename will work!

STAR-10093: Refactor talebearer to handle generic files

STAR-10093: Add verbose get mode

STAR-10039: Remove password logging

Fix segv in secret.go when err is nil (#7)

* Fix segv when err is nil

* Break out error logging in secret.go

STAR-9526: Fix empty strings (#9)

* STAR-9351: Return errors from getClient and catch in main()

I think this is a bit tidier, as it properly returns errors from
getClient rather than just logging the error but otherwise indicating
success.

Also fixed a log line not formatting correctly

* STAR-9351: Continue on vault client error

* Fix subsitution of empty strings when secret fetch fails

* Fix pointer dereference in VaultSecret

* Also dereference VaultSecret in Retrieve()

* Fix accidentally added test/log lines

* Reinstate fallback log (used in grafana to detect fallbacks)

* Remove extra log message

STAR-11384: Refactoring and integration testing (#11)

Lock dependencies and convert to multi-stage Docker build (#10)

* Locked dependencies with `dep init`

* Add vendor dir to gitignore

* Add application build to Dockerfile

No need to call Makefile any more

* Docker build no longer depends on a separate step

STAR-14881: Alpine, Golang and Vault upgrade (#13)

* NOJIRA: formatting

* STAR-14881: Bump alpine

* NOJIRA: Don't try to parse -test flags

* NOJIRA: Re-initialise dep

* NOJIRA: Don't manually install testify

Should remove its use really, and is installed by dep

* NOJIRA: Add go module files

Don't crash when VAULT_SKIP_VERIFY is set (#14)

STAR-17402: Build toolchain update (#15)

* STAR-17402: Fix linting problems in talebearer.go

* STAR-17402: Add dockerignore

* STAR-17402: Update gitignore

* STAR-17402: Add gometalinter to docker build

* STAR-17402: Fix go lint errors

* STAR-17402: Add gometalinter to make test

* STAR-17402: Go mod init && go mod tidy

* STAR-17402: Remove dep metadata

* STAR-17402: Remove Vagrantfile

* STAR-17402: Refresh go module

* STAR-17402: Update makefile after move to go module

* STAR-17402: Handle errors when closing/removing tempfile

* STAR-17402: Don't remove temp properties file

It gets renamed, so would normally fail

* STAR-17402: Remove unused propertiesFile.go

* STAR-17402: Bump image version in make build

* STAR-17402: Fix build, temporarily disable gometalinter

* STAR-17402: Fix make test

* STAR-17402: Remove GOPATH from Dockerfile

STAR-17402: Import vault client from vaultsmith (#16)

* STAR-17402: Add vault client from vaultsmith

Copy-paste job for now, but could be made separate module in future

* STAR-17402: Update tests for new mock vault client

* STAR-17402: Add TestRunCallsAuthenticate

* STAR-17402: Add Docstrings to vault/mock

* STAR-17402: Use vault's own DefaultConfig() function for vault config

* STAR-17402: Add apiVersion to BaseClient

* STAR-17402: Setup logrus

STAR-17402: Support -continue-on-error flag (#17)

* STAR-17402: Replace prints with log

* STAR-17402: Continue when secrets fail to resolve

* STAR-17402: Continue on error in RenderSecrets

Panicing was a problem here

* STAR-17402: Tidy error strings in Retrieve

Use single line for logging purposes (likely to appear out of order in
Kibana)

* STAR-17402: Add example with fallback value

STAR-17402: Handle auth failure properly

- Cleanup some error messages
- Export main run function

STAR-17402: KV v2 support (#18)

* STAR-17402: Re-enabled KV v2

* STAR-17402: Add mock for Hashicorp's vault client

* STAR-17402: Fix and enable gometalinter in builds

* STAR-17402: Shorten the mockVaultClient code

* STAR-17402: Handle auth failure properly

* STAR-17402: Cleanup some error messages

* STAR-17402: Add test for trimBrackets

Linter surfaced this. It looks like trimBrackets assumes that only
groups of two curly braces would be trimmed, but in actual fact it will
remove all of them.

* STAR-17402: Add sort=path to make lint

* STAR-17402: Fix Lint issues from gometalinter

* STAR-17402: Finish/implement secretResolver_test

* STAR-17402: Upgrade gometalinter

* STAR-17402: Disable cache for prod image apk commands

* STAR-17402: Disable gotype lint check

See: alecthomas/gometalinter#91

Compiler would fail to build any code that failed this linter, so it's
not actually very useful at build time.

Developers should rely on their IDE for this, or hook gotype up to their
text editor.

* STAR-17402: Regenerate go module

See testcontainers/testcontainers-go#47

* STAR-17402: Use int for kvApiVersion, add GetSecret

* STAR-17402: Update test names in base_test.go

* STAR-17402: Fixup base_test and client mocking

* STAR-17402: Add test for GetSecret

* STAR-17402: Rename BaseClient.handler to authHandler

* STAR-17402: Add WriteSecret, test for GetSecret

* STAR-17402: Add test for WriteSecret

* STAR-17402: Lint fixes

* STAR-17402: Remove mock of hashicorp vault client

As a general approach I've chosen to go with injecting a dummy http
client.

* STAR-17402: Rename GetSecret to ReadSecret; add WriteSecret to mock

* STAR-17402: go get -u

* STAR-17402: Don't exit on metalinter fail

For some reason, the following errors occur when building in the Docker
container, but not locally:
```
vault/base.go:100:17:warning: unused variable or constant cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (varcheck, varcheck)
vault/base.go:100:17:warning: unused struct field cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (structcheck, structcheck)
vault/base.go:100:17:warning: cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (interfacer, interfacer, maligned, maligned, unconvert, unconvert)
```
All looks like the same thing, but the Auth method signature looks
functionally identical.

* STAR-17402: Fix dummy roundTripper to generate own response

Reusing this object resulted in reading a buffer from the end

* STAR-17402: Remove test prints

* STAR-17402: Add test for vault write

* STAR-17402: Add tests, return error if KV API version unknown

* STAR-17402: Remove kvAPIVersion parameter from client

* STAR-17402: Rename response to secret

* STAR-17402: Support KV v2 in secret

* STAR-17402: Rename tests

* STAR-17402: Add test.properties to gitignore

* STAR-17402: Add test for KV API v2 retrieve

* STAR-17402: Reverse order of api v1 vs v2

A KV API v1 secret called "data" could screw things up here. The way I
see it, better to fail on a KV v1 secret called "data" than v2.

* STAR-17402: Add warning for secret called data

* STAR-17402: Reflect actual v2 secret structure in test

* STAR-17402: Failed attempt to predetermine secret version

Only the mount response has options, secrets do not

* Revert "STAR-17402: Failed attempt to predetermine secret version"

This reverts commit 244290a15829797c2eda3e43292f8a2751948744.

* STAR-17402: Remove unused mock methods
al4 added a commit to al4/talebearer that referenced this issue Nov 1, 2021
Talebearer is no longer in use at Starling, and the original repository
has been archived, but I want to preserve the code for my own record.

Initial commit

STAR-9351: Implement read_properties, start writer

STAR-9351: Add input and output file cli args

STAR-9351: Implement WritePropertiesFile

STAR-9351: Start adding vault substitutor

STAR-9351: Initial implementation of vault value replacement

Hard-coded dev token in test....

STAR-9351: Use ! as separator between path and key

STAR-9351: Abstract vault client with interface for testing

STAR-9351: Read vault params from env, fix test

STAR-9351: Fix panic on missing key in Vault

STAR-9351: Add usage to readme

STAR-9351: Add dockerfile, makefile and ssl certs

STAR-9351: Don't specify defaults for file names

STAR-9351: Add help text, build for Linux in makefile

STAR-9351: Add publish to Makefile

STAR-9351: Add tests for substituteValues

STAR-9351: Add more test cases

STAR-9351: Support partial string substitutions

STAR-9351: [readme] s/secrets/secret/g

STAR-9351: [lint] fix missing f

STAR-9351: Sort properties file output

STAR-9351: Implement vault aws auth

STAR-9351: Allow arch to be changed; namespace vault api

STAR-9351: Use new FlagSet for arguments

STAR-9351: Add -inplace option

Also makes writes atomic by writing to a tempfile and renaming

STAR-9351: Fix arguments, improve arg error handling

STAR-9351: Fix make install

STAR-9351: Empty commit to trigger build

STAR-9351: Empty commit to trigger build

STAR-9351: Commit dummy file to trigger build

STAR-9351: Remove -v parameter

As it is not valid for the talebearer app, it causes an error, as
testing is imported without flag.Parse being called. It's complicated 😞

STAR-9351: Testing go get importpath change

STAR-9351: Update build task

STAR-9351: Create symlinks for libc - alpine uses musl

STAR-9351: new dockerfile WIP

STAR-9351: Build statically linked binary inside container

STAR-9351: Go back to previous minimal container

STAR-9351: Detect GOOS using uname

STAR-9351: Can't do interactive with no tty on teamcity

STAR-9351: Move ssl certs to /usr/local/share/ca-certificates

NO-JIRA: Remove dummy file

STAR-9351: Add some more useful logging

And remove the readProperties output as it could (but should not)
contain secrets

STAR-9351: Fix missing token in client

STAR-9351: Copy file

STAR-9351: Fix

STAR-9351: Accept default password

STAR-9351: Default password Catch-all

STAR-9351: Don't exit on sealed vault

Tidy propertiesFile.go

Create tempfile in same directory as destination

This should guarantee that os.Rename will work!

STAR-10093: Refactor talebearer to handle generic files

STAR-10093: Add verbose get mode

STAR-10039: Remove password logging

Fix segv in secret.go when err is nil (#7)

* Fix segv when err is nil

* Break out error logging in secret.go

STAR-9526: Fix empty strings (#9)

* STAR-9351: Return errors from getClient and catch in main()

I think this is a bit tidier, as it properly returns errors from
getClient rather than just logging the error but otherwise indicating
success.

Also fixed a log line not formatting correctly

* STAR-9351: Continue on vault client error

* Fix subsitution of empty strings when secret fetch fails

* Fix pointer dereference in VaultSecret

* Also dereference VaultSecret in Retrieve()

* Fix accidentally added test/log lines

* Reinstate fallback log (used in grafana to detect fallbacks)

* Remove extra log message

STAR-11384: Refactoring and integration testing (#11)

Lock dependencies and convert to multi-stage Docker build (#10)

* Locked dependencies with `dep init`

* Add vendor dir to gitignore

* Add application build to Dockerfile

No need to call Makefile any more

* Docker build no longer depends on a separate step

STAR-14881: Alpine, Golang and Vault upgrade (#13)

* NOJIRA: formatting

* STAR-14881: Bump alpine

* NOJIRA: Don't try to parse -test flags

* NOJIRA: Re-initialise dep

* NOJIRA: Don't manually install testify

Should remove its use really, and is installed by dep

* NOJIRA: Add go module files

Don't crash when VAULT_SKIP_VERIFY is set (#14)

STAR-17402: Build toolchain update (#15)

* STAR-17402: Fix linting problems in talebearer.go

* STAR-17402: Add dockerignore

* STAR-17402: Update gitignore

* STAR-17402: Add gometalinter to docker build

* STAR-17402: Fix go lint errors

* STAR-17402: Add gometalinter to make test

* STAR-17402: Go mod init && go mod tidy

* STAR-17402: Remove dep metadata

* STAR-17402: Remove Vagrantfile

* STAR-17402: Refresh go module

* STAR-17402: Update makefile after move to go module

* STAR-17402: Handle errors when closing/removing tempfile

* STAR-17402: Don't remove temp properties file

It gets renamed, so would normally fail

* STAR-17402: Remove unused propertiesFile.go

* STAR-17402: Bump image version in make build

* STAR-17402: Fix build, temporarily disable gometalinter

* STAR-17402: Fix make test

* STAR-17402: Remove GOPATH from Dockerfile

STAR-17402: Import vault client from vaultsmith (#16)

* STAR-17402: Add vault client from vaultsmith

Copy-paste job for now, but could be made separate module in future

* STAR-17402: Update tests for new mock vault client

* STAR-17402: Add TestRunCallsAuthenticate

* STAR-17402: Add Docstrings to vault/mock

* STAR-17402: Use vault's own DefaultConfig() function for vault config

* STAR-17402: Add apiVersion to BaseClient

* STAR-17402: Setup logrus

STAR-17402: Support -continue-on-error flag (#17)

* STAR-17402: Replace prints with log

* STAR-17402: Continue when secrets fail to resolve

* STAR-17402: Continue on error in RenderSecrets

Panicing was a problem here

* STAR-17402: Tidy error strings in Retrieve

Use single line for logging purposes (likely to appear out of order in
Kibana)

* STAR-17402: Add example with fallback value

STAR-17402: Handle auth failure properly

- Cleanup some error messages
- Export main run function

STAR-17402: KV v2 support (#18)

* STAR-17402: Re-enabled KV v2

* STAR-17402: Add mock for Hashicorp's vault client

* STAR-17402: Fix and enable gometalinter in builds

* STAR-17402: Shorten the mockVaultClient code

* STAR-17402: Handle auth failure properly

* STAR-17402: Cleanup some error messages

* STAR-17402: Add test for trimBrackets

Linter surfaced this. It looks like trimBrackets assumes that only
groups of two curly braces would be trimmed, but in actual fact it will
remove all of them.

* STAR-17402: Add sort=path to make lint

* STAR-17402: Fix Lint issues from gometalinter

* STAR-17402: Finish/implement secretResolver_test

* STAR-17402: Upgrade gometalinter

* STAR-17402: Disable cache for prod image apk commands

* STAR-17402: Disable gotype lint check

See: alecthomas/gometalinter#91

Compiler would fail to build any code that failed this linter, so it's
not actually very useful at build time.

Developers should rely on their IDE for this, or hook gotype up to their
text editor.

* STAR-17402: Regenerate go module

See testcontainers/testcontainers-go#47

* STAR-17402: Use int for kvApiVersion, add GetSecret

* STAR-17402: Update test names in base_test.go

* STAR-17402: Fixup base_test and client mocking

* STAR-17402: Add test for GetSecret

* STAR-17402: Rename BaseClient.handler to authHandler

* STAR-17402: Add WriteSecret, test for GetSecret

* STAR-17402: Add test for WriteSecret

* STAR-17402: Lint fixes

* STAR-17402: Remove mock of hashicorp vault client

As a general approach I've chosen to go with injecting a dummy http
client.

* STAR-17402: Rename GetSecret to ReadSecret; add WriteSecret to mock

* STAR-17402: go get -u

* STAR-17402: Don't exit on metalinter fail

For some reason, the following errors occur when building in the Docker
container, but not locally:
```
vault/base.go:100:17:warning: unused variable or constant cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (varcheck, varcheck)
vault/base.go:100:17:warning: unused struct field cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (structcheck, structcheck)
vault/base.go:100:17:warning: cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (interfacer, interfacer, maligned, maligned, unconvert, unconvert)
```
All looks like the same thing, but the Auth method signature looks
functionally identical.

* STAR-17402: Fix dummy roundTripper to generate own response

Reusing this object resulted in reading a buffer from the end

* STAR-17402: Remove test prints

* STAR-17402: Add test for vault write

* STAR-17402: Add tests, return error if KV API version unknown

* STAR-17402: Remove kvAPIVersion parameter from client

* STAR-17402: Rename response to secret

* STAR-17402: Support KV v2 in secret

* STAR-17402: Rename tests

* STAR-17402: Add test.properties to gitignore

* STAR-17402: Add test for KV API v2 retrieve

* STAR-17402: Reverse order of api v1 vs v2

A KV API v1 secret called "data" could screw things up here. The way I
see it, better to fail on a KV v1 secret called "data" than v2.

* STAR-17402: Add warning for secret called data

* STAR-17402: Reflect actual v2 secret structure in test

* STAR-17402: Failed attempt to predetermine secret version

Only the mount response has options, secrets do not

* Revert "STAR-17402: Failed attempt to predetermine secret version"

This reverts commit 244290a15829797c2eda3e43292f8a2751948744.

* STAR-17402: Remove unused mock methods
al4 added a commit to al4/talebearer that referenced this issue Nov 1, 2021
Talebearer is no longer in use at Starling, and the original repository
has been archived, but I want to preserve the code for my own record.

Initial commit

STAR-9351: Implement read_properties, start writer

STAR-9351: Add input and output file cli args

STAR-9351: Implement WritePropertiesFile

STAR-9351: Start adding vault substitutor

STAR-9351: Initial implementation of vault value replacement

Hard-coded dev token in test....

STAR-9351: Use ! as separator between path and key

STAR-9351: Abstract vault client with interface for testing

STAR-9351: Read vault params from env, fix test

STAR-9351: Fix panic on missing key in Vault

STAR-9351: Add usage to readme

STAR-9351: Add dockerfile, makefile and ssl certs

STAR-9351: Don't specify defaults for file names

STAR-9351: Add help text, build for Linux in makefile

STAR-9351: Add publish to Makefile

STAR-9351: Add tests for substituteValues

STAR-9351: Add more test cases

STAR-9351: Support partial string substitutions

STAR-9351: [readme] s/secrets/secret/g

STAR-9351: [lint] fix missing f

STAR-9351: Sort properties file output

STAR-9351: Implement vault aws auth

STAR-9351: Allow arch to be changed; namespace vault api

STAR-9351: Use new FlagSet for arguments

STAR-9351: Add -inplace option

Also makes writes atomic by writing to a tempfile and renaming

STAR-9351: Fix arguments, improve arg error handling

STAR-9351: Fix make install

STAR-9351: Empty commit to trigger build

STAR-9351: Empty commit to trigger build

STAR-9351: Commit dummy file to trigger build

STAR-9351: Remove -v parameter

As it is not valid for the talebearer app, it causes an error, as
testing is imported without flag.Parse being called. It's complicated 😞

STAR-9351: Testing go get importpath change

STAR-9351: Update build task

STAR-9351: Create symlinks for libc - alpine uses musl

STAR-9351: new dockerfile WIP

STAR-9351: Build statically linked binary inside container

STAR-9351: Go back to previous minimal container

STAR-9351: Detect GOOS using uname

STAR-9351: Can't do interactive with no tty on teamcity

STAR-9351: Move ssl certs to /usr/local/share/ca-certificates

NO-JIRA: Remove dummy file

STAR-9351: Add some more useful logging

And remove the readProperties output as it could (but should not)
contain secrets

STAR-9351: Fix missing token in client

STAR-9351: Copy file

STAR-9351: Fix

STAR-9351: Accept default password

STAR-9351: Default password Catch-all

STAR-9351: Don't exit on sealed vault

Tidy propertiesFile.go

Create tempfile in same directory as destination

This should guarantee that os.Rename will work!

STAR-10093: Refactor talebearer to handle generic files

STAR-10093: Add verbose get mode

STAR-10039: Remove password logging

Fix segv in secret.go when err is nil (#7)

* Fix segv when err is nil

* Break out error logging in secret.go

STAR-9526: Fix empty strings (#9)

* STAR-9351: Return errors from getClient and catch in main()

I think this is a bit tidier, as it properly returns errors from
getClient rather than just logging the error but otherwise indicating
success.

Also fixed a log line not formatting correctly

* STAR-9351: Continue on vault client error

* Fix subsitution of empty strings when secret fetch fails

* Fix pointer dereference in VaultSecret

* Also dereference VaultSecret in Retrieve()

* Fix accidentally added test/log lines

* Reinstate fallback log (used in grafana to detect fallbacks)

* Remove extra log message

STAR-11384: Refactoring and integration testing (#11)

Lock dependencies and convert to multi-stage Docker build (#10)

* Locked dependencies with `dep init`

* Add vendor dir to gitignore

* Add application build to Dockerfile

No need to call Makefile any more

* Docker build no longer depends on a separate step

STAR-14881: Alpine, Golang and Vault upgrade (#13)

* NOJIRA: formatting

* STAR-14881: Bump alpine

* NOJIRA: Don't try to parse -test flags

* NOJIRA: Re-initialise dep

* NOJIRA: Don't manually install testify

Should remove its use really, and is installed by dep

* NOJIRA: Add go module files

Don't crash when VAULT_SKIP_VERIFY is set (#14)

STAR-17402: Build toolchain update (#15)

* STAR-17402: Fix linting problems in talebearer.go

* STAR-17402: Add dockerignore

* STAR-17402: Update gitignore

* STAR-17402: Add gometalinter to docker build

* STAR-17402: Fix go lint errors

* STAR-17402: Add gometalinter to make test

* STAR-17402: Go mod init && go mod tidy

* STAR-17402: Remove dep metadata

* STAR-17402: Remove Vagrantfile

* STAR-17402: Refresh go module

* STAR-17402: Update makefile after move to go module

* STAR-17402: Handle errors when closing/removing tempfile

* STAR-17402: Don't remove temp properties file

It gets renamed, so would normally fail

* STAR-17402: Remove unused propertiesFile.go

* STAR-17402: Bump image version in make build

* STAR-17402: Fix build, temporarily disable gometalinter

* STAR-17402: Fix make test

* STAR-17402: Remove GOPATH from Dockerfile

STAR-17402: Import vault client from vaultsmith (#16)

* STAR-17402: Add vault client from vaultsmith

Copy-paste job for now, but could be made separate module in future

* STAR-17402: Update tests for new mock vault client

* STAR-17402: Add TestRunCallsAuthenticate

* STAR-17402: Add Docstrings to vault/mock

* STAR-17402: Use vault's own DefaultConfig() function for vault config

* STAR-17402: Add apiVersion to BaseClient

* STAR-17402: Setup logrus

STAR-17402: Support -continue-on-error flag (#17)

* STAR-17402: Replace prints with log

* STAR-17402: Continue when secrets fail to resolve

* STAR-17402: Continue on error in RenderSecrets

Panicing was a problem here

* STAR-17402: Tidy error strings in Retrieve

Use single line for logging purposes (likely to appear out of order in
Kibana)

* STAR-17402: Add example with fallback value

STAR-17402: Handle auth failure properly

- Cleanup some error messages
- Export main run function

STAR-17402: KV v2 support (#18)

* STAR-17402: Re-enabled KV v2

* STAR-17402: Add mock for Hashicorp's vault client

* STAR-17402: Fix and enable gometalinter in builds

* STAR-17402: Shorten the mockVaultClient code

* STAR-17402: Handle auth failure properly

* STAR-17402: Cleanup some error messages

* STAR-17402: Add test for trimBrackets

Linter surfaced this. It looks like trimBrackets assumes that only
groups of two curly braces would be trimmed, but in actual fact it will
remove all of them.

* STAR-17402: Add sort=path to make lint

* STAR-17402: Fix Lint issues from gometalinter

* STAR-17402: Finish/implement secretResolver_test

* STAR-17402: Upgrade gometalinter

* STAR-17402: Disable cache for prod image apk commands

* STAR-17402: Disable gotype lint check

See: alecthomas/gometalinter#91

Compiler would fail to build any code that failed this linter, so it's
not actually very useful at build time.

Developers should rely on their IDE for this, or hook gotype up to their
text editor.

* STAR-17402: Regenerate go module

See testcontainers/testcontainers-go#47

* STAR-17402: Use int for kvApiVersion, add GetSecret

* STAR-17402: Update test names in base_test.go

* STAR-17402: Fixup base_test and client mocking

* STAR-17402: Add test for GetSecret

* STAR-17402: Rename BaseClient.handler to authHandler

* STAR-17402: Add WriteSecret, test for GetSecret

* STAR-17402: Add test for WriteSecret

* STAR-17402: Lint fixes

* STAR-17402: Remove mock of hashicorp vault client

As a general approach I've chosen to go with injecting a dummy http
client.

* STAR-17402: Rename GetSecret to ReadSecret; add WriteSecret to mock

* STAR-17402: go get -u

* STAR-17402: Don't exit on metalinter fail

For some reason, the following errors occur when building in the Docker
container, but not locally:
```
vault/base.go:100:17:warning: unused variable or constant cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (varcheck, varcheck)
vault/base.go:100:17:warning: unused struct field cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (structcheck, structcheck)
vault/base.go:100:17:warning: cannot use &(credAws.CLIHandler literal) (value of type *github.com/hashicorp/vault/builtin/credential/aws.CLIHandler) as authHandler value in struct literal: wrong type for method Auth (interfacer, interfacer, maligned, maligned, unconvert, unconvert)
```
All looks like the same thing, but the Auth method signature looks
functionally identical.

* STAR-17402: Fix dummy roundTripper to generate own response

Reusing this object resulted in reading a buffer from the end

* STAR-17402: Remove test prints

* STAR-17402: Add test for vault write

* STAR-17402: Add tests, return error if KV API version unknown

* STAR-17402: Remove kvAPIVersion parameter from client

* STAR-17402: Rename response to secret

* STAR-17402: Support KV v2 in secret

* STAR-17402: Rename tests

* STAR-17402: Add test.properties to gitignore

* STAR-17402: Add test for KV API v2 retrieve

* STAR-17402: Reverse order of api v1 vs v2

A KV API v1 secret called "data" could screw things up here. The way I
see it, better to fail on a KV v1 secret called "data" than v2.

* STAR-17402: Add warning for secret called data

* STAR-17402: Reflect actual v2 secret structure in test

* STAR-17402: Failed attempt to predetermine secret version

Only the mount response has options, secrets do not

* Revert "STAR-17402: Failed attempt to predetermine secret version"

This reverts commit 244290a15829797c2eda3e43292f8a2751948744.

* STAR-17402: Remove unused mock methods

Move module to al4/talebearer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants