I'm putting the finishing touches on an Ansible lookup plugin that works with the 1PW CLI. Everything is working, but there's one problem I haven't been able to solve reliably: determining whether a user is currently signed in. I can check for the presence of the environment variable, but that doesn't tell me if the session has just timed out.
What I'm currently doing is attempting to get a fake item (
op get item notanitem) and then checking the return code and stdout for the string
"You are not currently signed in.". That works, but it's inelegant and more tightly bound than I'd prefer (breaking if you change the message, for example). It's also slower than it needs to be.
Is there any better way of doing this right now? If not, consider this a feature request.
1Password Version: CLI 0.3
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided