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

cargo-credential-1password: Add missing --account argument to op signin command #12985

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 16, 2023

What does this PR try to resolve?

Without this the account chooser is shown by the op signin command, even though the user has already specified an account via the --account command line argument to the cargo-credential-1password CLI.

Note that the --vault in this case does not need to be forwarded to op, since it is irrelevant for the op signin command.

How should we test and review this PR?

  • Have a 1password installation with multiple accounts
  • Use global-credential-providers = ["cargo-credential-1password --account my.1password.com"] in the cargo config file
  • Run e.g. cargo publish
  • Notice how you are seeing an account switcher even though --account was used
  • Apply this patch and notice that the account switcher is no longer there and the correct account is selected automatically

Additional information

see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/1password.20credentials.20provider

…ignin` command

Without this the account chooser is shown by the `op signin` command, even though the user has already specified an account via the `--account` command line argument to the `cargo-credential-1password` CLI.

Note that the `--vault` in this case does not need to be forwarded to `op`, since it is irrelevant for the `op signin` command.
@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2023

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-credential-provider Area: credential provider for storing and retreiving credentials S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2023
@weihanglo
Copy link
Member

@Muscraft already got an 1password account so they might be more helpful than me :)

r? Muscraft

@rustbot rustbot assigned Muscraft and unassigned weihanglo Nov 16, 2023
@ehuss
Copy link
Contributor

ehuss commented Nov 16, 2023

I can take this.

r? ehuss

@rustbot rustbot assigned ehuss and unassigned Muscraft Nov 16, 2023
@Muscraft
Copy link
Member

I don't have multiple accounts, so I couldn't verify it would go to the account chooser before this change, but I was able to verify I could sign in after the change.

Note: op signin states this is a way to pick a specific account.

determines which to use in this order:

1. The account specified with the '--account' flag.

@ehuss
Copy link
Contributor

ehuss commented Nov 16, 2023

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 16, 2023

📌 Commit a91cae4 has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2023
@bors
Copy link
Contributor

bors commented Nov 16, 2023

⌛ Testing commit a91cae4 with merge 4f707b5...

bors added a commit that referenced this pull request Nov 16, 2023
cargo-credential-1password: Add missing `--account` argument to `op signin` command

### What does this PR try to resolve?

Without this the account chooser is shown by the `op signin` command, even though the user has already specified an account via the `--account` command line argument to the `cargo-credential-1password` CLI.

Note that the `--vault` in this case does not need to be forwarded to `op`, since it is irrelevant for the `op signin` command.

### How should we test and review this PR?

- Have a 1password installation with multiple accounts
- Use `global-credential-providers = ["cargo-credential-1password --account my.1password.com"]` in the cargo config file
- Run e.g. `cargo publish`
- Notice how you are seeing an account switcher even though `--account` was used
- Apply this patch and notice that the account switcher is no longer there and the correct account is selected automatically

### Additional information

see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/1password.20credentials.20provider
@bors
Copy link
Contributor

bors commented Nov 16, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 16, 2023
@Muscraft
Copy link
Member

The failure was caused by a crates.io deployment. It's being rolled back, see this Zulip comment.

@ehuss
Copy link
Contributor

ehuss commented Nov 16, 2023

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2023
@bors
Copy link
Contributor

bors commented Nov 16, 2023

⌛ Testing commit a91cae4 with merge 8d7ec64...

@bors
Copy link
Contributor

bors commented Nov 16, 2023

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 8d7ec64 to master...

@bors bors merged commit 8d7ec64 into rust-lang:master Nov 16, 2023
18 of 19 checks passed
ehuss pushed a commit to ehuss/cargo that referenced this pull request Nov 17, 2023
…r=ehuss

cargo-credential-1password: Add missing `--account` argument to `op signin` command

### What does this PR try to resolve?

Without this the account chooser is shown by the `op signin` command, even though the user has already specified an account via the `--account` command line argument to the `cargo-credential-1password` CLI.

Note that the `--vault` in this case does not need to be forwarded to `op`, since it is irrelevant for the `op signin` command.

### How should we test and review this PR?

- Have a 1password installation with multiple accounts
- Use `global-credential-providers = ["cargo-credential-1password --account my.1password.com"]` in the cargo config file
- Run e.g. `cargo publish`
- Notice how you are seeing an account switcher even though `--account` was used
- Apply this patch and notice that the account switcher is no longer there and the correct account is selected automatically

### Additional information

see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/1password.20credentials.20provider
bors added a commit that referenced this pull request Nov 17, 2023
[beta 1.75] Backport 1password fixes

This backports these fixes to 1.75 for the cargo-credential-1password helper. I'd like to publish these fixes and get the docs updated sooner rather than later. Unfortunately it uses an unpublished version of cargo-credential, so I can't publish directly from master.

Backports:
* #12985 — cargo-credential-1password: Add missing `--account` argument to `op signin` command
* #12986 — cargo-credential-1password: Fix README
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2023
Update cargo

11 commits in 2c03e0e2dcd05dd064fcf10cc1050d342eaf67e3..9765a449d9b7341c2b49b88da41c2268ea599720
2023-11-16 04:21:44 +0000 to 2023-11-17 20:58:23 +0000
- refactor(toml): Clean up workspace inheritance (rust-lang/cargo#12971)
- docs: Recommend a wider selection of libsecret-compatible password managers (rust-lang/cargo#12993)
- feat(cli): add color output for `cargo --list` (rust-lang/cargo#12992)
- refactor: log when loading config from file (rust-lang/cargo#12991)
- Link to rustc lint levels (rust-lang/cargo#12990)
- chore(ci): Catch naive use of AtomicU64 early (rust-lang/cargo#12988)
- cargo-credential-1password: Add missing `--account` argument to `op signin` command (rust-lang/cargo#12985)
- chore: dogfood Cargo `-Zlints` table feature (rust-lang/cargo#12178)
- cargo-credential-1password: Fix README (rust-lang/cargo#12986)
- Fix a rustflags test using a wrong buildfile name (rust-lang/cargo#12987)
- Fix some test output validation. (rust-lang/cargo#12982)

r? ghost
@ehuss ehuss added this to the 1.76.0 milestone Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-credential-provider Area: credential provider for storing and retreiving credentials S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants