Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

feat(whoami): return accounts and account ids on whoami #983

Merged
merged 4 commits into from
Feb 14, 2020

Conversation

ashleygwilliams
Copy link
Contributor

@ashleygwilliams ashleygwilliams commented Jan 6, 2020

fixes #630

Screen Shot 2020-01-07 at 12 07 16 PM
Screen Shot 2020-01-07 at 12 09 48 PM
Screen Shot 2020-01-07 at 12 13 10 PM

@ashleygwilliams ashleygwilliams added this to the 1.8.0 milestone Jan 6, 2020
@ashleygwilliams ashleygwilliams force-pushed the existential-crisis branch 3 times, most recently from 5a1db3f to bec7cb7 Compare January 7, 2020 18:10
@ashleygwilliams ashleygwilliams changed the title [WIP] feat(whoami): return accounts and account ids on whoami feat(whoami): return accounts and account ids on whoami Jan 7, 2020
@ashleygwilliams ashleygwilliams modified the milestones: 1.8.0, 1.7.0 Jan 7, 2020
@ashleygwilliams ashleygwilliams requested a review from a team January 7, 2020 18:13
src/commands/whoami/mod.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

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

just a couple of things, not much

Comment on lines 42 to 47
match user {
GlobalUser::TokenAuth { .. } => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we use if let syntax here instead of match

if let GlobalUser::TokenAuth { .. } = user {

Copy link
Contributor

Choose a reason for hiding this comment

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

i think the match is more appropriate, fwiw.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's only matching on one thing, i think generally if let fits that model better, it doesn't need an else and would eliminate the _ => ()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you say more about why you want if let?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(there's no assignment here so i am less inclined)

src/commands/whoami/mod.rs Outdated Show resolved Hide resolved
src/commands/whoami/mod.rs Outdated Show resolved Hide resolved
@ashleygwilliams ashleygwilliams changed the title feat(whoami): return accounts and account ids on whoami [WIP] feat(whoami): return accounts and account ids on whoami Jan 8, 2020
@ashleygwilliams ashleygwilliams modified the milestones: 1.7.0, 1.8.0 Feb 5, 2020
@ashleygwilliams ashleygwilliams changed the title [WIP] feat(whoami): return accounts and account ids on whoami feat(whoami): return accounts and account ids on whoami Feb 14, 2020
@ashleygwilliams ashleygwilliams modified the milestones: 1.8.0, 1.8.0-rc.1 Feb 14, 2020

if let GlobalUser::TokenAuth { api_token: _ } = user {
if accounts.is_empty() {
println!("Your token is missing the 'Account Settings: Read' permission.\n\nPlease generate and auth with a new token that has these perms to be able to list your accounts.\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

accessibility nit: auth -> authenticate, perms -> permissions

Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper Feb 14, 2020

Choose a reason for hiding this comment

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

also may be worth linking to the api token page if possible https://dash.cloudflare.com/profile/api-tokens

Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

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

lgtm! i think we should do the auto-fill feature in a separate PR

email
);
message::info(&msg);
println!("\n{} You are logged in with {}.\n", emoji::WAVING, auth,);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use message? it's fine but i've been seeing this a lot lately, maybe our message module is not serving us well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ur not wrong. as said in air- the table would be offset if i used messaged because it would print INFO.

@EverlastingBugstopper EverlastingBugstopper merged commit 57c95c7 into master Feb 14, 2020
@delete-merged-branch delete-merged-branch bot deleted the existential-crisis branch February 14, 2020 23:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

whoami should display account_id
3 participants