auth0 3.4.0 → 3.5.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/Rakefile +1 -0
- data/lib/auth0/mixins/initializer.rb +10 -1
- data/lib/auth0/version.rb +1 -1
- data/spec/integration/lib/auth0/api/v1/api_users_spec.rb +0 -1
- data/spec/integration/lib/auth0/api/v2/api_users_spec.rb +0 -1
- data/spec/integration/lib/auth0/auth0_client_spec.rb +11 -0
- data/spec/spec_helper_full.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af6137265bad4b8ee94d95e6f260aa8594614df3
|
4
|
+
data.tar.gz: 42e5145db97b457f3f7127dc880cb27b6d6da959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0865e559b9dc2b027a03e5b4286cc59870c2271602069306677347b52afdb9419f99ef43291ac024b5dc3023947d965a71024f7f72375754d924bd794916fd3d
|
7
|
+
data.tar.gz: aa6c2e53a3fbe2998c75c932a79178ce953223268c10d7c05a0ab17f51de139ffc217e5a69ba900d0dd87f72d58387f3f0e097d7363c4952a5d191534eb4dfcd
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ module Auth0
|
|
12
12
|
domain = api_domain options
|
13
13
|
raise InvalidApiNamespace, "Api namespace must supply an API domain" if domain.nil?
|
14
14
|
self.class.base_uri "https://#{domain}"
|
15
|
-
self.class.headers
|
15
|
+
self.class.headers client_headers(config)
|
16
16
|
self.extend Auth0::Api::AuthenticationEndpoints
|
17
17
|
@client_id = options[:client_id]
|
18
18
|
initialize_v2(options) if api_v2?(options)
|
@@ -28,6 +28,15 @@ module Auth0
|
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
+
def client_headers(config)
|
32
|
+
sdk_headers = {
|
33
|
+
'Content-Type' => 'application/json',
|
34
|
+
}
|
35
|
+
sdk_headers['User-Agent'] = "Ruby/#{RUBY_VERSION}" if not config[:opt_out_sdk_info]
|
36
|
+
sdk_headers['Auth0-Client'] = "ruby-auth0/#{Auth0::VERSION}" if not config[:opt_out_sdk_info]
|
37
|
+
sdk_headers
|
38
|
+
end
|
39
|
+
|
31
40
|
def api_domain(options)
|
32
41
|
options[:domain] || options[:namespace]
|
33
42
|
end
|
data/lib/auth0/version.rb
CHANGED
@@ -16,7 +16,6 @@ describe Auth0::Api::V1::Users do
|
|
16
16
|
let(:users) { client.users() }
|
17
17
|
|
18
18
|
it { expect(users.size).to be > 0 }
|
19
|
-
it { expect(users.find {|user| user["email"] == email}).to_not be_nil }
|
20
19
|
|
21
20
|
context "#filters" do
|
22
21
|
it { expect(client.users("email: #{email}").size).to be 1 }
|
@@ -20,7 +20,6 @@ describe Auth0::Api::V2::Users do
|
|
20
20
|
let(:users) { client.users() }
|
21
21
|
|
22
22
|
it { expect(users.size).to be > 0 }
|
23
|
-
it { expect(users.find {|user| user["email"] == email}).to_not be_nil }
|
24
23
|
|
25
24
|
context "#filters" do
|
26
25
|
it { expect(client.users(per_page: 1).size).to be 1 }
|
@@ -42,4 +42,15 @@ describe Auth0::Client do
|
|
42
42
|
let(:credentials) { v2_credentials.merge({access_token: ENV["MASTER_JWT"]}) }
|
43
43
|
end
|
44
44
|
|
45
|
+
describe "client headers" do
|
46
|
+
let(:access_token) { 'abc123' }
|
47
|
+
let(:domain) { 'myhost.auth0.com' }
|
48
|
+
let(:client) { Auth0::Client.new(v2_credentials.merge({access_token: access_token, domain: domain})) }
|
49
|
+
|
50
|
+
let(:headers) { client.class.headers }
|
51
|
+
specify { expect(headers).to include("Auth0-Client" => "ruby-auth0/#{Auth0::VERSION}") }
|
52
|
+
specify { expect(headers).to include("User-Agent" => "Ruby/#{RUBY_VERSION}") }
|
53
|
+
specify { expect(headers).to include("Authorization" => "Bearer #{access_token}") }
|
54
|
+
specify { expect(headers).to include("Content-Type" => "application/json") }
|
55
|
+
end
|
45
56
|
end
|
data/spec/spec_helper_full.rb
CHANGED
@@ -20,21 +20,23 @@ Dir[("./lib/**/*.rb")].each { |f| require f }
|
|
20
20
|
Dir[("./spec/support/**/*.rb")].each { |f| require f }
|
21
21
|
|
22
22
|
def entity_suffix
|
23
|
-
ENV["
|
23
|
+
ENV["TRAVIS_JOB_ID"] || "_local"
|
24
24
|
end
|
25
25
|
|
26
26
|
RSpec.configure do |config|
|
27
|
+
config.filter_run :focus => true
|
28
|
+
config.run_all_when_everything_filtered = true
|
27
29
|
config.include Rack::Test::Methods
|
28
30
|
config.include Credentials
|
29
31
|
config.after(:suite) do
|
30
32
|
v2_client = Auth0Client.new({token: ENV["MASTER_JWT"], api_version: 2, domain: ENV["DOMAIN"]})
|
31
33
|
v2_client
|
32
34
|
.clients
|
33
|
-
.select { |client| client["name"] != "DefaultApp" and not client["global"] and client["name"].
|
35
|
+
.select { |client| client["name"] != "DefaultApp" and not client["global"] and client["name"].include? entity_suffix }
|
34
36
|
.each { |client| v2_client.delete_client(client["client_id"]) }
|
35
37
|
v2_client
|
36
38
|
.users
|
37
|
-
.select { |user| user["email"].split("@").first.
|
39
|
+
.select { |user| user["email"].split("@").first.end_with? entity_suffix }
|
38
40
|
.each { |user| v2_client.delete_user(user["user_id"])}
|
39
41
|
end
|
40
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-05-
|
14
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|