cow_auth 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bde8798e339337d6f36ff9501e53cd585f79937
4
- data.tar.gz: 4778ac785e62c819ff028c55d8027c940d9d78a0
3
+ metadata.gz: c476f86eb5beb51e9d81ea1231eadc99342b2154
4
+ data.tar.gz: ff572095c33410d3dd61a6df889e082f104c7083
5
5
  SHA512:
6
- metadata.gz: a340166bbe215adbf73ce3fe211a48d34c94db184cde1c2c3b2ed8ef541f1ac39bc6a8b33ed86e83748ff5fc67e02597dfbdd7b6e5ae09b94ac40daf705b9a79
7
- data.tar.gz: 03f15f6a5cee66db6b30404d602f4bb3188a30c3c60d01d34ffe8167dbb1a8548a7210e98e15da13e88c665157fb039765d955a1df164abfc295bbc5aa88cee2
6
+ metadata.gz: 7775f24a1b6af4004d0ce7ea14aaf17c45ed1be2f569d7ffddcc604a0bda176934574ce8a3399e270b5ef846d5bde13e7b247e934503dcb322db56ea16b5014f
7
+ data.tar.gz: e497095730f0964547c3d1cb339250e5273270ef0bb8c3c2a90acd5db819cb8df5d08a008b0886fc2d898c82edf608d35cae9e4d0cbb3d9d16cd55ffd8bc8f0d
data/README.md CHANGED
@@ -60,7 +60,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
60
60
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
61
61
 
62
62
  bundle exec gem build cow_auth.gemspec
63
- bundle exec gem install cow_auth-0.1.0.gem
63
+ bundle exec gem install cow_auth-0.2.0.gem
64
64
 
65
65
  ## Contributing
66
66
 
@@ -8,12 +8,27 @@ module CowAuth
8
8
  private
9
9
 
10
10
  def authenticate_user
11
- authenticate_or_request_with_http_token do |api_key, options|
12
- sid, auth_token = api_key.match(/sid=([[:alnum:]]*)&auth_token=([[:alnum:]]*)/).try(:captures)
13
- @current_user = User.authenticate_from_token(sid, auth_token)
11
+ authenticate_or_request_with_http_token do |token, options|
12
+ puts options
13
+
14
+ # sid, auth_token = api_key.match(/sid=([[:alnum:]]*)&auth_token=([[:alnum:]]*)/).try(:captures)
15
+ @current_user = User.authenticate_from_token(options[:sid], token)
14
16
  raise CowAuth::NotAuthenticatedError.new('User not authenticated.') if @current_user.blank?
15
17
  return true
16
18
  end
17
19
  end
20
+
21
+ # def authenticate_user
22
+ # authenticate_or_request_with_http_token do |api_key, options|
23
+ # sid, auth_token = api_key.match(/sid=([[:alnum:]]*)&auth_token=([[:alnum:]]*)/).try(:captures)
24
+ # @current_user = User.authenticate_from_token(sid, auth_token)
25
+ # raise CowAuth::NotAuthenticatedError.new('User not authenticated.') if @current_user.blank?
26
+ # return true
27
+ # end
28
+ # end
18
29
  end
19
30
  end
31
+
32
+ # curl -X GET http://api.local.dev:3000/v1/test -i -H "Authorization: Token token=sid=C3281845f3976809796f91cf6bbb35c53&auth_token=b5503c9b85b881f8b3ddbd82f511912c"
33
+
34
+ # curl -X GET http://api.local.dev:3000/v1/test -i -H "Authorization: Token token=b5503c9b85b881f8b3ddbd82f511912c,sid=C3281845f3976809796f91cf6bbb35c53"
@@ -1,3 +1,3 @@
1
1
  module CowAuth
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cow_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickey Cowden
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-14 00:00:00.000000000 Z
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler