GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devkral/rpam2: Ruby Pam integegration

BranchesTags
Open more actions menu

Latest commit

 

History

43 Commits
43 Commits

Folders and files

NameName
Last commit message
Last commit date
ext/rpam2
ext/rpam2
 
 
lib
lib
 
 
pam_examples
pam_examples
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.rdoc
README.rdoc
 
 
rpam2.gemspec
rpam2.gemspec
 
 

Repository files navigation

rpam2

  • rubyforge.org/projects/rpam2

DESCRIPTION:

This extension provides a PAM (Pluggable Authentication Modules)
integration to ruby. It is inspired by rpam but provides more functionality
and is licensed under MIT.

EXAMPLE:

require 'rpam2'

if Rpam2.auth("servicename", "user", "password")
  puts "Authentication successful"
else
  puts "Authentication failed"
end

puts Rpam2.listenv(nil, "user", "password") # uses default (rpam)
puts Rpam2.listenv("servicename", "user", "password")
puts Rpam2.listenv("servicename", "user", "password", true)
puts Rpam2.listenv("servicename", "user", "password", true, "RUSER", "RHOST")
puts Rpam2.listenv("servicename") # error

REQUIREMENTS:

  • pam-dev (except test mode)

  • ruby-dev

INSTALL:

gem install rpam2

or if it should not depend on pam (test mode):

ALLOW_NOPAM=true gem install rpam2

WARNING: Don’t use rpam2 for anything except for tests in this mode. It isn’t safe.

Or manually:

  • gem build rpam2.gemspec

  • gem install ./rpam2-4.0.0.gem

Usage:

require ‘rpam2’

Rpam2.auth(“servicename”, “username”, “password”, [“RUSER”, “RHOST”]) => (true/false)

Rpam2.account(“servicename”, “username”) => (true/false)

Rpam2.getenv(“servicename”, “username”, “password”, “envvar”, [opensession(true/false), [“RUSER”, “RHOST”]]) => (string/nil)

Rpam2.listenv(“servicename”, “username”, “password”, [opensession(true/false), [“RUSER”, “RHOST”]]) => (hash/nil)

Testing:

For test purposes can Rpam2 be filled with fake data. For this mode pam is not neccessary but then you may should not access not specified services. Only services in fake_data are emulated the rest is redirected to real or stub pam (if pam was not available).

Rpam2.fake_data = { usernames: Set[‘alex’, ‘hugo’, ‘thomas’], servicenames: Set[‘service1’, ‘service2’], password: ‘123456’, env: { email: ‘[email protected]’} }

About

Ruby Pam integegration

Topics

pamrubyruby-gem

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.