Skip to content

nickmartini/cinch-authentication

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cinch-authentication

An authentication system with multiple strategies for the Cinch IRC framework.

Features

  • Multiple strategies: users can be authenticated by their channel status, by being in a user list or by identifying with a password.
  • Easily configurable: authentication can be configured globally, on the plugin level and on the command level, all at the same time.

Usage

Cinch-authentication can be set up to require authorization for a full plugin

require 'cinch/extensions/authentication'

module Cinch::Plugins
  class Admin
    include Cinch::Plugin
    include Cinch::Extensions::Authentication

    enable_authentication # All matches require authorization.

    # ...
  end
end

Or only for a few commands.

require 'cinch/extensions/authentication'

module Cinch::Plugins
  class Admin
    include Cinch::Plugin
    include Cinch::Extensions::Authentication

    match /set_topic (.+)/s, :method => :set_topic
    match /get_topic/s, :method => :get_topic

    def set_topic(m, topic)
      return unless authenticated? m

      # ...
    end

    def get_topic(m)
      m.reply m.channel.topic
    end
  end
end

When using the user_list strategy, note that the user must be identified with nickserv (+r) in order for the plugin to recognize you.

Installation

Rubygems

gem install cinch-authentication

Bundler

gem 'cinch-authentication', :require => 'cinch/extensions/authentication'

License

See the LICENSE file.

About

An authentication system with multiple strategies for the Cinch IRC framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%