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

Identify session invalidity #196

Closed
khmarbaise opened this issue Jul 24, 2018 · 5 comments
Closed

Identify session invalidity #196

khmarbaise opened this issue Jul 24, 2018 · 5 comments

Comments

@khmarbaise
Copy link

  • Overview
    Lets say I've worked a time with the command line client and than make a break ..
    afterwards I use another command and I'm prompted with the password input...

  • Suggestion
    It would be great having a command which tell me that the session has expired and I need to do relogin (type i my password). This would be great for scripting to show the user an explicit message "you have to login".
    this would prevent scripts from eating up the password dialog (? Jira Password [username]:)if the output has been redirected...

  • Idea
    go-jira session

  • return code:

    • 0 session is valid.
    • 1 session is invalid. Need to do login

Another idea would be to have an explicit return code in each command could tell me the same.

BTW: Really great tool very helpful.

@coryb
Copy link
Contributor

coryb commented Jul 29, 2018

You might want to use a tool like pass to store your secrets in a gpg agent or system keychain, not sure if that would solve your problem (ie reduce or eliminate the password prompt all-together).

Maybe you can use jira login to authenticate with the service before moving on to your automation?

@khmarbaise
Copy link
Author

The first sentence would be a solution..

The second is exactly what I like to prevent cause if someone runs a script which contains a command like jira whatever .. in particular if it is redirected for scripting the problem arises (the script would stop and based on the redirection you can't see the password prompt). At the moment I have no option/command to check if I need to do a jira login before I can continue..

Maybe it would be possible having a return code saying you are not logged in anymore you have to use jira login ...which could be handled in scripts.....

Maybe I misunderstand a thing...at the moment...nevertheless thanks for your answer...

@coryb
Copy link
Contributor

coryb commented Jul 29, 2018

Okay, this sort of functionality seems to be getting harder with Jira. They are moving away from the cookie based sessions and moving towards requiring basic auth for every request, at least they have dropped support for session based authentication on hosted atlassian.net services.

I assume you are using a locally hosted jira that still supports the session API? I should be able to add a jira session command pretty easily to report current session details although I don't think I have any running services where I can test this (I use hosted atlassian.net for testing).

coryb added a commit that referenced this issue Jul 29, 2018
@coryb
Copy link
Contributor

coryb commented Jul 29, 2018

Added jira session command in latest release, hopefully it will work for your needs.

@coryb coryb closed this as completed Jul 29, 2018
@khmarbaise
Copy link
Author

Wow ...great...I will try within the next days..Thanks for your support..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants