Coder Social home page Coder Social logo

jira-okta-puppet's Introduction

What’s this?

This is an automation showcase for setting Jira authentication cookies for go-jira (Jira command line client) using Puppeteer.

Why?

Basically in my current company Jira access is limited to be authenticated through Okta. I hate Jira and I can’t stand its web-UI. It’s beyond awful. But instead of whining how stupid it is, I decided to use it from command line instead. I couldn’t find a better way to authenticate go-jira (via other methods), so I looked into authenticating it via session token. And that requires you basically logging into Jira using a browser, then opening dev-tools, then finding auth cookies and saving them in ~/.jira.d/cookies.js. The entire workflow basically screams: “automate me!”.

I decided to try using Puppeteer instead of WebDriver. This script is written in Clojurescript, because that allowed me to launch Puppeteer instance and keep experimenting with it via REPL (without restarting). It would’ve cost me many more hours to figure out if I had to use plain Javascript.

The bottom line

I doubt that you find this project useful as is, but maybe it would help you to learn a few things.

How to use:

Prerequisites

  • nodejs, npm or yarn
  • clojure CLI
  • installed and configured gpg

For this script to work you’re gonna need to:

  • add /resources/cred.gpg (it should be encrypted with your default GPG key) in the following format:
    {:username "your-okta-username"
     :password "your-okta-password"}
        
  • To test if it was correctly encrypted, you can run:
    "$(which gpg2) -q --for-your-eyes-only --no-tty -d resources/creds.gpg"
        

then you can run:

npm
# or:
yarn

when it’s done installing npm packages:

npm run-script build
# or:
yarn run build

Those things need to be run only once.

Then to run the script:

npm run-script run
# or:
yarn run run

This is work in progress

I am still pretty much experimenting with it, so please don’t hold me accountable for any physical, emotional, monetary, and etc. damage or frustration this work may cause.

Acknowledgment

I wouldn’t be able to figure out the format of ~./jira.d/cookies.js (and other things) without great help from awesome OSS community, see github issue for more info.

jira-okta-puppet's People

Contributors

agzam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.