Skip to content

pass: changed the way for checking if password-store is initalized - #124

Merged
vdemeester merged 2 commits into
docker:masterfrom
eyJhb:master
Sep 25, 2018
Merged

pass: changed the way for checking if password-store is initalized#124
vdemeester merged 2 commits into
docker:masterfrom
eyJhb:master

Conversation

@eyJhb

@eyJhb eyJhb commented Sep 22, 2018

Copy link
Copy Markdown
Contributor

Changed the way that docker-credential-helpers check if password-store is initialized.
The current way inserts and removes a password, each time it is called, to make sure that pass is initialized.

This creates a lot of commits if the password-store is made as a git repository (which is quite awful).
The following is how many commits has been made, over a span of ~2 months...

$ git log | grep 'docker-pass-initialized-check' | wc -l
1430

I have changed the way to just do a pass ls, as it will fail if pass is not initialized.
If it should fail, it will fail at a read of pass or insert of pass anyways, and therefore this solution is much more elegant.

@GordonTheTurtle

Copy link
Copy Markdown

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" git@github.com:eyJhb/docker-credential-helpers.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: eyjhbb@gmail.com <eyjhbb@gmail.com>
@eyJhb

eyJhb commented Sep 23, 2018

Copy link
Copy Markdown
Contributor Author

This also fixes #120 #92, since those lines has been removed.

Comment thread pass/pass_linux.go Outdated
// We just run a `pass ls`, if it fails then pass is not initialized.
_, err := p.runPassHelper("", "ls")
if err != nil {
return fmt.Errorf("error initializing pass: %v", err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello @eyJhb,

What do you think about changing the error message to something on these lines?

password-store not initialized: %v.

Since we are not trying to intialize the password-store, this message could confuse users.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! Kept it as pass instead of password-store, hope that is OK :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sure! No problem. 🎉

Thanks for the fix!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem! Just hope that it will get approved and merged at some point, but looking at the other PRs, I am not sure it will happen anytime soon.

…lized

Signed-off-by: eyjhbb@gmail.com <eyjhbb@gmail.com>
@eyJhb

eyJhb commented Sep 24, 2018

Copy link
Copy Markdown
Contributor Author

Just a little ping, @vdemeester @n4ss if you get the time to review and merge this.
Would really like some feedback, and it seems like this can be a somewhat inactive repo at times. :)

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SGTM 🧢

@eyJhb

eyJhb commented Sep 25, 2018

Copy link
Copy Markdown
Contributor Author

Great! Do not hesitate if you have any questions or I need to do anything, so we can get this merged and close the two PRs and the one issue :)

@javabrett

Copy link
Copy Markdown

I've been seeing my pass db for Docker regularly corrupted by insertion and non-deletion of an incomplete docker-pass-initialized-check key, so it would be positive to see this change released promptly from master.

@javabrett

Copy link
Copy Markdown

OK here's another essential tip if you find your pass repo constantly corrupted by incomplete docker-pass-initialized-check:

export GPG_TTY=$(tty)

... so that gpg properly prompts for key passphrase, assuming you have one.

thaJeztah added a commit to thaJeztah/cli that referenced this pull request Jun 11, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jun 20, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f6a4c76fbb6d594f4874dea5059e82eadfae867a
Component: cli
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Jul 4, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Jul 4, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Jul 23, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Aug 8, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Aug 8, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76fbb6d594f4874dea5059e82eadfae867a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 24dcc56123634e048dc0c7d8fa2eeff65b97a33a
Component: cli
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Aug 8, 2019
full diff: docker/docker-credential-helpers@5241b46...8a9f93a

includes:

- docker/docker-credential-helpers#29 C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
- docker/docker-credential-helpers#124 pass: changed the way for checking if password-store is initalized
  - addresses docker/docker-credential-helpers#133 docker-credential-pass commits about 10 times every time I run a docker command
- docker/docker-credential-helpers#143 Fix docker-credential-osxkeychain list behaviour in case of missing entry in keychain
- docker/docker-credential-helpers#139 make docker-credential-wincred work like docker-credential-osxkeychain

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f6a4c76fbb6d594f4874dea5059e82eadfae867a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 11b15544c503d91d8ea3ba782d30d2070a24d84e
Component: cli
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

Successfully merging this pull request may close these issues.

6 participants