Skip to content

Conversation

@mohsenari
Copy link
Contributor

Summary

All envsec commands (except ls and exec) use strings.ToLower() when passing EnvId.EnvName that means environments like "DEV" and "PROD" becomes "dev" and "prod" in aws ssm.

This creates a bug where you can set a secret with envsec set key=value but in envsec ls not be able to see that key. This change might be backwards incompatible, but I don't know how envsec at its current state is usable unless someone specifies the environment everytime they set and ls

Screenshot 2023-08-30 at 6 53 31 PM

How was it tested?

  • envsec set testkey=testvalue
  • envsec ls

@mohsenari mohsenari requested review from loreto and mikeland73 August 30, 2023 23:02
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we hold off on the backward incompatible changes until we have a plan for schema?

Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second view, this won't break backwards compatibility because launchapad uses envsec as a library and not a CLI.

This means that:

  • envsec the library is case sensitive.
  • envsec the CLI tool is case insensitive (and stores everything lowercase).

I think this is OK.

Could you also modify the hard coded envNames (in exec.go and ls.go) to be all lower case?

@mohsenari mohsenari merged commit 5f9b49c into main Aug 31, 2023
@mohsenari mohsenari deleted the mohsen--fix-ls-envname-bug branch August 31, 2023 15:22
mikeland73 added a commit that referenced this pull request Oct 11, 2023
## Summary

For launchpad to update we need:

* Allow bootsrapping of a specific envID
* Don't check if flag has changed in the commands themselves.
* Remove `ToLower` Introduced in
#118. This means envsec
will be case sensitive. Note that the comments in that PR are not
strictly correct, most commands do not do `ToLower` on environment, only
`ls` and `exec` did.

## How was it tested?

Compiled launchpad with updated version of envsec and tested envsec
commands (set, ls, exec, rm)
jetpack-io-bot pushed a commit to jetify-com/envsec that referenced this pull request Oct 11, 2023
## Summary

For launchpad to update we need:

* Allow bootsrapping of a specific envID
* Don't check if flag has changed in the commands themselves.
* Remove `ToLower` Introduced in
jetify-com/opensource#118. This means envsec
will be case sensitive. Note that the comments in that PR are not
strictly correct, most commands do not do `ToLower` on environment, only
`ls` and `exec` did.

## How was it tested?

Compiled launchpad with updated version of envsec and tested envsec
commands (set, ls, exec, rm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants