http_base_auth 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,13 +5,14 @@ require "http_base_auth/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "http_base_auth"
7
7
  s.version = HttpBaseAuth::VERSION
8
- s.platform = Gem::Platform::RUBY
9
8
  s.authors = ["Macj"]
9
+ s.platform = Gem::Platform::RUBY
10
10
  s.email = ["MadMacj@gmail.com"]
11
11
  s.homepage = ""
12
- s.summary = %q{"http based auth gem}
12
+ s.summary = %q{http based auth gem}
13
13
  s.description = %q{}
14
14
 
15
+
15
16
  s.rubyforge_project = "http_base_auth"
16
17
 
17
18
  s.files = `git ls-files`.split("\n")
@@ -1,3 +1,3 @@
1
1
  module HttpBaseAuth
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,5 +1,27 @@
1
1
  module HttpBaseAuth
2
+ protect_from_forgery
3
+
2
4
  def printing
3
- "Hellow__________________________________"
5
+ "Hellow__________________________________"
6
+ logger.info('***********')
4
7
  end
8
+ helper_method :printing
9
+ def authenticated?
10
+ session[:authenticated]
11
+ end
12
+ helper_method :authenticated?
13
+
14
+ def require_authentication
15
+ session[:authenticated] = true if authentication
16
+ end
17
+
18
+ def authentication
19
+ authenticate_or_request_with_http_basic do |username, password|
20
+ username == "fxposter" && password == "ek9PClkU8dAITa"
21
+ end
22
+ end
23
+ end
24
+
25
+ class ActionController::Base
26
+ include HttpBaseAuth
5
27
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_base_auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Macj
@@ -68,6 +68,6 @@ rubyforge_project: http_base_auth
68
68
  rubygems_version: 1.6.2
69
69
  signing_key:
70
70
  specification_version: 3
71
- summary: "\"http based auth gem"
71
+ summary: http based auth gem
72
72
  test_files: []
73
73