solidus_devise_token_auth 2.8.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +297 -0
  3. data/lib/sandbox.sh +55 -0
  4. data/lib/solidus.rb +7 -0
  5. data/lib/spree.rb +3 -0
  6. metadata +119 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5110a63ef96e833e7b8e35a08a57b41566fbaab69570d4e2bffaf0c3c9150004
4
+ data.tar.gz: 05a1c8ba3e9ce720aead71fbf4837761c9eab748361061d372e1a3c47f41982a
5
+ SHA512:
6
+ metadata.gz: 31e75b5a469dd5eddbea8921a13e714c9ce38d52302f56e6b73bef6773e77c62e2010c80856192cc483c320cdb6b1e9bc5c229c6bbe669a7ea16826cb9ae0222
7
+ data.tar.gz: c56765a91b0a316dc0f9c1f452148136caefd608680e27f61aae2490ed08647e9dfc98dca532da4da3c6a4f0f35c2d5daa62694f5cf4f0194074fccb1d62c9ce
data/README.md ADDED
@@ -0,0 +1,297 @@
1
+
2
+ <img src="./logo.svg" width=350>
3
+
4
+ - [solidus.io](http://solidus.io/)
5
+ - [Documentation](https://guides.solidus.io)
6
+ - [Join our Slack](http://slack.solidus.io/) ([solidusio.slack.com](http://solidusio.slack.com))
7
+ - [solidus-security](https://groups.google.com/forum/#!forum/solidus-security) mailing list
8
+
9
+ ## devise_token_auth fork summary
10
+
11
+ Background story tl;dr: I wanted to use `solidus_api` along with provided admin panel (`solidus_backend`), but the default api authentication mechanism
12
+ did not satisfy my security and usage needs at all. At first, I only wanted to fork the `solidus_api` gem and integrate it with [devise_token_auth](https://github.com/lynndylanhurley/devise_token_auth),
13
+ but it turned out that the whole solidus project heavily relies on this default `spree_api_key` thing - so here it is, a `solidus` fork, extensively revised to be fully compliant with `devise_token_auth`,
14
+ replacing the `spree_api_key` mechanism also in stuff like `solidus_backend`. The test suite is fully passing; I have also upgraded it a little to test stuff (like authentication) that it used to just stub previously.
15
+
16
+ There are so many changes that it can't simply be merged to the upstream repository - people use that `spree_api_key` in their own integrations, so this fork is usable mostly when you're starting from scratch
17
+ and want to use solidus with devise_token_auth or you want to use the solidus_api for the first time, or if you want to refactor your existing `solidus_api` app to become more secure.
18
+
19
+ As of 24.10.2018 the upstream repository is merged, but if you need some latest solidus features and nobody updates this repo from the upstream, feel free to do it yourself - it shouldn't take much more
20
+ than just resolving some git conflicts, bumping the version and submitting a pull request here.
21
+
22
+ ## So how do I use this with `devise_token_auth`?
23
+
24
+ To add solidus_devise_token_auth, begin with a Rails 5 application and a database configured and created. Add the following to your Gemfile:
25
+
26
+ ```ruby
27
+ gem 'solidus_devise_token_auth'
28
+ gem 'solidus_auth_devise'
29
+ ```
30
+
31
+ Then basically just follow the original solidus guides, watching out for api authentication (described [here](https://github.com/skycocker/solidus/blob/master/guides/source/developers/api/overview.html.md)).
32
+
33
+ ## How do I use just specific components?
34
+
35
+ Every piece is rebuilt and available on rubygems:
36
+
37
+ ```ruby
38
+ gem 'solidus_api_devise_token_auth'
39
+ gem 'solidus_frontend_devise_token_auth'
40
+ gem 'solidus_backend_devise_token_auth'
41
+ gem 'solidus_core_devise_token_auth'
42
+ gem 'solidus_sample_devise_token_auth'
43
+ ```
44
+
45
+
46
+ ## Solidus summary
47
+
48
+ Solidus is a complete open source ecommerce solution built with Ruby on Rails.
49
+ It is a fork of [Spree](https://spreecommerce.org).
50
+
51
+ See the [Solidus class documentation](http://docs.solidus.io) and the [Solidus
52
+ Guides](https://guides.solidus.io) for information about the functionality that
53
+ Solidus provides.
54
+
55
+ Solidus consists of several gems. When you require the `solidus` gem in your
56
+ `Gemfile`, Bundler will install all of the gems maintained in this repository:
57
+
58
+ - [`solidus_api`](https://github.com/solidusio/solidus/tree/master/api) (RESTful API)
59
+ - [`solidus_frontend`](https://github.com/solidusio/solidus/tree/master/frontend) (Cart and storefront)
60
+ - [`solidus_backend`](https://github.com/solidusio/solidus/tree/master/backend) (Admin area)
61
+ - [`solidus_core`](https://github.com/solidusio/solidus/tree/master/core) (Essential models, mailers, and classes)
62
+ - [`solidus_sample`](https://github.com/solidusio/solidus/tree/master/sample) (Sample data)
63
+
64
+ All of the gems are designed to work together to provide a fully functional
65
+ ecommerce platform. However, you may only want to use the
66
+ [`solidus_core`](https://github.com/solidusio/solidus/tree/master/core) gem
67
+ combine it with your own custom frontend, admin interface, and API.
68
+
69
+ [![Circle CI](https://circleci.com/gh/solidusio/solidus/tree/master.svg?style=shield)](https://circleci.com/gh/solidusio/solidus/tree/master)
70
+ [![Gem](https://img.shields.io/gem/v/solidus.svg)](https://rubygems.org/gems/solidus)
71
+ [![License](http://img.shields.io/badge/license-BSD-yellowgreen.svg)](LICENSE.md)
72
+ [![Slack](http://slack.solidus.io/badge.svg)](http://slack.solidus.io)
73
+
74
+ ## Demo
75
+
76
+ Try out Solidus with one-click on Heroku:
77
+
78
+ [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/solidusio/solidus)
79
+
80
+ ## Getting started
81
+
82
+ Begin by making sure you have
83
+ [Imagemagick](http://imagemagick.org/script/download.php) installed, which is
84
+ required for Paperclip. (You can install it using [Homebrew](https://brew.sh) if
85
+ you're on a Mac.)
86
+
87
+ To add solidus, begin with a Rails 5 application and a database configured and
88
+ created. Add the following to your Gemfile.
89
+
90
+ ```ruby
91
+ gem 'solidus'
92
+ gem 'solidus_auth_devise'
93
+ ```
94
+
95
+ Run the `bundle` command to install.
96
+
97
+ After installing gems, you'll have to run the generators to create necessary
98
+ configuration files and migrations.
99
+
100
+ ```bash
101
+ bundle exec rails g spree:install
102
+ bundle exec rails g solidus:auth:install
103
+ bundle exec rake railties:install:migrations
104
+ ```
105
+
106
+ Run migrations to create the new models in the database.
107
+
108
+ ```bash
109
+ bundle exec rake db:migrate
110
+ ```
111
+
112
+ Finally start the rails server
113
+
114
+ ```bash
115
+ bundle exec rails s
116
+ ```
117
+
118
+ The [`solidus_frontend`](https://github.com/solidusio/solidus/tree/master/frontend) storefront will be accessible at [http://localhost:3000/](http://localhost:3000/)
119
+ and the admin can be found at [http://localhost:3000/admin/](http://localhost:3000/admin/).
120
+
121
+ ### Default Username/Password
122
+
123
+ As part of running the above installation steps, you will be asked to set an admin email/password combination. The default values are `admin@example.com` and `test123`, respectively.
124
+
125
+ ### Questions?
126
+
127
+ The best way to ask questions is via the [#support channel on the Solidus Slack](https://solidusio.slack.com/messages/support/details/).
128
+
129
+ Installation options
130
+ --------------------
131
+
132
+ Instead of a stable build, if you want to use the bleeding edge version of
133
+ Solidus, use this line:
134
+
135
+ ```ruby
136
+ gem 'solidus', github: 'solidusio/solidus'
137
+ ```
138
+
139
+ **Note: The master branch is not guaranteed to ever be in a fully functioning
140
+ state. It is unwise to use this branch in a production system you care deeply
141
+ about.**
142
+
143
+ By default, the installation generator (`rails g spree:install`) will run
144
+ migrations as well as adding seed and sample data. This can be disabled using
145
+
146
+ ```bash
147
+ rails g spree:install --migrate=false --sample=false --seed=false
148
+ ```
149
+
150
+ You can always perform any of these steps later by using these commands.
151
+
152
+ ```bash
153
+ bundle exec rake railties:install:migrations
154
+ bundle exec rake db:migrate
155
+ bundle exec rake db:seed
156
+ bundle exec rake spree_sample:load
157
+ ```
158
+
159
+ There are also options and rake tasks provided by
160
+ [solidus\_auth\_devise](https://github.com/solidusio/solidus_auth_devise).
161
+
162
+ Performance
163
+ -----------
164
+
165
+ You may notice that your Solidus store runs slowly in development mode. This
166
+ can be because in development each CSS and JavaScript is loaded as a separate
167
+ include. This can be disabled by adding the following to
168
+ `config/environments/development.rb`.
169
+
170
+ ```ruby
171
+ config.assets.debug = false
172
+ ```
173
+
174
+ ### Turbolinks
175
+
176
+ To gain some extra speed you may enable Turbolinks inside of Solidus admin.
177
+
178
+ Add `gem 'turbolinks', '~> 5.0.0'` into your `Gemfile` (if not already present) and append these lines to `vendor/assets/spree/backend/all.js`:
179
+
180
+ ```js
181
+ //= require turbolinks
182
+ //= require backend/app/assets/javascripts/spree/backend/turbolinks-integration.js
183
+ ```
184
+
185
+ **CAUTION** Please be aware that Turbolinks can break extensions and/or customizations to the Solidus admin.
186
+ Use at own risk.
187
+
188
+ Developing Solidus
189
+ ------------------
190
+
191
+ * Clone the Git repo
192
+
193
+ ```bash
194
+ git clone git://github.com/solidusio/solidus.git
195
+ cd solidus
196
+ ```
197
+
198
+ * Install the gem dependencies
199
+
200
+ ```bash
201
+ bundle install
202
+ ```
203
+
204
+ ### Sandbox
205
+
206
+ Solidus is meant to be run within the context of Rails application. You can
207
+ easily create a sandbox application inside of your cloned source directory for
208
+ testing purposes.
209
+
210
+ This sandbox includes solidus\_auth\_devise and generates with seed and sample
211
+ data already loaded.
212
+
213
+ * Create the sandbox application (`DB=mysql` or `DB=postgresql` can be specified
214
+ to override the default sqlite)
215
+
216
+ ```bash
217
+ bundle exec rake sandbox
218
+ ```
219
+
220
+ * Start the server
221
+
222
+ ```bash
223
+ cd sandbox
224
+ rails server
225
+ ```
226
+
227
+ ### Tests
228
+
229
+ Solidus uses [RSpec](http://rspec.info) for tests. Refer to its documentation for
230
+ more information about the testing library.
231
+
232
+ #### CircleCI
233
+
234
+ We use CircleCI to run the tests for Solidus as well as all incoming pull
235
+ requests. All pull requests must pass to be merged.
236
+
237
+ You can see the build statuses at
238
+ [https://circleci.com/gh/solidusio/solidus](https://circleci.com/gh/solidusio/solidus).
239
+
240
+ #### Run all tests
241
+
242
+ [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) is
243
+ required to run the frontend and backend test suites.
244
+
245
+ To execute all of the test specs, run the `build.sh` script at the root of the Solidus project:
246
+
247
+ ```bash
248
+ bash build.sh
249
+ ```
250
+
251
+ The `build.sh` script runs using PostgreSQL by default, but it can be overridden by setting the DB environment variable to `DB=sqlite` or `DB=mysql`. For example:
252
+
253
+ ```bash
254
+ DB=mysql bash build.sh
255
+ ```
256
+
257
+ #### Run an individual test suite
258
+
259
+ Each gem contains its own series of tests. To run the tests for the core project:
260
+
261
+ ```bash
262
+ cd core
263
+ bundle exec rspec
264
+ ```
265
+
266
+ By default, `rspec` runs the tests for SQLite 3. If you would like to run specs
267
+ against another database you may specify the database in the command:
268
+
269
+ ```bash
270
+ DB=postgresql bundle exec rspec
271
+ ```
272
+
273
+ #### Code coverage reports
274
+
275
+ If you want to run the [SimpleCov](https://github.com/colszowka/simplecov) code
276
+ coverage report:
277
+
278
+ ```bash
279
+ COVERAGE=true bundle exec rspec
280
+ ```
281
+
282
+ ### Extensions
283
+
284
+ In addition to core functionality provided in Solidus, there are a number of
285
+ ways to add features to your store that are not (or not yet) part of the core
286
+ project.
287
+
288
+ A list can be found at [extensions.solidus.io](http://extensions.solidus.io/).
289
+
290
+ If you want to write an extension for Solidus, you can use the
291
+ [solidus_cmd](https://www.github.com/solidusio/solidus_cmd.git) gem.
292
+
293
+ Contributing
294
+ ------------
295
+
296
+ Solidus is an open source project and we encourage contributions. Please read
297
+ [CONTRIBUTING.md](CONTRIBUTING.md) before contributing.
data/lib/sandbox.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ # Used in the sandbox rake task in Rakefile
3
+
4
+ set -e
5
+
6
+ case "$DB" in
7
+ postgres|postgresql)
8
+ RAILSDB="postgresql"
9
+ ;;
10
+ mysql)
11
+ RAILSDB="mysql"
12
+ ;;
13
+ sqlite|'')
14
+ RAILSDB="sqlite3"
15
+ ;;
16
+ *)
17
+ echo "Invalid DB specified: $DB"
18
+ exit 1
19
+ ;;
20
+ esac
21
+
22
+ rm -rf ./sandbox
23
+ bundle exec rails new sandbox --database="$RAILSDB" \
24
+ --skip-bundle \
25
+ --skip-git \
26
+ --skip-keeps \
27
+ --skip-rc \
28
+ --skip-spring \
29
+ --skip-test \
30
+ --skip-yarn
31
+
32
+ if [ ! -d "sandbox" ]; then
33
+ echo 'sandbox rails application failed'
34
+ exit 1
35
+ fi
36
+
37
+ cd ./sandbox
38
+ cat <<RUBY >> Gemfile
39
+
40
+ gem 'solidus', path: '..'
41
+ gem 'solidus_auth_devise', '>= 2.1.0'
42
+ gem 'rails-i18n'
43
+ gem 'solidus_i18n'
44
+
45
+ group :test, :development do
46
+ platforms :mri do
47
+ gem 'pry-byebug'
48
+ end
49
+ end
50
+ RUBY
51
+
52
+ bundle install --gemfile Gemfile
53
+ bundle exec rake db:drop db:create
54
+ bundle exec rails g spree:install --auto-accept --user_class=Spree::User --enforce_available_locales=true
55
+ bundle exec rails g solidus:auth:install
data/lib/solidus.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'solidus_core'
4
+ require 'solidus_api'
5
+ require 'solidus_backend'
6
+ require 'solidus_frontend'
7
+ require 'solidus_sample'
data/lib/spree.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'solidus'
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solidus_devise_token_auth
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.8.0.alpha.3
5
+ platform: ruby
6
+ authors:
7
+ - Michał Siwek (skycocker)
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: solidus_api_devise_token_auth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.8.0.alpha.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.8.0.alpha.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: solidus_backend_devise_token_auth
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 2.8.0.alpha.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.8.0.alpha.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: solidus_core_devise_token_auth
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.8.0.alpha.3
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.8.0.alpha.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: solidus_frontend_devise_token_auth
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.0.alpha.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.8.0.alpha.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: solidus_sample_devise_token_auth
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 2.8.0.alpha.3
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.8.0.alpha.3
83
+ description: Solidus is an open source e-commerce framework for Ruby on Rails.
84
+ email: mike21@aol.pl
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - README.md
90
+ - lib/sandbox.sh
91
+ - lib/solidus.rb
92
+ - lib/spree.rb
93
+ homepage: https://github.com/skycocker/solidus
94
+ licenses:
95
+ - BSD-3-Clause
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: 2.2.2
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 1.8.23
111
+ requirements:
112
+ - none
113
+ rubyforge_project:
114
+ rubygems_version: 2.7.6
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Full-stack e-commerce framework for Ruby on Rails (devise_token_auth revised
118
+ version)
119
+ test_files: []