persephone 1.0.0 → 1.0.1
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/CHANGES.md +4 -0
- data/README.md +16 -1
- data/app/models/persephone/app.rb +2 -0
- data/lib/persephone/version.rb +1 -1
- 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: 8cb4d99067c531e34fe5fddc89165e56469e04ac
|
4
|
+
data.tar.gz: 6eebb1641794bb7a8ede197a9084cf2c69c17567
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfe89db7568bf94abde0990b0eb8b9a18cef1e23f9902d84ce419ec24d5305942fed66fff49afea94e9c25bf090309b0ad9be7f61c58bbbbd29a1b97a199179e
|
7
|
+
data.tar.gz: f3f9a75bae57b87e37e70ecbb0b59be226f8301218f6e466484aba674257b0b6282d3a837bf8dd5c3208a00ba68c998329f0b3131534330c82cc92f81df98e4c
|
data/CHANGES.md
ADDED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# persephone
|
2
2
|
This gem provides token based OAuth2 authorization within Rails 4 apps that use Mongoid 5 (commonly referred to as client_credentials authorization). It is named after the Greek goddess of the underworld for no good reason other than I liked the name.
|
3
3
|
|
4
|
+
## Change Log
|
5
|
+
|
6
|
+
A complete list of changes can be found in [CHANGES.md](CHANGES.md).
|
7
|
+
|
4
8
|
## Installation
|
5
9
|
In your Rails app gemfile, add the following:
|
6
10
|
|
@@ -21,6 +25,17 @@ app.client_id
|
|
21
25
|
app.client_secret
|
22
26
|
```
|
23
27
|
|
28
|
+
## Storing External References
|
29
|
+
|
30
|
+
The App model has two additional fields which can be used to store identifiers for external objects either through an ID number or a string SLUG.
|
31
|
+
|
32
|
+
```
|
33
|
+
app = Persephone::App.new(params)
|
34
|
+
app.app_id = 23
|
35
|
+
app.app_slug = 'some_slug_here'
|
36
|
+
app.save
|
37
|
+
```
|
38
|
+
|
24
39
|
## Authenticating
|
25
40
|
|
26
41
|
Persephone automatically provides you with the /oauth/token route. You will authenticate by POSTing a JSON payload containing your client_id and client_secret to the /oauth/token location on your API. A payload should look something like this:
|
@@ -125,7 +140,7 @@ end
|
|
125
140
|
|
126
141
|
Then simply include whichever concern is appropriate for your controller. You can require BOTH scopes if you include both concerns.
|
127
142
|
|
128
|
-
##Contributing
|
143
|
+
## Contributing
|
129
144
|
|
130
145
|
* Fork it
|
131
146
|
* Create your feature branch (git checkout -b my-new-feature)
|
@@ -16,6 +16,8 @@ module Persephone
|
|
16
16
|
validates :name, presence: true, uniqueness: true
|
17
17
|
validates :client_id, presence: true, uniqueness: true
|
18
18
|
validates :client_secret, presence: true
|
19
|
+
validates :app_id, uniqueness: true
|
20
|
+
validates :app_slug, uniqueness: true, format: { with: /\A[a-z_]+\z/ }
|
19
21
|
|
20
22
|
index({ client_id: 1 }, { unique: true })
|
21
23
|
index({ client_secret: 1 })
|
data/lib/persephone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: persephone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -61,6 +61,7 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
+
- CHANGES.md
|
64
65
|
- Gemfile
|
65
66
|
- LICENSE
|
66
67
|
- README.md
|