I am trying to determine the currently logged-in user from a shared library programmatically via the API. Other users reported the same issue in other tickets but all of them have been closed without giving additional guidance.
https://issues.jenkins-ci.org/browse/JENKINS-14605
https://issues.jenkins-ci.org/browse/JENKINS-55245
The closing reason has been:
Remember that these methods are generally only meaningful within the dynamic scope of an HTTP request or CLI command. Use the dev mailing list or IRC if you still have issues.
Having to call the REST API from a shared library is extremely backwards and cumbersome. You will also have to know the Jenkins URL which you'll likely have to pass into the shared library.
Obviously the other users asked how to make this happen from pipeline code. Can you clarify if this is possible right now and provide a working example? If it is not possible right now, are you planning to work on a fix?