stitches 4.2.1 → 5.0.0.RC1
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/.circleci/config.yml +175 -209
- data/.env.example +1 -0
- data/.github/CODEOWNERS +1 -1
- data/.github/workflows/scheduled_cci.yml +14 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -1
- data/README.md +18 -9
- data/lib/stitches/api_generator.rb +2 -24
- data/lib/stitches/api_key.rb +2 -0
- data/lib/stitches/api_migration_generator.rb +23 -0
- data/lib/stitches/configuration.rb +2 -1
- data/lib/stitches/generator_files/config/initializers/stitches.rb +4 -0
- data/lib/stitches/generator_files/spec/acceptance/ping_v1_spec.rb +4 -2
- data/lib/stitches/generator_files/spec/features/api_spec.rb.erb +3 -0
- data/lib/stitches/railtie.rb +0 -1
- data/lib/stitches/spec/test_headers.rb +1 -1
- data/lib/stitches/version.rb +1 -1
- data/lib/stitches_norailtie.rb +1 -0
- data/owners.json +1 -1
- data/spec/api_key_middleware_spec.rb +257 -225
- data/spec/configuration_spec.rb +4 -0
- data/spec/fake_app/.ruby-version +1 -1
- data/spec/fake_app/Gemfile +5 -6
- data/spec/fake_app/config/application.rb +1 -3
- data/spec/fake_app/config/database.yml +9 -10
- data/spec/fake_app/config/initializers/assets.rb +0 -3
- data/spec/integration/add_to_rails_app_spec.rb +3 -6
- data/spec/rails_helper.rb +4 -2
- data/stitches.gemspec +2 -1
- metadata +23 -19
- data/Gemfile.rails-4.2 +0 -8
- data/Gemfile.rails-5.0 +0 -8
- data/Gemfile.rails-5.1 +0 -7
- data/Gemfile.rails-5.2 +0 -7
- data/Gemfile.rails-6.0 +0 -7
- data/Gemfile.rails-6.1 +0 -7
- data/build-matrix.json +0 -4
- data/spec/fake_app/db/development.sqlite3 +0 -0
- data/spec/fake_app/db/test.sqlite3 +0 -0
- data/spec/fake_app/doc/api.md +0 -4
@@ -11,7 +11,8 @@ resource "Ping (V1)" do
|
|
11
11
|
response_field :status, "The status of the ping", scope: "ping", "Type" => "String"
|
12
12
|
example "ping the server to validate your client's happy path" do
|
13
13
|
|
14
|
-
|
14
|
+
# Only needed if you're using API Key authentication
|
15
|
+
# header "Authorization", "CustomKeyAuth key=#{api_client.key}"
|
15
16
|
do_request
|
16
17
|
|
17
18
|
result = JSON.parse(response_body)
|
@@ -33,7 +34,8 @@ resource "Ping (V1)" do
|
|
33
34
|
|
34
35
|
example "ping the server to validate your client's error handling" do
|
35
36
|
|
36
|
-
|
37
|
+
# Only needed if you're using API Key authentication
|
38
|
+
# header "Authorization", "CustomKeyAuth key=#{api_client.key}"
|
37
39
|
do_request
|
38
40
|
|
39
41
|
result = JSON.parse(response_body)
|
@@ -48,6 +48,8 @@ feature "general API stuff" do
|
|
48
48
|
expect(response).to have_api_error(code: "test", message: "OH NOES!")
|
49
49
|
end
|
50
50
|
|
51
|
+
<%# Remove always false if statement to enable API Key authentication %>
|
52
|
+
<% if false %>
|
51
53
|
scenario "no auth header given" do
|
52
54
|
headers = TestHeaders.new(api_client: nil)
|
53
55
|
<% if ::Rails::VERSION::MAJOR >= 5 -%>
|
@@ -80,6 +82,7 @@ feature "general API stuff" do
|
|
80
82
|
|
81
83
|
expect(response).to have_auth_error
|
82
84
|
end
|
85
|
+
<% end %>
|
83
86
|
|
84
87
|
scenario "no version" do
|
85
88
|
headers = TestHeaders.new(version: nil)
|
data/lib/stitches/railtie.rb
CHANGED
data/lib/stitches/version.rb
CHANGED
data/lib/stitches_norailtie.rb
CHANGED
@@ -12,6 +12,7 @@ require 'stitches/render_timestamps_in_iso8601_in_json'
|
|
12
12
|
require 'stitches/error'
|
13
13
|
require 'stitches/errors'
|
14
14
|
require 'stitches/api_generator'
|
15
|
+
require 'stitches/api_migration_generator'
|
15
16
|
require 'stitches/add_deprecation_generator'
|
16
17
|
require 'stitches/add_enabled_to_api_clients_generator'
|
17
18
|
require 'stitches/add_disabled_at_to_api_clients_generator'
|