privy_wine_bouncer 1.0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +23 -0
  5. data/.rubocop_todo.yml +182 -0
  6. data/.travis.yml +124 -0
  7. data/CHANGELOG.md +60 -0
  8. data/CONTRIBUTING.md +55 -0
  9. data/Gemfile +21 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +238 -0
  12. data/Rakefile +11 -0
  13. data/UPGRADING.md +62 -0
  14. data/lib/generators/templates/wine_bouncer.rb +9 -0
  15. data/lib/generators/wine_bouncer/initializer_generator.rb +14 -0
  16. data/lib/privy_wine_bouncer.rb +3 -0
  17. data/lib/wine_bouncer/auth_methods/auth_methods.rb +38 -0
  18. data/lib/wine_bouncer/auth_strategies/default.rb +27 -0
  19. data/lib/wine_bouncer/auth_strategies/protected.rb +43 -0
  20. data/lib/wine_bouncer/auth_strategies/swagger.rb +33 -0
  21. data/lib/wine_bouncer/base_strategy.rb +7 -0
  22. data/lib/wine_bouncer/configuration.rb +70 -0
  23. data/lib/wine_bouncer/errors.rb +23 -0
  24. data/lib/wine_bouncer/extension.rb +24 -0
  25. data/lib/wine_bouncer/oauth2.rb +106 -0
  26. data/lib/wine_bouncer/version.rb +5 -0
  27. data/lib/wine_bouncer.rb +14 -0
  28. data/spec/dummy/README.rdoc +28 -0
  29. data/spec/dummy/Rakefile +6 -0
  30. data/spec/dummy/app/api/default_api.rb +71 -0
  31. data/spec/dummy/app/api/protected_api.rb +66 -0
  32. data/spec/dummy/app/api/swagger_api.rb +61 -0
  33. data/spec/dummy/app/assets/config/manifest.js +1 -0
  34. data/spec/dummy/app/assets/images/.keep +0 -0
  35. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  36. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  37. data/spec/dummy/app/controllers/application_controller.rb +7 -0
  38. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  39. data/spec/dummy/app/helpers/application_helper.rb +4 -0
  40. data/spec/dummy/app/mailers/.keep +0 -0
  41. data/spec/dummy/app/models/.keep +0 -0
  42. data/spec/dummy/app/models/concerns/.keep +0 -0
  43. data/spec/dummy/app/models/user.rb +4 -0
  44. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  45. data/spec/dummy/bin/bundle +3 -0
  46. data/spec/dummy/bin/rails +4 -0
  47. data/spec/dummy/bin/rake +4 -0
  48. data/spec/dummy/config/application.rb +31 -0
  49. data/spec/dummy/config/boot.rb +7 -0
  50. data/spec/dummy/config/database.yml +25 -0
  51. data/spec/dummy/config/environment.rb +7 -0
  52. data/spec/dummy/config/environments/development.rb +39 -0
  53. data/spec/dummy/config/environments/production.rb +80 -0
  54. data/spec/dummy/config/environments/test.rb +43 -0
  55. data/spec/dummy/config/initializers/assets.rb +10 -0
  56. data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
  57. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  58. data/spec/dummy/config/initializers/doorkeeper.rb +94 -0
  59. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  60. data/spec/dummy/config/initializers/inflections.rb +18 -0
  61. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  62. data/spec/dummy/config/initializers/secret_token.rb +6 -0
  63. data/spec/dummy/config/initializers/session_store.rb +5 -0
  64. data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
  65. data/spec/dummy/config/locales/doorkeeper.en.yml +71 -0
  66. data/spec/dummy/config/locales/en.yml +23 -0
  67. data/spec/dummy/config/routes.rb +8 -0
  68. data/spec/dummy/config/secrets.yml +22 -0
  69. data/spec/dummy/config.ru +4 -0
  70. data/spec/dummy/db/migrate/20140915153344_create_users.rb +11 -0
  71. data/spec/dummy/db/migrate/20140915160601_create_doorkeeper_tables.rb +43 -0
  72. data/spec/dummy/db/schema.rb +62 -0
  73. data/spec/dummy/lib/assets/.keep +0 -0
  74. data/spec/dummy/log/.keep +0 -0
  75. data/spec/dummy/public/404.html +67 -0
  76. data/spec/dummy/public/422.html +67 -0
  77. data/spec/dummy/public/500.html +66 -0
  78. data/spec/dummy/public/favicon.ico +0 -0
  79. data/spec/factories/access_token.rb +13 -0
  80. data/spec/factories/application.rb +8 -0
  81. data/spec/factories/user.rb +7 -0
  82. data/spec/intergration/oauth2_default_strategy_spec.rb +189 -0
  83. data/spec/intergration/oauth2_protected_strategy_spec.rb +199 -0
  84. data/spec/intergration/oauth2_swagger_strategy_spec.rb +156 -0
  85. data/spec/lib/generators/wine_bouncer/initializer_generator_spec.rb +19 -0
  86. data/spec/lib/wine_bouncer/auth_methods/auth_methods_spec.rb +105 -0
  87. data/spec/lib/wine_bouncer/auth_strategies/default_spec.rb +76 -0
  88. data/spec/lib/wine_bouncer/auth_strategies/swagger_spec.rb +115 -0
  89. data/spec/rails_helper.rb +79 -0
  90. data/spec/shared/orm/active_record.rb +4 -0
  91. data/spec/spec_helper.rb +95 -0
  92. data/wine_bouncer.gemspec +33 -0
  93. metadata +386 -0
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dummy::Application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
10
+ config.cache_classes = true
11
+
12
+ # Do not eager load code on boot. This avoids loading your whole application
13
+ # just for the purpose of running a single test. If you are using a tool that
14
+ # preloads Rails for running tests, you may have to set it to true.
15
+ config.eager_load = true
16
+
17
+ # Configure static asset server for tests with Cache-Control for performance.
18
+ config.static_cache_control = 'public, max-age=3600' if Rails::VERSION::MAJOR < 5
19
+
20
+ config.public_file_server.enabled = true if Rails::VERSION::MAJOR >= 5
21
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } if Rails::VERSION::MAJOR >= 5
22
+
23
+ # Show full error reports and disable caching.
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+
27
+ # Raise exceptions instead of rendering exception templates.
28
+ config.action_dispatch.show_exceptions = false
29
+
30
+ # Disable request forgery protection in test environment.
31
+ config.action_controller.allow_forgery_protection = false
32
+
33
+ # Tell Action Mailer not to deliver emails to the real world.
34
+ # The :test delivery method accumulates sent emails in the
35
+ # ActionMailer::Base.deliveries array.
36
+ #config.action_mailer.delivery_method = :test
37
+
38
+ # Print deprecation notices to the stderr.
39
+ config.active_support.deprecation = :stderr
40
+
41
+ # Raises error for missing translations
42
+ # config.action_view.raise_on_missing_translations = true
43
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Version of your assets, change this if you want to expire all your assets.
6
+ Rails.application.config.assets.version = '1.0'
7
+
8
+ # Precompile additional assets.
9
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
10
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
6
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
7
+
8
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
9
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ Doorkeeper.configure do
4
+ # Change the ORM that doorkeeper will use.
5
+ # Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper
6
+ orm :active_record
7
+
8
+ # This block will be called to check whether the resource owner is authenticated or not.
9
+ resource_owner_authenticator do
10
+ fail "Please configure doorkeeper resource_owner_authenticator block located in #{__FILE__}"
11
+ # Put your resource owner authentication logic here.
12
+ # Example implementation:
13
+ # User.find_by_id(session[:user_id]) || redirect_to(new_user_session_url)
14
+ end
15
+
16
+ # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below.
17
+ # admin_authenticator do
18
+ # # Put your admin authentication logic here.
19
+ # # Example implementation:
20
+ # Admin.find_by_id(session[:admin_id]) || redirect_to(new_admin_session_url)
21
+ # end
22
+
23
+ # Authorization Code expiration time (default 10 minutes).
24
+ # authorization_code_expires_in 10.minutes
25
+
26
+ # Access token expiration time (default 2 hours).
27
+ # If you want to disable expiration, set this to nil.
28
+ # access_token_expires_in 2.hours
29
+
30
+ # Reuse access token for the same resource owner within an application (disabled by default)
31
+ # Rationale: https://github.com/doorkeeper-gem/doorkeeper/issues/383
32
+ # reuse_access_token
33
+
34
+ # Issue access tokens with refresh token (disabled by default)
35
+ # use_refresh_token
36
+
37
+ # Provide support for an owner to be assigned to each registered application (disabled by default)
38
+ # Optional parameter :confirmation => true (default false) if you want to enforce ownership of
39
+ # a registered application
40
+ # Note: you must also run the rails g doorkeeper:application_owner generator to provide the necessary support
41
+ # enable_application_owner :confirmation => false
42
+
43
+ # Define access token scopes for your provider
44
+ # For more information go to
45
+ # https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopes
46
+ default_scopes :public, :default
47
+ optional_scopes :write, :update
48
+
49
+ # Change the way client credentials are retrieved from the request object.
50
+ # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
51
+ # falls back to the `:client_id` and `:client_secret` params from the `params` object.
52
+ # Check out the wiki for more information on customization
53
+ # client_credentials :from_basic, :from_params
54
+
55
+ # Change the way access token is authenticated from the request object.
56
+ # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
57
+ # falls back to the `:access_token` or `:bearer_token` params from the `params` object.
58
+ # Check out the wiki for more information on customization
59
+ # access_token_methods :from_bearer_authorization, :from_access_token_param, :from_bearer_param
60
+
61
+ # Change the native redirect uri for client apps
62
+ # When clients register with the following redirect uri, they won't be redirected to any server and the authorization code will be displayed within the provider
63
+ # The value can be any string. Use nil to disable this feature. When disabled, clients must provide a valid URL
64
+ # (Similar behaviour: https://developers.google.com/accounts/docs/OAuth2InstalledApp#choosingredirecturi)
65
+ #
66
+ # native_redirect_uri 'urn:ietf:wg:oauth:2.0:oob'
67
+
68
+ # Specify what grant flows are enabled in array of Strings. The valid
69
+ # strings and the flows they enable are:
70
+ #
71
+ # "authorization_code" => Authorization Code Grant Flow
72
+ # "implicit" => Implicit Grant Flow
73
+ # "password" => Resource Owner Password Credentials Grant Flow
74
+ # "client_credentials" => Client Credentials Grant Flow
75
+ #
76
+ # If not specified, Doorkeeper enables all the four grant flows.
77
+ #
78
+ # grant_flows %w(authorization_code implicit password client_credentials)
79
+
80
+ # Under some circumstances you might want to have applications auto-approved,
81
+ # so that the user skips the authorization step.
82
+ # For example if dealing with trusted a application.
83
+ # skip_authorization do |resource_owner, client|
84
+ # client.superapp? or resource_owner.admin?
85
+ # end
86
+
87
+ # WWW-Authenticate Realm (default "Doorkeeper").
88
+ # realm "Doorkeeper"
89
+
90
+ # Allow dynamic query parameters (disabled by default)
91
+ # Some applications require dynamic query parameters on their request_uri
92
+ # set to true if you want this to be allowed
93
+ # wildcard_redirect_uri false
94
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new inflection rules using the following format. Inflections
6
+ # are locale specific, and you may define rules for as many different
7
+ # locales as you wish. All of these examples are active by default:
8
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
9
+ # inflect.plural /^(ox)$/i, '\1en'
10
+ # inflect.singular /^(ox)en/i, '\1'
11
+ # inflect.irregular 'person', 'people'
12
+ # inflect.uncountable %w( fish sheep )
13
+ # end
14
+
15
+ # These inflection rules are supported but not enabled by default:
16
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
17
+ # inflect.acronym 'RESTful'
18
+ # end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new mime types for use in respond_to blocks:
6
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ if ENV['rails'][0].to_i > 4 && ENV['rails'][2].to_i >= 1
3
+ Dummy::Application.config.secret_key_base = '23d9b4867e1370428ac81119ec43914b117ef4d95e8cb563c7813b22e1ac260688d0b11958eaae30f587712ac75ab852c76b91594e9f8a851fa5cd53ef2088a4'
4
+ else
5
+ Dummy::Application.config.secret_token = 'c65fd1ffec8275651d1fd06ec3a4914ba644bbeb87729594a3b35fb4b7ad4cccd298d77baf63f7a6513d437e5b95eef9637f9c37a9691c3ed41143d8b5f9a5ef'
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # This file contains settings for ActionController::ParamsWrapper which
6
+ # is enabled by default.
7
+
8
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
9
+ ActiveSupport.on_load(:action_controller) do
10
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
11
+ end
12
+
13
+ # To enable root element in JSON for ActiveRecord objects.
14
+ # ActiveSupport.on_load(:active_record) do
15
+ # self.include_root_in_json = true
16
+ # end
@@ -0,0 +1,71 @@
1
+ en:
2
+ activerecord:
3
+ errors:
4
+ models:
5
+ application:
6
+ attributes:
7
+ redirect_uri:
8
+ fragment_present: 'cannot contain a fragment.'
9
+ invalid_uri: 'must be a valid URI.'
10
+ relative_uri: 'must be an absolute URI.'
11
+ mongoid:
12
+ errors:
13
+ models:
14
+ application:
15
+ attributes:
16
+ redirect_uri:
17
+ fragment_present: 'cannot contain a fragment.'
18
+ invalid_uri: 'must be a valid URI.'
19
+ relative_uri: 'must be an absolute URI.'
20
+ mongo_mapper:
21
+ errors:
22
+ models:
23
+ application:
24
+ attributes:
25
+ redirect_uri:
26
+ fragment_present: 'cannot contain a fragment.'
27
+ invalid_uri: 'must be a valid URI.'
28
+ relative_uri: 'must be an absolute URI.'
29
+ doorkeeper:
30
+ errors:
31
+ messages:
32
+ # Common error messages
33
+ invalid_request: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.'
34
+ invalid_redirect_uri: 'The redirect uri included is not valid.'
35
+ unauthorized_client: 'The client is not authorized to perform this request using this method.'
36
+ access_denied: 'The resource owner or authorization server denied the request.'
37
+ invalid_scope: 'The requested scope is invalid, unknown, or malformed.'
38
+ server_error: 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.'
39
+ temporarily_unavailable: 'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.'
40
+
41
+ #configuration error messages
42
+ credential_flow_not_configured: 'Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.'
43
+ resource_owner_authenticator_not_configured: 'Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfiged.'
44
+
45
+ # Access grant errors
46
+ unsupported_response_type: 'The authorization server does not support this response type.'
47
+
48
+ # Access token errors
49
+ invalid_client: 'Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.'
50
+ invalid_grant: 'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.'
51
+ unsupported_grant_type: 'The authorization grant type is not supported by the authorization server.'
52
+
53
+ # Password Access token errors
54
+ invalid_resource_owner: 'The provided resource owner credentials are not valid, or resource owner cannot be found'
55
+
56
+ invalid_token:
57
+ revoked: "The access token was revoked"
58
+ expired: "The access token expired"
59
+ unknown: "The access token is invalid"
60
+
61
+ flash:
62
+ applications:
63
+ create:
64
+ notice: 'Application created.'
65
+ destroy:
66
+ notice: 'Application deleted.'
67
+ update:
68
+ notice: 'Application updated.'
69
+ authorized_applications:
70
+ destroy:
71
+ notice: 'Application revoked.'
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ use_doorkeeper
5
+ mount Api::DefaultApiUnderTest => '/default_api'
6
+ mount Api::SwaggerApiUnderTest => '/swagger_api'
7
+ mount Api::ProtectedApiUnderTest => '/protected_api'
8
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: f3331e00ed5d76db3737b2a0b4ccd79f19d858394ddc4995361813a18b24910af0b010475c7b8520ee35c04511e7d258b04b334131bfafdc119129b9c8d0cb83
15
+
16
+ test:
17
+ secret_key_base: c65fd1ffec8275651d1fd06ec3a4914ba644bbeb87729594a3b35fb4b7ad4cccd298d77baf63f7a6513d437e5b95eef9637f9c37a9691c3ed41143d8b5f9a5ef
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateUsers < ActiveRecord::Migration
4
+ def change
5
+ create_table :users do |t|
6
+ t.string :name
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateDoorkeeperTables < ActiveRecord::Migration
4
+ def change
5
+ create_table :oauth_applications do |t|
6
+ t.string :name, null: false
7
+ t.string :uid, null: false
8
+ t.string :secret, null: false
9
+ t.text :redirect_uri, null: false
10
+ t.timestamps
11
+ end
12
+
13
+ add_index :oauth_applications, :uid, unique: true
14
+
15
+ create_table :oauth_access_grants do |t|
16
+ t.integer :resource_owner_id, null: false
17
+ t.integer :application_id, null: false
18
+ t.string :token, null: false
19
+ t.integer :expires_in, null: false
20
+ t.text :redirect_uri, null: false
21
+ t.datetime :created_at, null: false
22
+ t.datetime :revoked_at
23
+ t.string :scopes
24
+ end
25
+
26
+ add_index :oauth_access_grants, :token, unique: true
27
+
28
+ create_table :oauth_access_tokens do |t|
29
+ t.integer :resource_owner_id
30
+ t.integer :application_id
31
+ t.string :token, null: false
32
+ t.string :refresh_token
33
+ t.integer :expires_in
34
+ t.datetime :revoked_at
35
+ t.datetime :created_at, null: false
36
+ t.string :scopes
37
+ end
38
+
39
+ add_index :oauth_access_tokens, :token, unique: true
40
+ add_index :oauth_access_tokens, :resource_owner_id
41
+ add_index :oauth_access_tokens, :refresh_token, unique: true
42
+ end
43
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ # encoding: UTF-8
4
+ # This file is auto-generated from the current state of the database. Instead
5
+ # of editing this file, please use the migrations feature of Active Record to
6
+ # incrementally modify your database, and then regenerate this schema definition.
7
+ #
8
+ # Note that this schema.rb definition is the authoritative source for your
9
+ # database schema. If you need to create the application database on another
10
+ # system, you should be using db:schema:load, not running all the migrations
11
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
12
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
13
+ #
14
+ # It's strongly recommended that you check this file into your version control system.
15
+
16
+ ActiveRecord::Schema.define(version: 20140915160601) do
17
+ create_table 'oauth_access_grants', force: true do |t|
18
+ t.integer 'resource_owner_id', null: false
19
+ t.integer 'application_id', null: false
20
+ t.string 'token', null: false
21
+ t.integer 'expires_in', null: false
22
+ t.text 'redirect_uri', null: false
23
+ t.datetime 'created_at', null: false
24
+ t.datetime 'revoked_at'
25
+ t.string 'scopes'
26
+ end
27
+
28
+ add_index 'oauth_access_grants', ['token'], name: 'index_oauth_access_grants_on_token', unique: true
29
+
30
+ create_table 'oauth_access_tokens', force: true do |t|
31
+ t.integer 'resource_owner_id'
32
+ t.integer 'application_id'
33
+ t.string 'token', null: false
34
+ t.string 'refresh_token'
35
+ t.integer 'expires_in'
36
+ t.datetime 'revoked_at'
37
+ t.datetime 'created_at', null: false
38
+ t.string 'scopes'
39
+ end
40
+
41
+ add_index 'oauth_access_tokens', ['refresh_token'], name: 'index_oauth_access_tokens_on_refresh_token', unique: true
42
+ add_index 'oauth_access_tokens', ['resource_owner_id'], name: 'index_oauth_access_tokens_on_resource_owner_id'
43
+ add_index 'oauth_access_tokens', ['token'], name: 'index_oauth_access_tokens_on_token', unique: true
44
+
45
+ create_table 'oauth_applications', force: true do |t|
46
+ t.string 'name', null: false
47
+ t.string 'uid', null: false
48
+ t.string 'secret', null: false
49
+ t.text 'redirect_uri', null: false
50
+ t.datetime 'created_at'
51
+ t.datetime 'updated_at'
52
+ t.boolean "confidential", default: true, null: false
53
+ end
54
+
55
+ add_index 'oauth_applications', ['uid'], name: 'index_oauth_applications_on_uid', unique: true
56
+
57
+ create_table 'users', force: true do |t|
58
+ t.string 'name'
59
+ t.datetime 'created_at'
60
+ t.datetime 'updated_at'
61
+ end
62
+ end
File without changes
File without changes
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>