GithubHelp home page GithubHelp logo

diegodorgam / hubot-acl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tily/hubot-acl

0.0 1.0 0.0 223 KB

A hubot script for access control list

JavaScript 18.69% CoffeeScript 72.65% Shell 8.66%

hubot-acl's Introduction

hubot-acl

A hubot script for access control list.

See src/acl.coffee for full documentation.

See http://qiita.com/tily/items/71fff32e928ae9caf070 for Japanese README.

Installation

In hubot project repo, run:

npm install hubot-acl --save

Then add hubot-acl to your external-scripts.json:

["hubot-acl"]

Usage

Catch acl event to define your ACL in your hubot script.

module.exports = (robot)->
  robot.on 'acl', (order, allow, deny)->
    # your acl settings

ACL can be defined in apache.conf-like style.

Whitelisting

robot.on 'acl', (order, allow, deny)->
  order deny, allow
  deny text: /.*/
  allow id: [1], text: /.*/
  allow id: [2], text: /^jenkins/
  allow id: [3], text: /^jenkins (list|last|describe)/
  • all users are not allowed to execute all commands by default
  • user (id=1) is allowed to execute all commands
  • user (id=2) is allowed to execute commands which begin with jenkins
  • user (id=3) is allowed to execute jenkins read only commands (list, last, desribe)

Blacklisting

robot.on 'acl', (order, allow, deny)->
  order allow, deny
  allow text: /.*/
  deny name: ['bay4k', 'manny'], text: /^jenkins/
  deny name: ['sticky'], text: /^jenkins (b|build)/
  • all users are allowed to execute all commands by default
  • user (whose name is bay4k or manny) are not allowed to execute commands which begin with jenkins
  • user (whose name is sticky) is not allowed to execute jenkins build commands (b, build)

working with hubot-acl

robot.on 'acl', (order, allow, deny)->
  order deny, allow
  deny text: /.*/
  allow role: ['admin'], text: /.*/
  allow role: ['jenkins'], text: /^jenkins/
  allow role: ['jenkins-readonly'], text: /^jenkins (list|last|describe)/

Sample Interaction

Hubot> Hubot jenkins build hoge
bes: Error: you are not allowed to execute that command

hubot-acl's People

Contributors

tily avatar

Watchers

 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.