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

Fixes #339: Store multiple Acquia Cloud tokens in local file. #407

Merged
merged 15 commits into from
Feb 4, 2021

Conversation

grasmash
Copy link
Contributor

@grasmash grasmash commented Jan 29, 2021

User Experience:

  1. User runs acli login
    a. If no keys are saved locally, prompt to enter new key.
    b. If keys already exist locally, prompt user to choose among existing keys or create a new key.
    i. If selected existing key, set it as the default key for ACLI.
    ii. If create new key, prompt to enter new key.
  2. User runs acli logout
    a. Unset the default key for ACLI, but do not remove the key from the filesystem.

This PR includes an automated migration path.

src/Command/CommandBase.php Outdated Show resolved Hide resolved
$list = [];
foreach ($items as $item) {
$list[$item->$unique_property] = trim($item->$label_property);
if (is_array($item)) {
$list[$item[$unique_property]] = trim($item[$label_property]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a universal way to access a property that works for both arrays and objects?

@grasmash
Copy link
Contributor Author

grasmash commented Feb 3, 2021

Tests are passing. Code coverage went down 0.02%. I think that may be ok. I don't see any good place to add more test coverage.

src/Command/CommandBase.php Outdated Show resolved Hide resolved
src/Command/CommandBase.php Outdated Show resolved Hide resolved
@grasmash grasmash merged commit a651dbc into acquia:master Feb 4, 2021
@grasmash grasmash deleted the multiple-keys branch February 4, 2021 22:37
@mikemilano mikemilano mentioned this pull request Nov 24, 2021
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants