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 +4 -4
- data/README.md +1 -1
- data/lib/cow_auth/authentication.rb +18 -3
- data/lib/cow_auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c476f86eb5beb51e9d81ea1231eadc99342b2154
|
4
|
+
data.tar.gz: ff572095c33410d3dd61a6df889e082f104c7083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 |
|
12
|
-
|
13
|
-
|
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"
|
data/lib/cow_auth/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|