persephone 1.0.0 → 1.0.1

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: adbd4c65e1c5b3ead009bcae0cd3a9845bc020d2
4
- data.tar.gz: 440f0672d16161998c67572f222effe293f214a0
3
+ metadata.gz: 8cb4d99067c531e34fe5fddc89165e56469e04ac
4
+ data.tar.gz: 6eebb1641794bb7a8ede197a9084cf2c69c17567
5
5
  SHA512:
6
- metadata.gz: 6eadd80dc2324addc4b816a9c73f719c4e5662b59507476af6489696f733112d3c5b5a808ba19ef6983c75379ae98bbb2fd72c97337b6ef4c036f0b18abe9e55
7
- data.tar.gz: 6052c750ddad0149b8474b117e76210cfd888c23563d9ef0fda588e93481d146920c83431aaa7d24a07824fab5c85554b3531546e6399e876382adadb0b79cb8
6
+ metadata.gz: cfe89db7568bf94abde0990b0eb8b9a18cef1e23f9902d84ce419ec24d5305942fed66fff49afea94e9c25bf090309b0ad9be7f61c58bbbbd29a1b97a199179e
7
+ data.tar.gz: f3f9a75bae57b87e37e70ecbb0b59be226f8301218f6e466484aba674257b0b6282d3a837bf8dd5c3208a00ba68c998329f0b3131534330c82cc92f81df98e4c
data/CHANGES.md ADDED
@@ -0,0 +1,4 @@
1
+ # 1.0.1
2
+ ---
3
+
4
+ * uniqueness is enforced on app_id and app_slug fields in the App model
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 })
@@ -1,3 +1,3 @@
1
1
  module Persephone
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
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.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-07-07 00:00:00.000000000 Z
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