Display custom greetings upon successfull login
It seems useful to be able to display a custom greetings prompt upon successful login (e.g; role of the CF target, pointer to documentation...).
Additional meta data about the current target (such as the support URL) could be displayed within the cf api or cf target command.
The v2/info endpoint returns a description field which can be set in the cf-release manifest (with a default empty value). It would be a nice to display this field or a alternatively a new custom field returned in the /v2/info to be defined (e.g. greeting-prompt), as to preserve backward compatibility for existing Cf deployments that do currently return a non-empty description.
Command
cf login
Expected outpout
Given a description field set to Welcome to pre-prod instance. Planned maintenance on 24/08 8 pm. then the login displays the following prompt:
cf login
[...]
Authenticating...
[...]
OK
Welcome to pre-prod instance. Planned maintenance on 24/08 8 pm.
Use 'cf target' to view or set your target org and space
CLI Version
cf version 6.20.0+25b1961-2016-06-29
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/127095437
The labels on this github issue will be updated when the story is started.
@SocalNick @Amit-PivotalLabs I like this idea. Do you have any concerns with us printing /v2/info's description field? Are we aware of installations where its value is used for other purposes?
I don't see an issue. It's an unauthenticated endpoint anyways:
$ curl -s https://api.run.pivotal.io/v2/info | jq .description
"Cloud Foundry sponsored by Pivotal"
+1
Sent from my iPhone
On Jul 26, 2016, at 6:26 PM, Amit Gupta [email protected] wrote:
I don't see an issue. It's an unauthenticated endpoint anyways:
$ curl -s https://api.run.pivotal.io/v2/info | jq .description "Cloud Foundry sponsored by Pivotal" — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@gberche-orange
About the timing of displaying the greeting (refer to this output example):
- Before authentication allows the following:
- Reminds the user what environment they're connecting to (staging/pre-prod/prod) before they enter their credentials (as those may depend on the target environment).
- Allows the CF operator to (out of bounds) host a dummy /v2/info JSON file at the endpoint url with the maintenance notification during the maintenance period, useful if the subsequent authentication may fail.
- After authentication before the org/space selection:
- Reminds the user what environment they're connecting to (staging/pre-prod/prod) as it may influence the org/space name they want to connect to.
- After the org/space selection, where it lists the summary of targeted API endpoint, User, Org and Space:
- Any text above may have scrolled off the screen (especially if they didn't use
-oand the cli prints their 50 orgs): The greeting stands out best near the end of the command completion.
- Any text above may have scrolled off the screen (especially if they didn't use
Of course we could display messages at each step if CC (@SocalNick) exposes more fields, but for the initial solution, do you have a preference?
I'm leaning towards the first option because of its benefits, and also as it aligns well with what I see on my ftp server (not sure how that's set up though, but it displays a welcome message right after a one-line Connected to ftp.example.com and before asking my credentials):
diesk@cloud-cf:~/workspace$ cf login
API endpoint: https://api.bosh-lite.com
Welcome to pre-prod instance. Planned maintenance on 24/08 8 pm.
Email>
thanks @dkoper for considering this idea!
I agree with starting in a first simple step by displaying the normalized description field before authentication in the cf login and potentially cf auth command.
2nd step could be displaying the support address possibly in the cf help output
3rd step could be documenting extra custom keys that cf-release already supports through cc.info.custom keys.
For example, a documented convention name of a cli.greetings.target custom key that would display a greeting message as part of the cf target command. Such message could be more frequently updated by paas operators in order to notify users that benefit from automatically refreshed oauth tokens and would not otherwise frequently see the login greetings. Typical values for cli.greetings.target could be planned maintenance in 2 hours, or in progress maintenance affecting webui, check status on https://slack.my.org)
I have some concerns:
- There is only one
descriptionfield. I doubt it's localised and follows the API caller's Accept-Language header in picking what language to return. I need to check with @SocalNick whether localisation is implemented/planned, or whether we should define separate custom keys for that (cli.greetings.api.fr-FR, etc.) and let cf CLI pick the appropriate language. - cf CLI only calls the
/v2/infoAPI when runningcf apiorcf login -a. Acf loginwithout-a, orcf targetwould either display a stale message (in particular with planned maintenance), or we'd have to make additional calls for certain commands. We use/v2/infofor service discovery, not as a message board, so that requires an architectural discussion. For static info ("Welcome to pre-prod") this is less of a concern, we could cache it in ~/.cf/config.json.
We have no plans for localization that I'm aware of.
@gberche-orange Hi. This sounds like a nice-to-have feature, but I'm not sure we'll get to it. How often are you and your colleagues logging in? What have you been doing instead? Thanks!
@jbpivotal our UAA is configured to expire token every 24 hours, and triggers CLI relogging. We instead publish status pages with users provided the ability to poll RSS flows. However, this gets uncorrelated from the CF UX, especially when dealing with multiple CF API endpoints (be them per site/region, or prod/non-prod etc...)
With the GA of the v7 CLI, we're no longer actively developing against the v6 line. With an interest the overall hygiene of the CLI project we're closing this issue. If this issue is still occurring in v7 please feel free to comment and re-open. Thank you!
Hi @heyjcollins This feature request is still of interest against v7. Github does not allow non project members to reopen issues, would you mind reopening it ? This would avoid me resubmitting a duplicate and scattering comments and history ?