I think so, thanks.
What I did was to create a daemon whose responsibility it is to handle all
interactions with Jira. It receives messages, interacts with Jira based on
those messages, and sometimes sends messages with the stuff that it found.
Such a daemon would often find it useful to keep a persistent, 'good'
connection to Jira ongoing.
The daemon also supports the idea of multiple passwords for a given
userid/connection string, and it'll automatically iterate through them
until it finds one that works.
This is very useful during password rotations.
Anyway, the idea is that as it iterates through the list, it calls ->new on
each one. But ->new doesn't really do anything except setup data
structures. (which is good practice in my opinion.) So I then need to do
some kind of operation to see if that was a good password. Right now, I'm
doing:
my $jql = 'summary ~ e';
eval {
my $results = $connection->search_issues($jql, 0, 1);
};
which is rather horrific, but it works for now.
So yeah, the basic use case is to validate that a given username/password
tuple will actually pass authentication.
Cheers,
-Dana
On Tue, May 13, 2014 at 11:38 AM, Michael Friedman via RT <
bug-JIRA-Client-Automated@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=95502 >
>
> Thanks for your kind words!
>
> I think the module could offer something like the "myself" call, which
> returns information about the currently logged-in user. That would let you
> know if you had logged in successfully, but wouldn't tell you much about
> permissions. The trouble with permissions in JIRA is they can be set
> project-by-project and issue-by-issue, so everything you try to do can have
> completely different permissions on different JIRA installations. There
> isn't a way to tell that you can do "stuff". You can detect if you have
> permission to do each action you attempt, but it's probably not worth
> building that kind of pre-permission-checking in. It'd be easier to do the
> action and see it fail.
>
>
https://docs.atlassian.com/jira/REST/ondemand/#d2e2643
>
> Would the 'I am logged in' check help out with your need?
> -- Michael
>
> On Fri May 09 11:26:24 2014, DIEDERICH wrote:
> > ...without having to actually take a 'substantive' action.
> >
> > I don't know the JIRA API, but this would be something like DBI ping.
> > A very light-weight way to be sure that you'll be able to take a
> > substantive action.
> >
> > Great module, it's a joy to work with. Thanks Michael.
>
>
>