GithubHelp home page GithubHelp logo

isabella232 / stash-token-auth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from monitorjbl/stash-token-auth

0.0 0.0 0.0 1.03 MB

Stash plugin for token-based auth

License: GNU General Public License v3.0

JavaScript 5.14% Java 81.88% HTML 12.98%

stash-token-auth's Introduction

Run Status

Token-based Auth Plugin for Stash

Key

Enables token-based authentication to the Stash REST API for individual users. Available on the Atlassian Marketplace now.

Why?

Stash's REST API is very powerful and easy to use. It's secured and drives most what you actually do in the UI, so there's not much issue in allowing normal users to access it. Unfortunately it requires a password to access. This makes scripting essentially impossible for normal users that care about security. Ever thought, "Boy, it'd be nice if a bash script could open PRs for me so I didn't have to"? Welp, that's not really feasible if you're working in an enterprise environment where your password gives access to a lot of other stuff.

Tokens

Tokens are the easiest solution to this problem. Now, you can store a token on your filesystem and go crazy with scripting! Because the token is randomly generated (and can be regenerated anytime in the UI), it's not the end of the world if a security breach happens. The person who steals your token can't do anything with it once you regenerate it, and access can be administratively restricted to specific areas of the REST service to limit damage in the event of a breach.

Usage

Once you've got the plugin installed, any user can log in and go to their account page to see their token. Simply copy it out and dump it into whatever client you'd like to use. Here's a quick and dirty example using cURL:

TOKEN=<paste token here>
curl  -H "X-Auth-User:admin" \
      -H "X-Auth-Token:$TOKEN" \
      http://localhost:7990/bitbucket/rest/api/1.0/projects/PROJECT_1/repos

UI Elements

Administration config

From this screen, an admin can control settings that affect all tokens on the server. Admin Screenshot

User config

From here, a user can see and regenerate his personal token. User Screenshot

Attributions

Key Icon by Udana Ekanayake used under Creative Commons

stash-token-auth's People

Contributors

monitorjbl 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.