authi 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/authi.rb +18 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f82d2e9f72b5643cb5689ececfb636eae3a33f85
|
4
|
+
data.tar.gz: 548972afb8e2444b31fc14a27b7c90db5d2556b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c11d11832e867ef1c7ac5cf32a61842a54bc50e8d8671758c1088c3fa6fa20141d3d8c08660c865239c6eb4cdadc1902bb168db35d5f210f3a794a9aabf87629
|
7
|
+
data.tar.gz: 115baafa754e7f56989a848a69460b1fee73b3ce1f5ebfbe0a4508cd5839f98b6dc654aa2cb6e210fbdb714f74d817781710f1e5af6079136a0db64df282df08
|
data/lib/authi.rb
CHANGED
@@ -2,6 +2,24 @@ require 'openssl'
|
|
2
2
|
require 'base64'
|
3
3
|
require 'securerandom'
|
4
4
|
# Api Authentication Module
|
5
|
+
# How it works
|
6
|
+
# Client Side
|
7
|
+
# ===========
|
8
|
+
# A string is first created using your HTTP payload containing all parameters and a preshared key.
|
9
|
+
# This string is then used to create the signature which is a Base64 encoded SHA1 HMAC, using the clients private secret key.
|
10
|
+
# This signature is then can be added to Authorization HTTP header:
|
11
|
+
# Authorization = Authy.generate_signed_header(params)
|
12
|
+
# Now add this to to your header,
|
13
|
+
# header["Authorization"] = Authorization
|
14
|
+
# secret_key generated from the server side can be kept inside the a environment variable with name "shared_key" along with "service_name" as your service name
|
15
|
+
# Server Side
|
16
|
+
# ===========
|
17
|
+
# API validation
|
18
|
+
# --------------
|
19
|
+
# is_valid = Authy.validate_api(params, request.headers)
|
20
|
+
# Generating secret key for clients
|
21
|
+
# ---------------------------------
|
22
|
+
# secret_key = Authy.generate_secret_key
|
5
23
|
module Authy
|
6
24
|
# Create a signed hash using input parameter
|
7
25
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nithin Kumar
|
@@ -14,7 +14,8 @@ description: Authi is a Ruby gem designed to be used both in your client and ser
|
|
14
14
|
HTTP-based applications. It implements the authentication methods based on HMAC-SHA1
|
15
15
|
encryption algorithm and a pre-shared key.The gem will sign your requests on the
|
16
16
|
client side and authenticate that signature on the server side. It will even generate
|
17
|
-
the secret keys necessary for your clients to sign their requests
|
17
|
+
the secret keys necessary for your clients to sign their requests. Find the documentaion
|
18
|
+
to see how it works!
|
18
19
|
email: kv.nithin.90@gmail.com
|
19
20
|
executables: []
|
20
21
|
extensions: []
|