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

Refactor sshhost whitelist #522

Merged
merged 3 commits into from
Jun 8, 2020
Merged

Conversation

matthu017
Copy link
Contributor

@matthu017 matthu017 commented Jun 3, 2020

Uses chaining instead of destructuring to make code more readable

similar to optional chaining
@matthu017
Copy link
Contributor Author

Branch using destructuring here: #519

@ericfranz ericfranz changed the base branch from master to sshhost_whitelist June 4, 2020 18:29
.filter(config => (config.v2 && config.v2.login && config.v2.login.host) && ! (config.v2 && config.v2.metadata && config.v2.metadata.hidden))
.forEach((config) => {
let host = config.v2.login.host; //Already did checking above
let isDefault = config.v2 && config.v2.login && config.v2.login.default;
Copy link
Contributor

Choose a reason for hiding this comment

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

We filter out configs that do not have v2.login.host set, so we don't need to repeat the checks here. config.v2.login.default is fine.

Copy link
Contributor Author

@matthu017 matthu017 Jun 5, 2020

Choose a reason for hiding this comment

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

Matthew Hu and others added 2 commits June 5, 2020 14:01
will return undefined if doesn't exist
@ericfranz ericfranz merged commit d031d32 into sshhost_whitelist Jun 8, 2020
@ericfranz ericfranz deleted the refactor_sshhost_whitelist branch June 8, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants