grape_oauth2 0.1.1 → 0.2.0
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/.gitignore +11 -11
- data/Gemfile +23 -23
- data/Rakefile +11 -11
- data/grape_oauth2.gemspec +26 -27
- data/lib/grape_oauth2.rb +129 -129
- data/lib/grape_oauth2/configuration.rb +143 -143
- data/lib/grape_oauth2/configuration/class_accessors.rb +36 -36
- data/lib/grape_oauth2/configuration/validation.rb +71 -71
- data/lib/grape_oauth2/endpoints/authorize.rb +34 -34
- data/lib/grape_oauth2/endpoints/token.rb +72 -72
- data/lib/grape_oauth2/gem_version.rb +24 -24
- data/lib/grape_oauth2/generators/authorization.rb +44 -44
- data/lib/grape_oauth2/generators/base.rb +26 -26
- data/lib/grape_oauth2/generators/token.rb +62 -62
- data/lib/grape_oauth2/helpers/access_token_helpers.rb +52 -54
- data/lib/grape_oauth2/helpers/oauth_params.rb +41 -41
- data/lib/grape_oauth2/mixins/active_record/access_grant.rb +47 -47
- data/lib/grape_oauth2/mixins/active_record/access_token.rb +75 -75
- data/lib/grape_oauth2/mixins/active_record/client.rb +36 -35
- data/lib/grape_oauth2/mixins/mongoid/access_grant.rb +58 -58
- data/lib/grape_oauth2/mixins/mongoid/access_token.rb +88 -88
- data/lib/grape_oauth2/mixins/mongoid/client.rb +44 -41
- data/lib/grape_oauth2/mixins/sequel/access_grant.rb +68 -68
- data/lib/grape_oauth2/mixins/sequel/access_token.rb +86 -86
- data/lib/grape_oauth2/mixins/sequel/client.rb +54 -46
- data/lib/grape_oauth2/responses/authorization.rb +11 -10
- data/lib/grape_oauth2/responses/base.rb +56 -56
- data/lib/grape_oauth2/responses/token.rb +10 -10
- data/lib/grape_oauth2/scopes.rb +74 -74
- data/lib/grape_oauth2/strategies/authorization_code.rb +38 -38
- data/lib/grape_oauth2/strategies/base.rb +47 -47
- data/lib/grape_oauth2/strategies/client_credentials.rb +20 -20
- data/lib/grape_oauth2/strategies/password.rb +22 -22
- data/lib/grape_oauth2/strategies/refresh_token.rb +47 -47
- data/lib/grape_oauth2/unique_token.rb +20 -20
- data/lib/grape_oauth2/version.rb +14 -14
- data/spec/configuration/config_spec.rb +231 -231
- data/spec/configuration/version_spec.rb +12 -12
- data/spec/dummy/endpoints/custom_authorization.rb +25 -25
- data/spec/dummy/endpoints/custom_token.rb +35 -35
- data/spec/dummy/endpoints/status.rb +25 -25
- data/spec/dummy/grape_oauth2_config.rb +11 -11
- data/spec/dummy/orm/active_record/app/config/db.rb +7 -7
- data/spec/dummy/orm/active_record/app/models/access_code.rb +3 -3
- data/spec/dummy/orm/active_record/app/models/access_token.rb +3 -3
- data/spec/dummy/orm/active_record/app/models/application.rb +3 -3
- data/spec/dummy/orm/active_record/app/models/application_record.rb +3 -3
- data/spec/dummy/orm/active_record/app/models/user.rb +10 -10
- data/spec/dummy/orm/active_record/app/twitter.rb +36 -36
- data/spec/dummy/orm/active_record/config.ru +7 -7
- data/spec/dummy/orm/active_record/db/schema.rb +53 -53
- data/spec/dummy/orm/mongoid/app/config/db.rb +6 -6
- data/spec/dummy/orm/mongoid/app/config/mongoid.yml +21 -21
- data/spec/dummy/orm/mongoid/app/models/access_code.rb +3 -3
- data/spec/dummy/orm/mongoid/app/models/access_token.rb +3 -3
- data/spec/dummy/orm/mongoid/app/models/application.rb +3 -3
- data/spec/dummy/orm/mongoid/app/models/user.rb +11 -11
- data/spec/dummy/orm/mongoid/app/twitter.rb +34 -34
- data/spec/dummy/orm/mongoid/config.ru +5 -5
- data/spec/dummy/orm/sequel/app/config/db.rb +1 -1
- data/spec/dummy/orm/sequel/app/models/access_code.rb +4 -4
- data/spec/dummy/orm/sequel/app/models/access_token.rb +4 -4
- data/spec/dummy/orm/sequel/app/models/application.rb +4 -4
- data/spec/dummy/orm/sequel/app/models/application_record.rb +2 -2
- data/spec/dummy/orm/sequel/app/models/user.rb +11 -11
- data/spec/dummy/orm/sequel/app/twitter.rb +47 -47
- data/spec/dummy/orm/sequel/config.ru +5 -5
- data/spec/dummy/orm/sequel/db/schema.rb +50 -50
- data/spec/lib/scopes_spec.rb +50 -50
- data/spec/mixins/active_record/access_token_spec.rb +185 -185
- data/spec/mixins/active_record/client_spec.rb +104 -95
- data/spec/mixins/mongoid/access_token_spec.rb +185 -185
- data/spec/mixins/mongoid/client_spec.rb +104 -95
- data/spec/mixins/sequel/access_token_spec.rb +185 -185
- data/spec/mixins/sequel/client_spec.rb +105 -96
- data/spec/requests/flows/authorization_code_spec.rb +67 -67
- data/spec/requests/flows/client_credentials_spec.rb +101 -101
- data/spec/requests/flows/password_spec.rb +210 -210
- data/spec/requests/flows/refresh_token_spec.rb +222 -222
- data/spec/requests/flows/revoke_token_spec.rb +103 -103
- data/spec/requests/protected_resources_spec.rb +64 -64
- data/spec/spec_helper.rb +60 -60
- data/spec/support/api_helper.rb +11 -11
- metadata +50 -52
- data/.rspec +0 -2
- data/.rubocop.yml +0 -18
- data/.travis.yml +0 -42
- data/README.md +0 -820
- data/gemfiles/active_record.rb +0 -25
- data/gemfiles/mongoid.rb +0 -14
- data/gemfiles/sequel.rb +0 -24
- data/grape_oauth2.png +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Mongoid.load!(File.expand_path('../mongoid.yml', __FILE__), :test)
|
2
|
-
|
3
|
-
Mongoid.raise_not_found_error = false
|
4
|
-
|
5
|
-
Mongoid.logger.level = Logger::ERROR
|
6
|
-
Mongo::Logger.logger.level = Logger::ERROR
|
1
|
+
Mongoid.load!(File.expand_path('../mongoid.yml', __FILE__), :test)
|
2
|
+
|
3
|
+
Mongoid.raise_not_found_error = false
|
4
|
+
|
5
|
+
Mongoid.logger.level = Logger::ERROR
|
6
|
+
Mongo::Logger.logger.level = Logger::ERROR
|
@@ -1,21 +1,21 @@
|
|
1
|
-
development:
|
2
|
-
clients:
|
3
|
-
default:
|
4
|
-
database: mongoid-dev
|
5
|
-
hosts:
|
6
|
-
- localhost:27017
|
7
|
-
options:
|
8
|
-
raise_not_found_error: false
|
9
|
-
write:
|
10
|
-
w: 1
|
11
|
-
|
12
|
-
test:
|
13
|
-
clients:
|
14
|
-
default:
|
15
|
-
database: mongoid-test
|
16
|
-
hosts:
|
17
|
-
- localhost:27017
|
18
|
-
options:
|
19
|
-
raise_not_found_error: false
|
20
|
-
write:
|
21
|
-
w: 1
|
1
|
+
development:
|
2
|
+
clients:
|
3
|
+
default:
|
4
|
+
database: mongoid-dev
|
5
|
+
hosts:
|
6
|
+
- localhost:27017
|
7
|
+
options:
|
8
|
+
raise_not_found_error: false
|
9
|
+
write:
|
10
|
+
w: 1
|
11
|
+
|
12
|
+
test:
|
13
|
+
clients:
|
14
|
+
default:
|
15
|
+
database: mongoid-test
|
16
|
+
hosts:
|
17
|
+
- localhost:27017
|
18
|
+
options:
|
19
|
+
raise_not_found_error: false
|
20
|
+
write:
|
21
|
+
w: 1
|
@@ -1,3 +1,3 @@
|
|
1
|
-
class AccessCode
|
2
|
-
include Grape::OAuth2::Mongoid::AccessGrant
|
3
|
-
end
|
1
|
+
class AccessCode
|
2
|
+
include Grape::OAuth2::Mongoid::AccessGrant
|
3
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
class AccessToken
|
2
|
-
include Grape::OAuth2::Mongoid::AccessToken
|
3
|
-
end
|
1
|
+
class AccessToken
|
2
|
+
include Grape::OAuth2::Mongoid::AccessToken
|
3
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
class Application
|
2
|
-
include Grape::OAuth2::Mongoid::Client
|
3
|
-
end
|
1
|
+
class Application
|
2
|
+
include Grape::OAuth2::Mongoid::Client
|
3
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
class User
|
2
|
-
include Mongoid::Document
|
3
|
-
include Mongoid::Timestamps
|
4
|
-
|
5
|
-
field :username, type: String
|
6
|
-
field :password, type: String
|
7
|
-
|
8
|
-
def self.oauth_authenticate(_client, username, password)
|
9
|
-
find_by(username: username, password: password)
|
10
|
-
end
|
11
|
-
end
|
1
|
+
class User
|
2
|
+
include Mongoid::Document
|
3
|
+
include Mongoid::Timestamps
|
4
|
+
|
5
|
+
field :username, type: String
|
6
|
+
field :password, type: String
|
7
|
+
|
8
|
+
def self.oauth_authenticate(_client, username, password)
|
9
|
+
find_by(username: username, password: password)
|
10
|
+
end
|
11
|
+
end
|
@@ -1,34 +1,34 @@
|
|
1
|
-
require 'grape'
|
2
|
-
|
3
|
-
require File.expand_path('../../../../../../lib/grape_oauth2', __FILE__)
|
4
|
-
|
5
|
-
# Database
|
6
|
-
load File.expand_path('../config/db.rb', __FILE__)
|
7
|
-
|
8
|
-
# Grape::OAuth2 config
|
9
|
-
load File.expand_path('../../../../grape_oauth2_config.rb', __FILE__)
|
10
|
-
|
11
|
-
# Models
|
12
|
-
require_relative 'models/access_token'
|
13
|
-
require_relative 'models/access_code'
|
14
|
-
require_relative 'models/application'
|
15
|
-
require_relative 'models/user'
|
16
|
-
|
17
|
-
# Twitter Endpoints
|
18
|
-
require_relative '../../../endpoints/custom_token'
|
19
|
-
require_relative '../../../endpoints/custom_authorization'
|
20
|
-
require_relative '../../../endpoints/status'
|
21
|
-
|
22
|
-
module Twitter
|
23
|
-
class API < Grape::API
|
24
|
-
version 'v1', using: :path
|
25
|
-
format :json
|
26
|
-
prefix :api
|
27
|
-
|
28
|
-
include Grape::OAuth2.api
|
29
|
-
|
30
|
-
mount Twitter::Endpoints::Status
|
31
|
-
mount Twitter::Endpoints::CustomToken
|
32
|
-
mount Twitter::Endpoints::CustomAuthorization
|
33
|
-
end
|
34
|
-
end
|
1
|
+
require 'grape'
|
2
|
+
|
3
|
+
require File.expand_path('../../../../../../lib/grape_oauth2', __FILE__)
|
4
|
+
|
5
|
+
# Database
|
6
|
+
load File.expand_path('../config/db.rb', __FILE__)
|
7
|
+
|
8
|
+
# Grape::OAuth2 config
|
9
|
+
load File.expand_path('../../../../grape_oauth2_config.rb', __FILE__)
|
10
|
+
|
11
|
+
# Models
|
12
|
+
require_relative 'models/access_token'
|
13
|
+
require_relative 'models/access_code'
|
14
|
+
require_relative 'models/application'
|
15
|
+
require_relative 'models/user'
|
16
|
+
|
17
|
+
# Twitter Endpoints
|
18
|
+
require_relative '../../../endpoints/custom_token'
|
19
|
+
require_relative '../../../endpoints/custom_authorization'
|
20
|
+
require_relative '../../../endpoints/status'
|
21
|
+
|
22
|
+
module Twitter
|
23
|
+
class API < Grape::API
|
24
|
+
version 'v1', using: :path
|
25
|
+
format :json
|
26
|
+
prefix :api
|
27
|
+
|
28
|
+
include Grape::OAuth2.api
|
29
|
+
|
30
|
+
mount Twitter::Endpoints::Status
|
31
|
+
mount Twitter::Endpoints::CustomToken
|
32
|
+
mount Twitter::Endpoints::CustomAuthorization
|
33
|
+
end
|
34
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__))
|
2
|
-
|
3
|
-
require 'app/twitter'
|
4
|
-
|
5
|
-
run Twitter::API
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
|
3
|
+
require 'app/twitter'
|
4
|
+
|
5
|
+
run Twitter::API
|
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path('../../../db/schema.rb', __FILE__)
|
1
|
+
load File.expand_path('../../../db/schema.rb', __FILE__)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AccessCode <
|
2
|
-
set_dataset :access_codes
|
3
|
-
include Grape::OAuth2::Sequel::AccessGrant
|
4
|
-
end
|
1
|
+
class AccessCode < ::Sequel::Model
|
2
|
+
set_dataset :access_codes
|
3
|
+
include Grape::OAuth2::Sequel::AccessGrant
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AccessToken <
|
2
|
-
set_dataset :access_tokens
|
3
|
-
include Grape::OAuth2::Sequel::AccessToken
|
4
|
-
end
|
1
|
+
class AccessToken < ::Sequel::Model
|
2
|
+
set_dataset :access_tokens
|
3
|
+
include Grape::OAuth2::Sequel::AccessToken
|
4
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Application <
|
2
|
-
set_dataset :applications
|
3
|
-
include Grape::OAuth2::Sequel::Client
|
4
|
-
end
|
1
|
+
class Application < ::Sequel::Model
|
2
|
+
set_dataset :applications
|
3
|
+
include Grape::OAuth2::Sequel::Client
|
4
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
class ApplicationRecord
|
2
|
-
end
|
1
|
+
class ApplicationRecord
|
2
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
class User <
|
2
|
-
set_dataset :users
|
3
|
-
plugin :secure_password, include_validations: false
|
4
|
-
|
5
|
-
def self.oauth_authenticate(_client, username, password)
|
6
|
-
user = find(username: username)
|
7
|
-
return if user.nil?
|
8
|
-
|
9
|
-
user.authenticate(password)
|
10
|
-
end
|
11
|
-
end
|
1
|
+
class User < ::Sequel::Model
|
2
|
+
set_dataset :users
|
3
|
+
plugin :secure_password, include_validations: false
|
4
|
+
|
5
|
+
def self.oauth_authenticate(_client, username, password)
|
6
|
+
user = find(username: username)
|
7
|
+
return if user.nil?
|
8
|
+
|
9
|
+
user.authenticate(password)
|
10
|
+
end
|
11
|
+
end
|
@@ -1,47 +1,47 @@
|
|
1
|
-
require 'grape'
|
2
|
-
|
3
|
-
require File.expand_path('../../../../../../lib/grape_oauth2', __FILE__)
|
4
|
-
|
5
|
-
# SQLite memory database
|
6
|
-
DB = if defined?(JRUBY_VERSION)
|
7
|
-
Sequel.connect('jdbc:sqlite::memory:')
|
8
|
-
else
|
9
|
-
Sequel.sqlite
|
10
|
-
end
|
11
|
-
|
12
|
-
# Database
|
13
|
-
load File.expand_path('../config/db.rb', __FILE__)
|
14
|
-
|
15
|
-
# Grape::OAuth2 config
|
16
|
-
load File.expand_path('../../../../grape_oauth2_config.rb', __FILE__)
|
17
|
-
|
18
|
-
# Models
|
19
|
-
require_relative 'models/application_record'
|
20
|
-
require_relative 'models/access_token'
|
21
|
-
require_relative 'models/access_code'
|
22
|
-
require_relative 'models/application'
|
23
|
-
require_relative 'models/user'
|
24
|
-
|
25
|
-
# Twitter Endpoints
|
26
|
-
require_relative '../../../endpoints/custom_token'
|
27
|
-
require_relative '../../../endpoints/custom_authorization'
|
28
|
-
require_relative '../../../endpoints/status'
|
29
|
-
|
30
|
-
module Twitter
|
31
|
-
class API < Grape::API
|
32
|
-
version 'v1', using: :path
|
33
|
-
format :json
|
34
|
-
prefix :api
|
35
|
-
|
36
|
-
use *Grape::OAuth2.middleware
|
37
|
-
|
38
|
-
helpers Grape::OAuth2::Helpers::AccessTokenHelpers
|
39
|
-
|
40
|
-
mount Grape::OAuth2::Endpoints::Token
|
41
|
-
mount Grape::OAuth2::Endpoints::Authorize
|
42
|
-
|
43
|
-
mount Twitter::Endpoints::Status
|
44
|
-
mount Twitter::Endpoints::CustomToken
|
45
|
-
mount Twitter::Endpoints::CustomAuthorization
|
46
|
-
end
|
47
|
-
end
|
1
|
+
require 'grape'
|
2
|
+
|
3
|
+
require File.expand_path('../../../../../../lib/grape_oauth2', __FILE__)
|
4
|
+
|
5
|
+
# SQLite memory database
|
6
|
+
DB = if defined?(JRUBY_VERSION)
|
7
|
+
Sequel.connect('jdbc:sqlite::memory:')
|
8
|
+
else
|
9
|
+
Sequel.sqlite
|
10
|
+
end
|
11
|
+
|
12
|
+
# Database
|
13
|
+
load File.expand_path('../config/db.rb', __FILE__)
|
14
|
+
|
15
|
+
# Grape::OAuth2 config
|
16
|
+
load File.expand_path('../../../../grape_oauth2_config.rb', __FILE__)
|
17
|
+
|
18
|
+
# Models
|
19
|
+
require_relative 'models/application_record'
|
20
|
+
require_relative 'models/access_token'
|
21
|
+
require_relative 'models/access_code'
|
22
|
+
require_relative 'models/application'
|
23
|
+
require_relative 'models/user'
|
24
|
+
|
25
|
+
# Twitter Endpoints
|
26
|
+
require_relative '../../../endpoints/custom_token'
|
27
|
+
require_relative '../../../endpoints/custom_authorization'
|
28
|
+
require_relative '../../../endpoints/status'
|
29
|
+
|
30
|
+
module Twitter
|
31
|
+
class API < Grape::API
|
32
|
+
version 'v1', using: :path
|
33
|
+
format :json
|
34
|
+
prefix :api
|
35
|
+
|
36
|
+
use *Grape::OAuth2.middleware
|
37
|
+
|
38
|
+
helpers Grape::OAuth2::Helpers::AccessTokenHelpers
|
39
|
+
|
40
|
+
mount Grape::OAuth2::Endpoints::Token
|
41
|
+
mount Grape::OAuth2::Endpoints::Authorize
|
42
|
+
|
43
|
+
mount Twitter::Endpoints::Status
|
44
|
+
mount Twitter::Endpoints::CustomToken
|
45
|
+
mount Twitter::Endpoints::CustomAuthorization
|
46
|
+
end
|
47
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__))
|
2
|
-
|
3
|
-
require 'app/twitter'
|
4
|
-
|
5
|
-
run Twitter::API
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
|
3
|
+
require 'app/twitter'
|
4
|
+
|
5
|
+
run Twitter::API
|
@@ -1,50 +1,50 @@
|
|
1
|
-
DB.create_table :applications do
|
2
|
-
primary_key :id
|
3
|
-
|
4
|
-
column :name, String, size: 255, null: false
|
5
|
-
column :key, String, size: 255, null: false, index: { unique: true }
|
6
|
-
column :secret, String, size: 255, null: false
|
7
|
-
|
8
|
-
|
9
|
-
column :redirect_uri, String
|
10
|
-
|
11
|
-
column :created_at, DateTime
|
12
|
-
column :updated_at, DateTime
|
13
|
-
end
|
14
|
-
|
15
|
-
DB.create_table :access_tokens do
|
16
|
-
primary_key :id
|
17
|
-
column :client_id, Integer
|
18
|
-
column :resource_owner_id, Integer, index: true
|
19
|
-
|
20
|
-
column :token, String, size: 255, null: false, index: { unique: true }
|
21
|
-
|
22
|
-
column :refresh_token, String, size: 255, index: { unique: true }
|
23
|
-
|
24
|
-
column :expires_at, DateTime
|
25
|
-
column :revoked_at, DateTime
|
26
|
-
column :created_at, DateTime, null: false
|
27
|
-
column :scopes, String, size: 255
|
28
|
-
end
|
29
|
-
|
30
|
-
DB.create_table :access_codes do
|
31
|
-
primary_key :id
|
32
|
-
column :client_id, Integer
|
33
|
-
column :resource_owner_id, Integer, index: true
|
34
|
-
|
35
|
-
column :token, String, size: 255, null: false, index: { unique: true }
|
36
|
-
column :redirect_uri, String, size: 255, index: { unique: true }
|
37
|
-
|
38
|
-
column :expires_at, DateTime
|
39
|
-
column :created_at, DateTime, null: false
|
40
|
-
column :scopes, String, size: 255
|
41
|
-
end
|
42
|
-
|
43
|
-
DB.create_table :users do
|
44
|
-
primary_key :id
|
45
|
-
column :name, String, size: 255
|
46
|
-
column :username, String, size: 255
|
47
|
-
column :created_at, DateTime
|
48
|
-
column :updated_at, DateTime
|
49
|
-
column :password_digest, String, size: 255
|
50
|
-
end
|
1
|
+
DB.create_table :applications do
|
2
|
+
primary_key :id
|
3
|
+
|
4
|
+
column :name, String, size: 255, null: false
|
5
|
+
column :key, String, size: 255, null: false, index: { unique: true }
|
6
|
+
column :secret, String, size: 255, null: false
|
7
|
+
|
8
|
+
|
9
|
+
column :redirect_uri, String
|
10
|
+
|
11
|
+
column :created_at, DateTime
|
12
|
+
column :updated_at, DateTime
|
13
|
+
end
|
14
|
+
|
15
|
+
DB.create_table :access_tokens do
|
16
|
+
primary_key :id
|
17
|
+
column :client_id, Integer
|
18
|
+
column :resource_owner_id, Integer, index: true
|
19
|
+
|
20
|
+
column :token, String, size: 255, null: false, index: { unique: true }
|
21
|
+
|
22
|
+
column :refresh_token, String, size: 255, index: { unique: true }
|
23
|
+
|
24
|
+
column :expires_at, DateTime
|
25
|
+
column :revoked_at, DateTime
|
26
|
+
column :created_at, DateTime, null: false
|
27
|
+
column :scopes, String, size: 255
|
28
|
+
end
|
29
|
+
|
30
|
+
DB.create_table :access_codes do
|
31
|
+
primary_key :id
|
32
|
+
column :client_id, Integer
|
33
|
+
column :resource_owner_id, Integer, index: true
|
34
|
+
|
35
|
+
column :token, String, size: 255, null: false, index: { unique: true }
|
36
|
+
column :redirect_uri, String, size: 255, index: { unique: true }
|
37
|
+
|
38
|
+
column :expires_at, DateTime
|
39
|
+
column :created_at, DateTime, null: false
|
40
|
+
column :scopes, String, size: 255
|
41
|
+
end
|
42
|
+
|
43
|
+
DB.create_table :users do
|
44
|
+
primary_key :id
|
45
|
+
column :name, String, size: 255
|
46
|
+
column :username, String, size: 255
|
47
|
+
column :created_at, DateTime
|
48
|
+
column :updated_at, DateTime
|
49
|
+
column :password_digest, String, size: 255
|
50
|
+
end
|