-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
add cli describer for oauthtokens #9032
add cli describer for oauthtokens #9032
Conversation
formatMeta(out, oAuthAccessToken.ObjectMeta) | ||
formatString(out, "Client Name", oAuthAccessToken.ClientName) | ||
formatString(out, "Expires In", oAuthAccessToken.ExpiresIn) | ||
formatString(out, "Redirect URI", oAuthAccessToken.RedirectURI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this value is very useful. The redirect already happened and someone doing a post-mortem on a token will have the json.
Looks good, the output just needs a little swizzling. |
9bc0497
to
d15b954
Compare
Updated output:
|
expires in should either be an absolute date, or relative to the current time |
Do you happen to know the answer to my question; #9032 (comment) ? |
@juanvallejo found it . |
Updated expiration time to absolute date (helper functions that we have fail to correctly handle a time difference longer than 24h so not using FormatRelativeTime for now, I will submit another pull request addressing this). Updated console output:
|
@deads2k
|
formatString(out, "Expires In", formatToHumanDuration(timeExpired.Sub(time.Now()))) | ||
formatString(out, "User Name", oAuthAccessToken.UserName) | ||
formatString(out, "User UID", oAuthAccessToken.UserUID) | ||
formatString(out, "Refresh Token", oAuthAccessToken.RefreshToken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't provide these yet. Remove this line.
Can you show me an example 6 months in the future? |
@@ -118,6 +118,16 @@ var timeNowFn = func() time.Time { | |||
return time.Now() | |||
} | |||
|
|||
func TimeNowFn() time.Time { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you exposing this?
@deads2k Output on token with expiration date 6months in the future:
|
Ok, go ahead and squash down |
creationTimestamp: 2016-05-27T15:06:11Z | ||
deletionTimestamp: 2016-11-28T15:06:11Z | ||
name: DYGZDLucARCPIfUeKPhsgPfn0WBLR_9KdeREH0c9iod | ||
resourceVersion: "5338" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove creation,deleteion,resourceversion,selflink,uid
0d3243d
to
a353593
Compare
@deads2k Okay, revised |
lgtm [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4176/) (Image: devenv-rhel7_4293) |
Evaluated for origin merge up to a353593 |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to a353593 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4167/) |
Adds a command line describer for OAuth tokens:
oc describe oauthaccesstoken <token-name>
fixes #9012