auth0 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c233d8f871a4045c4fcf32245bf4cab7f12ea1ea
4
- data.tar.gz: 908f8c84e4ad3170363ec86e508323ebb2924d38
3
+ metadata.gz: bdf4ecb5c96f5e84e45fc413f782f157ac5ac50d
4
+ data.tar.gz: c3edbdcee08c40938fc43e97d836a779e3781b4d
5
5
  SHA512:
6
- metadata.gz: a57726e22e787af7e128c2fb9fe59cb4873d84f9df9f05e1bfa315a3217243c75e743032d738f7a346ebbfe0f8e956f287059d85a57f4a0547979d838ad29f29
7
- data.tar.gz: 20ca731787c59444212354b3f284400e9045b35aa64c15c2fb5ee4489c60d12fd48ad7cb41ad276f37bace8d2cf0fd869b248c8ecdfa15e4a1f293dc359111da
6
+ metadata.gz: f2931b8dfb4223dcb882351f995e51120378234642a59894fc271f441f886e68dfd41aaf4f653dd496b263a29fe6480e73210407f9a56997588776148676be08
7
+ data.tar.gz: eb8796cfb3d8ceb57da9bae51b9499220dfc3e7f54511b5d4a5c232306c13dffad697577a56683367493305e9986d910887da6d7c37f6c29b3bfe0c0e159d96d
@@ -0,0 +1,2 @@
1
+ bump:
2
+ tag: true
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ coverage
7
7
  spec/auth0.yml
8
8
  .yardoc
9
9
  Gemfile.lock
10
+ .env
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
1
  --color
2
- --format documentation
3
- --fail-fast
2
+ --format Fuubar
3
+ --color
@@ -1,4 +1,10 @@
1
1
  language: ruby
2
+
3
+ sudo: false
4
+
5
+ cache: bundler
6
+
2
7
  rvm:
3
- - 2.1.0
4
8
  - 2.2.1
9
+
10
+ script: MODE=full bundle exec rake all
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in auth0.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem 'terminal-notifier-guard', require: false
8
+ gem 'coveralls', require: false
9
+ end
@@ -0,0 +1,34 @@
1
+ scope group: :unit_test
2
+
3
+ group :unit_test do
4
+ guard 'rspec', cmd: "bundle exec rspec -P \"spec/lib/auth0/**/*#{ENV['PATTERN']}*_spec.rb\" --drb --format Fuubar --color" do
5
+ # run every updated spec file
6
+ watch(%r{^spec/.+_spec\.rb$})
7
+ # run the lib specs when a file in lib/ changes
8
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
9
+ # run all test for helper changes
10
+ watch('spec/spec_helper.rb') { "spec" }
11
+ end
12
+ end
13
+
14
+ group :integration do
15
+ guard 'rspec', cmd: "MODE=full bundle exec rspec -P \"spec/integration/**/*#{ENV['PATTERN']}*_spec.rb\" --drb --format Fuubar --color" do
16
+ # run every updated spec file
17
+ watch(%r{^spec/.+_spec\.rb$})
18
+ # run the lib specs when a file in lib/ changes
19
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
20
+ # run all test for helper changes
21
+ watch('spec/spec_helper.rb') { "spec" }
22
+ end
23
+ end
24
+
25
+ group :full do
26
+ guard 'rspec', cmd: "MODE=full bundle exec rspec --drb --format Fuubar --color" do
27
+ # run every updated spec file
28
+ watch(%r{^spec/.+_spec\.rb$})
29
+ # run the lib specs when a file in lib/ changes
30
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
31
+ # run all test for helper changes
32
+ watch('spec/spec_helper.rb') { "spec" }
33
+ end
34
+ end
data/README.md CHANGED
@@ -1,25 +1,36 @@
1
- Ruby api client for [Auth0](https://auth0.com)
1
+ Ruby api client for [Auth0](https://auth0.com) platform
2
2
 
3
3
  [![Build Status](https://travis-ci.org/auth0/ruby-auth0.svg?branch=master)](https://travis-ci.org/auth0/ruby-auth0)
4
+ [![Gem Version](https://badge.fury.io/rb/auth0.svg)](http://badge.fury.io/rb/auth0)
5
+ [![Coverage Status](https://coveralls.io/repos/auth0/ruby-auth0/badge.svg?branch=master)](https://coveralls.io/r/auth0/ruby-auth0?branch=master)
6
+ [![Dependency Status](https://gemnasium.com/auth0/ruby-auth0.svg)](https://gemnasium.com/auth0/ruby-auth0)
4
7
 
5
8
  ## Installation
6
9
 
7
- ```
10
+ ``` bash
8
11
  $ gem install auth0
9
12
  ```
10
13
 
14
+ or with [Bundler](http://bundler.io)
15
+
16
+ ```ruby
17
+ gem 'auth0'
18
+ ```
19
+
11
20
  ## Basic usage
12
21
 
22
+ Using [APIv1](https://auth0.com/docs/api)
23
+
13
24
  ```ruby
14
25
  require "auth0"
15
26
 
16
27
  auth0 = Auth0Client.new(
17
28
  :client_id => "YOUR CLIENT ID",
18
29
  :client_secret => "YOUR CLIENT SECRET",
19
- :namespace => "<YOUR ACCOUNT>.auth0.com"
30
+ :domain => "<YOUR ACCOUNT>.auth0.com"
20
31
  );
21
32
 
22
- puts auth0.get_connections;
33
+ puts auth0.get_users;
23
34
  ```
24
35
 
25
36
  Using [APIv2](https://auth0.com/docs/apiv2)
@@ -30,17 +41,37 @@ require "auth0"
30
41
  auth0 = Auth0Client.new(
31
42
  :api_version => 2,
32
43
  :token => "YOUR JWT HERE",
33
- :namespace => "<YOUR ACCOUNT>.auth0.com"
44
+ :domain => "<YOUR ACCOUNT>.auth0.com"
34
45
  );
35
46
 
36
47
  puts auth0.get_users;
37
48
  ```
38
49
 
39
50
 
51
+ ## What is Auth0?
52
+
53
+ Auth0 helps you to:
54
+
55
+ * Add authentication with [multiple authentication sources](https://docs.auth0.com/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others**, or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider**.
56
+ * Add authentication through more traditional **[username/password databases](https://docs.auth0.com/mysql-connection-tutorial)**.
57
+ * Add support for **[linking different user accounts](https://docs.auth0.com/link-accounts)** with the same user.
58
+ * Support for generating signed [Json Web Tokens](https://docs.auth0.com/jwt) to call your APIs and **flow the user identity** securely.
59
+ * Analytics of how, when and where users are logging in.
60
+ * Pull data from other sources and add it to the user profile, through [JavaScript rules](https://docs.auth0.com/rules).
61
+
62
+ ## Create a free Auth0 Account
63
+
64
+ 1. Go to [Auth0](https://auth0.com) and click Sign Up.
65
+ 2. Use Google, GitHub or Microsoft Account to login.
66
+
40
67
  ## Issue Reporting
41
68
 
42
69
  If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.
43
70
 
71
+ ## Author
72
+
73
+ [Auth0](auth0.com)
74
+
44
75
  ## License
45
76
 
46
- MIT 2014 - Auth0 Inc.
77
+ This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
data/Rakefile CHANGED
@@ -1,9 +1,24 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
- require 'rspec/core/rake_task'
4
3
 
5
- desc "Run specs"
6
- RSpec::Core::RakeTask.new
4
+ begin
5
+ require 'rspec/core/rake_task'
7
6
 
8
- desc 'Run specs'
9
- task :default => :spec
7
+ desc "Run Integration Tests"
8
+ RSpec::Core::RakeTask.new(:integration) do |t|
9
+ t.pattern = FileList["spec/integration/**/*#{ENV['PATTERN']}*_spec.rb"]
10
+ end
11
+
12
+
13
+ desc "Run Unit Tests"
14
+ RSpec::Core::RakeTask.new(:spec) do |t|
15
+ t.pattern = FileList["spec/lib/auth0/**/*#{ENV['PATTERN']}*_spec.rb"]
16
+ end
17
+
18
+ desc "Run All Suites"
19
+ RSpec::Core::RakeTask.new(:all)
20
+
21
+ task :default => :spec
22
+ rescue LoadError
23
+ #No RSpec
24
+ end
@@ -20,14 +20,17 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_runtime_dependency 'httparty', '~> 0.13'
22
22
 
23
- s.add_development_dependency 'rake'
24
- s.add_development_dependency 'rspec', '~> 3.1.0', '>= 3.1.0'
25
- s.add_development_dependency 'rack-test'
26
- s.add_development_dependency 'simplecov'
27
- s.add_development_dependency 'webmock'
28
- s.add_development_dependency 'byebug'
29
- s.add_development_dependency 'faker'
30
- s.add_development_dependency 'yard'
31
- s.add_development_dependency 'gem-release'
23
+ s.add_development_dependency 'rake', '~> 10.4'
24
+ s.add_development_dependency 'fuubar', '~> 2.0'
25
+ s.add_development_dependency 'guard-rspec', '~> 4.5'
26
+ s.add_development_dependency 'dotenv-rails', '~> 2.0'
27
+ s.add_development_dependency 'pry', '~> 0.10'
28
+ s.add_development_dependency 'pry-nav', '~> 0.2.4'
29
+ s.add_development_dependency 'rspec', '~> 3.1', '>= 3.1.0'
30
+ s.add_development_dependency 'rack-test', '~> 0.6'
31
+ s.add_development_dependency 'simplecov', '~> 0.9'
32
+ s.add_development_dependency 'faker', '~> 1.4'
33
+ s.add_development_dependency 'yard', '~> 0.8'
34
+ s.add_development_dependency 'gem-release', '~> 0.7'
32
35
  s.license = 'MIT'
33
36
  end
@@ -14,7 +14,7 @@ module Auth0
14
14
  end
15
15
 
16
16
  # {https://auth0.com/docs/auth-api#!#post--delegation}
17
- def delegation(id_token, target, scope = "openid", api_type = "app")
17
+ def delegation(id_token, target, scope = "openid", api_type = "app", extra_parameters = {})
18
18
  request_params = {
19
19
  client_id: @client_id,
20
20
  grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
@@ -22,7 +22,7 @@ module Auth0
22
22
  target: target,
23
23
  api_type: api_type,
24
24
  scope: scope
25
- }
25
+ }.merge(extra_parameters)
26
26
  post("/delegation", request_params)
27
27
  end
28
28
 
@@ -24,7 +24,7 @@ module Auth0
24
24
  # @deprecated use {#patch_client}
25
25
  # {https://auth0.com/docs/api#!#put--api-clients--client-id-}
26
26
  def update_client(name, callbacks="", client_id=@client_id)
27
- warn "This endpoint has been deprecated in favor of PUT."
27
+ warn "This endpoint has been deprecated in favor of PATCH."
28
28
  path = "/api/clients/#{client_id}"
29
29
  request_params = {
30
30
  name: name,
@@ -141,7 +141,7 @@ module Auth0
141
141
 
142
142
  # {https://auth0.com/docs/api#!#delete--api-users--user_id-}
143
143
  def delete_user(user_id)
144
- raise Auth0::UserIdIsBlank, "if you want to remove all users user delete_users method" if user_id.to_s.empty?
144
+ raise Auth0::MissingUserId, "if you want to remove all users user delete_users method" if user_id.to_s.empty?
145
145
  path = "/api/users/#{user_id}"
146
146
  delete(path)
147
147
  end
@@ -26,13 +26,13 @@ module Auth0
26
26
 
27
27
  #https://auth0.com/docs/apiv2#!/clients/delete_clients_by_id
28
28
  def delete_client(client_id)
29
- path = "/api/v2/clients/" + client_id.to_s
29
+ path = "/api/v2/clients/#{client_id}"
30
30
  delete(path)
31
31
  end
32
32
 
33
33
  #https://auth0.com/docs/apiv2#!/clients/patch_clients_by_id
34
34
  def patch_client(client_id, options)
35
- path = "/api/v2/clients/" + client_id.to_s
35
+ path = "/api/v2/clients/#{client_id}"
36
36
  patch(path, options)
37
37
  end
38
38
  end
@@ -44,7 +44,7 @@ module Auth0
44
44
 
45
45
  #https://auth0.com/docs/apiv2#!/users/delete_users_by_id
46
46
  def delete_user(user_id)
47
- raise Auth0::UserIdIsBlank, "if you want to remove all users user delete_users method" if user_id.to_s.empty?
47
+ raise Auth0::MissingUserId, "Must supply a valid user_id" if user_id.nil? or user_id.to_s.empty?
48
48
  path = "/api/v2/users/" + user_id.to_s
49
49
  delete(path)
50
50
  end
@@ -15,8 +15,12 @@ class Auth0::ServerError < Auth0::Exception; end
15
15
  # exception for incorrect request, you've sent wrong params
16
16
  class Auth0::BadRequest < Auth0::Exception; end
17
17
  # exception for unset user_id, this might cause removal of all users, or other unexpected bahaviour
18
- class Auth0::UserIdIsBlank < Auth0::Exception; end
18
+ class Auth0::MissingUserId < Auth0::Exception; end
19
19
  # Api v2 access denied
20
20
  class Auth0::AccessDenied < Auth0::Exception; end
21
21
  # Invalid parameter passed, e.g. empty where ID is required
22
22
  class Auth0::InvalidParameter < Auth0::Exception; end
23
+ # Invalid Auth0 credentials either client_id/secret for API v1 or JWT for API v2/
24
+ class Auth0::InvalidCredentials < Auth0::Exception; end
25
+ # Invalid Auth0 API namespace
26
+ class Auth0::InvalidApiNamespace < Auth0::Exception; end
@@ -9,18 +9,15 @@ module Auth0
9
9
  # To run using api v2, pass api_version: 2 when creating a client
10
10
  def initialize(config)
11
11
  options = Hash[config.map{|(k,v)| [k.to_sym,v]}]
12
- self.class.base_uri "https://#{options[:namespace]}"
12
+ domain = api_domain options
13
+ raise InvalidApiNamespace, "Api namespace must supply an API domain" if domain.nil?
14
+ self.class.base_uri "https://#{domain}"
13
15
  self.class.headers "Content-Type" => 'application/json'
14
16
  self.extend Auth0::Api::AuthenticationEndpoints
15
17
  @client_id = options[:client_id]
16
- if options[:protocols].to_s.include?("v2") or options[:api_version] === 2
17
- self.extend Auth0::Api::V2
18
- @token = (options[:access_token] or options[:token])
19
- else
20
- self.extend Auth0::Api::V1
21
- @client_secret = options[:client_secret]
22
- @token = obtain_access_token
23
- end
18
+ initialize_v2(options) if api_v2?(options)
19
+ initialize_v1(options) if api_v1?(options)
20
+ raise InvalidCredentials, "Must supply a valid API token" if @token.nil?
24
21
  self.class.headers "Authorization" => "Bearer #{@token}"
25
22
  end
26
23
 
@@ -29,6 +26,34 @@ module Auth0
29
26
  klass.send :prepend, Initializer
30
27
  end
31
28
 
29
+ private
30
+
31
+ def api_domain(options)
32
+ options[:domain] || options[:namespace]
33
+ end
34
+
35
+ def initialize_v2(options)
36
+ self.extend Auth0::Api::V2
37
+ @token = options[:access_token] || options[:token]
38
+ end
39
+
40
+ def initialize_v1(options)
41
+ self.extend Auth0::Api::V1
42
+ @client_secret = options[:client_secret]
43
+ raise InvalidCredentials, "Invalid API v1 client_id and client_secret" if @client_id.nil? or @client_secret.nil?
44
+ @token = obtain_access_token
45
+ end
46
+
47
+ def api_v2?(options)
48
+ options[:protocols].to_s.include?("v2") or options[:api_version] === 2
49
+ end
50
+
51
+ def api_v1?(options)
52
+ version = options[:api_version] || 1
53
+ protocol = options[:protocols].to_s
54
+ not protocol.include?("v2") and (protocol.include?("v1") or version === 1)
55
+ end
56
+
32
57
  end
33
58
  end
34
59
  end
@@ -1,4 +1,4 @@
1
1
  module Auth0
2
2
  # current version of gem
3
- VERSION = "3.2.0"
3
+ VERSION = "3.3.0"
4
4
  end
@@ -0,0 +1,13 @@
1
+ require "spec_helper"
2
+ describe Auth0::Api::V1::Clients do
3
+
4
+ let(:client) { Auth0Client.new(v1_creds) }
5
+ let(:global_client) { Auth0Client.new(v1_global_creds) }
6
+
7
+ it { expect(client.clients).to_not be_empty }
8
+
9
+ it { expect {client.create_client("client")}.to raise_error(Auth0::Unauthorized) }
10
+
11
+ it { expect(global_client.create_client("client")).to_not be_nil }
12
+
13
+ end
@@ -0,0 +1,60 @@
1
+ require "spec_helper"
2
+ describe Auth0::Api::V1::Users do
3
+
4
+ let(:client) { Auth0Client.new(v1_creds) }
5
+ let(:username) { Faker::Internet.user_name }
6
+ let(:email) { Faker::Internet.safe_email }
7
+ let(:password) { Faker::Internet.password }
8
+ let(:connection) { "Username-Password-Authentication" }
9
+ let!(:user) { client.create_user(email, password, connection, {
10
+ "username" => username,
11
+ "email_verified" => false,
12
+ })}
13
+
14
+ describe '.users' do
15
+
16
+ let(:users) { client.users() }
17
+
18
+ it { expect(users.size).to be > 0 }
19
+ it { expect(users.find {|user| user["email"] == email}).to_not be_nil }
20
+
21
+ context "#filters" do
22
+ it { expect(client.users("email: #{email}").size).to be 1 }
23
+ end
24
+
25
+ end
26
+
27
+ describe '.user' do
28
+
29
+ let(:subject) { client.user(user["user_id"]) }
30
+
31
+ it { should include("email" => email, "username" => username) }
32
+
33
+ end
34
+
35
+ describe '.create_user' do
36
+
37
+ let(:subject) { user }
38
+
39
+ it { should include("user_id", "identities") }
40
+ it { should include(
41
+ "username" => username,
42
+ "email" => email,
43
+ "email_verified" => false,
44
+ )}
45
+
46
+ end
47
+
48
+ describe '.delete_user' do
49
+
50
+ it { expect { client.delete_user user["user_id"] }.to_not raise_error }
51
+
52
+ it { expect { client.delete_user "" }.to raise_error(Auth0::MissingUserId) }
53
+
54
+ end
55
+
56
+ describe '.patch_user_metadata' do
57
+ it { expect(client.patch_user_metadata(user["user_id"], {"custom_field" => "custom_value"})).to eq "OK" }
58
+ end
59
+
60
+ end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+ describe Auth0::Api::V2::Clients do
3
+
4
+ let(:client) { Auth0Client.new(v2_creds) }
5
+ let(:existing_client) { client.create_client("existing") }
6
+
7
+ it { expect(client.clients).to_not be_empty }
8
+
9
+ it { expect(client.create_client("ClientV2", {custom_login_page_off: true})).to include("name" => "ClientV2", "custom_login_page_off" => true) }
10
+
11
+ it { expect(client.patch_client(existing_client["client_id"], {custom_login_page_off: true, sso: true})).to include("custom_login_page_off" => true, "sso" => true) }
12
+
13
+ it { expect { client.delete_client(existing_client["client_id"]) }.to_not raise_error }
14
+
15
+ it { expect(client.client(existing_client["client_id"])).to include("client_id" => existing_client["client_id"]) }
16
+
17
+ end
@@ -0,0 +1,71 @@
1
+ require "spec_helper"
2
+ describe Auth0::Api::V2::Users do
3
+
4
+ let(:client) { Auth0Client.new(v2_creds) }
5
+ let(:username) { Faker::Internet.user_name }
6
+ let(:email) { Faker::Internet.safe_email }
7
+ let(:password) { Faker::Internet.password }
8
+ let(:connection) { "Username-Password-Authentication" }
9
+ let!(:user) { client.create_user(username, {
10
+ "username" => username,
11
+ "email" => email,
12
+ "password" => password,
13
+ "email_verified" => false,
14
+ "connection" => connection,
15
+ "app_metadata" => {}
16
+ })}
17
+
18
+ describe '.users' do
19
+
20
+ let(:users) { client.users() }
21
+
22
+ it { expect(users.size).to be > 0 }
23
+ it { expect(users.find {|user| user["email"] == email}).to_not be_nil }
24
+
25
+ context "#filters" do
26
+ it { expect(client.users(per_page: 1).size).to be 1 }
27
+ it { expect(client.users(per_page: 1, fields: [:picture, :email, :user_id].join(',')).first).to include("email", "user_id", "picture") }
28
+ it { expect(client.users(per_page: 1, fields: [:picture, :email, :user_id].join(','), exclude_fields: true).first).to_not include("email", "user_id", "picture") }
29
+ end
30
+
31
+ end
32
+
33
+ describe '.user' do
34
+
35
+ let(:subject) { client.user(user["user_id"]) }
36
+
37
+ it { should include("email" => email, "name" => username) }
38
+
39
+ context "#filters" do
40
+ it { expect(client.user(user["user_id"], fields: [:picture, :email, :user_id].join(','))).to include("email", "user_id", "picture") }
41
+ it { expect(client.user(user["user_id"], fields: [:picture, :email, :user_id].join(','), exclude_fields: true)).to_not include("email", "user_id", "picture") }
42
+ end
43
+
44
+ end
45
+
46
+ describe '.create_user' do
47
+
48
+ let(:subject) { user }
49
+
50
+ it { should include("user_id", "identities") }
51
+ it { should include(
52
+ "username" => username,
53
+ "email" => email,
54
+ "email_verified" => false,
55
+ )}
56
+
57
+ end
58
+
59
+ describe '.delete_user' do
60
+
61
+ it { expect { client.delete_user user["user_id"] }.to_not raise_error }
62
+
63
+ it { expect { client.delete_user "" }.to raise_error(Auth0::MissingUserId) }
64
+
65
+ end
66
+
67
+ describe '.patch_user' do
68
+ it { expect(client.patch_user(user["user_id"], {"email_verified" => true})).to include("email_verified" => true) }
69
+ end
70
+
71
+ end
@@ -0,0 +1,45 @@
1
+ require "spec_helper"
2
+ describe Auth0::Client do
3
+
4
+ shared_examples "invalid credentials" do |credentials, error|
5
+ it "raise an error with credentials #{credentials}" do
6
+ if error.nil?
7
+ expect { Auth0Client.new(credentials) }.to raise_error
8
+ else
9
+ expect { Auth0Client.new(credentials) }.to raise_error(error)
10
+ end
11
+ end
12
+ end
13
+
14
+ it_should_behave_like "invalid credentials", {namespace: "samples.auth0.com"}, Auth0::InvalidCredentials
15
+ it_should_behave_like "invalid credentials", {namespace: "samples.auth0.com", client_id: "client_id"}, Auth0::InvalidCredentials
16
+ it_should_behave_like "invalid credentials", {namespace: "samples.auth0.com", client_secret: "secret"}, Auth0::InvalidCredentials
17
+ it_should_behave_like "invalid credentials", {namespace: "samples.auth0.com", api_version: 2}, Auth0::InvalidCredentials
18
+ it_should_behave_like "invalid credentials", {}
19
+ it_should_behave_like "invalid credentials", {api_version: 2}
20
+ it_should_behave_like "invalid credentials", {api_version: 1}
21
+ it_should_behave_like "invalid credentials", {client_id: "client_id", client_secret: "secret"}, Auth0::InvalidApiNamespace
22
+ it_should_behave_like "invalid credentials", {api_version: 2, token: "token"}, Auth0::InvalidApiNamespace
23
+
24
+ let(:valid_v1_credentials) { {client_id: ENV["CLIENT_ID"], client_secret: ENV["CLIENT_SECRET"], domain: ENV["DOMAIN"]} }
25
+ let(:token) { ENV["MASTER_JWT"] }
26
+ let(:v2_credentials) { {domain: ENV["DOMAIN"], api_version: 2} }
27
+
28
+ shared_examples "valid credentials" do
29
+ it { expect { Auth0Client.new(credentials) }.to_not raise_error }
30
+ end
31
+
32
+ it_should_behave_like "valid credentials" do
33
+ let(:credentials) { valid_v1_credentials }
34
+ end
35
+ it_should_behave_like "valid credentials" do
36
+ let(:credentials) { valid_v1_credentials.merge({api_version: 1}) }
37
+ end
38
+ it_should_behave_like "valid credentials" do
39
+ let(:credentials) { v2_credentials.merge({token: token})}
40
+ end
41
+ it_should_behave_like "valid credentials" do
42
+ let(:credentials) { v2_credentials.merge({access_token: ENV["MASTER_JWT"]}) }
43
+ end
44
+
45
+ end
@@ -28,6 +28,12 @@ describe Auth0::Api::AuthenticationEndpoints do
28
28
  api_type: "salesforce_api"})
29
29
  @instance.delegation("", "", "", "salesforce_api")
30
30
  end
31
+ it "allows to pass extra parameters" do
32
+ expect(@instance).to receive(:post).with("/delegation",{:client_id=>nil, :grant_type=>"urn:ietf:params:oauth:grant-type:jwt-bearer",
33
+ :id_token=>"", :target=>"", :scope=>"", :api_type => "",
34
+ :community_name => 'test-community', community_url: 'test-url'})
35
+ @instance.delegation("", "", "", "", community_name: 'test-community', community_url: 'test-url')
36
+ end
31
37
  end
32
38
 
33
39
  context ".impersonate" do
@@ -44,7 +44,7 @@ describe Auth0::Api::V1::Clients do
44
44
  end
45
45
 
46
46
  it "is expected to make warn on deprecated endpoint" do
47
- expect(@instance).to receive(:warn).with("This endpoint has been deprecated in favor of PUT.")
47
+ expect(@instance).to receive(:warn).with("This endpoint has been deprecated in favor of PATCH.")
48
48
  @instance.update_client("test")
49
49
  end
50
50
  end
@@ -195,7 +195,7 @@ describe Auth0::Api::V1::Users do
195
195
 
196
196
  it "is expected not to call delete to /api/users if user_id is blank" do
197
197
  expect(@instance).not_to receive(:delete)
198
- expect{@instance.delete_user("")}.to raise_exception(Auth0::UserIdIsBlank)
198
+ expect{@instance.delete_user("")}.to raise_exception(Auth0::MissingUserId)
199
199
  end
200
200
  end
201
201
 
@@ -49,7 +49,7 @@ describe Auth0::Api::V2::Users do
49
49
 
50
50
  it "is expected not to call delete to /api/v2/users if user_id is blank" do
51
51
  expect(@instance).not_to receive(:delete)
52
- expect{@instance.delete_user("")}.to raise_exception(Auth0::UserIdIsBlank)
52
+ expect{@instance.delete_user("")}.to raise_exception(Auth0::MissingUserId)
53
53
  end
54
54
  end
55
55
 
@@ -1,47 +1,115 @@
1
1
  require "spec_helper"
2
+
2
3
  describe Auth0::Client do
3
- context "V1 modules to be included" do
4
- let(:subject){Auth0::Client.new({})}
4
+
5
+ shared_examples_for "v1 API client" do
6
+ it { should be_a Auth0::Api::V1 }
7
+ it { should be_a Auth0::Api::V1::Users }
8
+ it { should be_a Auth0::Api::V1::Connections }
9
+ it { should be_a Auth0::Api::V1::Clients }
10
+ it { should be_a Auth0::Api::V1::Rules }
11
+ it { should be_a Auth0::Api::V1::Logs }
12
+ it { should_not be_a Auth0::Api::V2 }
13
+ it { should_not be_a Auth0::Api::V2::Clients }
14
+ it { should_not be_a Auth0::Api::V2::Users }
15
+ it { should_not be_a Auth0::Api::V2::Jobs }
16
+ it { should_not be_a Auth0::Api::V2::Stats }
17
+ it { should_not be_a Auth0::Api::V2::Blacklists }
18
+ end
19
+
20
+ shared_examples_for "v2 API client" do
21
+ it { should be_a Auth0::Api::V2 }
22
+ it { should be_a Auth0::Api::V2::Clients }
23
+ it { should be_a Auth0::Api::V2::Users }
24
+ it { should be_a Auth0::Api::V2::Stats }
25
+ it { should be_a Auth0::Api::V2::Jobs }
26
+ it { should be_a Auth0::Api::V2::Blacklists }
27
+ it { should_not be_a Auth0::Api::V1 }
28
+ it { should_not be_a Auth0::Api::V1::Users }
29
+ it { should_not be_a Auth0::Api::V1::Connections }
30
+ it { should_not be_a Auth0::Api::V1::Clients }
31
+ it { should_not be_a Auth0::Api::V1::Rules }
32
+ it { should_not be_a Auth0::Api::V1::Logs }
33
+ end
34
+
35
+ shared_examples_for "authentication API client" do
36
+ it { should be_a Auth0::Api::AuthenticationEndpoints }
37
+ end
38
+
39
+ let(:domain) { "samples.auth0.com" }
40
+ let(:client_id) { "client_id" }
41
+ let(:client_secret) { "client_secret" }
42
+ let(:jwt) { "Header.Payload.Signature" }
43
+ let(:access_token) { "token" }
44
+
45
+ describe "V1 client" do
46
+
5
47
  before :each do
6
- allow_any_instance_of(Auth0::Api::AuthenticationEndpoints).to receive(:obtain_access_token)
7
- end
8
- it {expect(subject).to be_a HTTParty}
9
- it {expect(subject).to be_a Auth0::Mixins}
10
- it {expect(subject).to be_a Auth0::Mixins::Initializer}
11
- it {expect(subject).to be_a Auth0::Api::V1}
12
- it {expect(subject).to be_a Auth0::Api::V1::Users}
13
- it {expect(subject).to be_a Auth0::Api::V1::Connections}
14
- it {expect(subject).to be_a Auth0::Api::V1::Clients}
15
- it {expect(subject).to be_a Auth0::Api::V1::Rules}
16
- it {expect(subject).to be_a Auth0::Api::V1::Logs}
17
- it {expect(subject).to be_a Auth0::Api::AuthenticationEndpoints}
18
- it {expect(subject).not_to be_a Auth0::Api::V2}
19
- it {expect(subject).not_to be_a Auth0::Api::V2::Clients}
20
- it {expect(subject).not_to be_a Auth0::Api::V2::Users}
21
- it {expect(subject).not_to be_a Auth0::Api::V2::Jobs}
22
- it {expect(subject).not_to be_a Auth0::Api::V2::Stats}
23
- it {expect(subject).not_to be_a Auth0::Api::V2::Blacklists}
48
+ allow_any_instance_of(Auth0::Api::AuthenticationEndpoints).to receive(:obtain_access_token).and_return "token"
49
+ end
50
+
51
+ context "with namespace" do
52
+
53
+ let(:subject) { Auth0::Client.new(client_id: "client_id", client_secret: "client_secret", namespace: "samples.auth0.com") }
54
+
55
+ it_should_behave_like "v1 API client"
56
+ it_should_behave_like "authentication API client"
57
+
58
+ end
59
+
60
+ context "with domain" do
61
+
62
+ let(:subject) { Auth0::Client.new(client_id: "client_id", client_secret: "client_secret", domain: "samples.auth0.com") }
63
+
64
+ it_should_behave_like "v1 API client"
65
+ it_should_behave_like "authentication API client"
66
+
67
+ end
68
+
69
+ context "with version" do
70
+
71
+ let(:subject) { Auth0::Client.new(client_id: "client_id", client_secret: "client_secret", domain: "samples.auth0.com", api_version: 1) }
72
+
73
+ it_should_behave_like "v1 API client"
74
+ it_should_behave_like "authentication API client"
75
+
76
+ end
77
+
24
78
  end
25
- context "V2 modules to be included" do
26
- let(:subject){Auth0::Client.new({protocols: "v2"})}
79
+
80
+ describe "V2 client" do
81
+
27
82
  before :each do
28
83
  expect_any_instance_of(Auth0::Api::AuthenticationEndpoints).not_to receive(:obtain_access_token)
29
84
  end
30
- it {expect(subject).to be_a HTTParty}
31
- it {expect(subject).to be_a Auth0::Mixins}
32
- it {expect(subject).to be_a Auth0::Mixins::Initializer}
33
- it {expect(subject).to be_a Auth0::Api::V2}
34
- it {expect(subject).to be_a Auth0::Api::V2::Clients}
35
- it {expect(subject).to be_a Auth0::Api::V2::Users}
36
- it {expect(subject).to be_a Auth0::Api::V2::Stats}
37
- it {expect(subject).to be_a Auth0::Api::V2::Jobs}
38
- it {expect(subject).to be_a Auth0::Api::V2::Blacklists}
39
- it {expect(subject).not_to be_a Auth0::Api::V1}
40
- it {expect(subject).not_to be_a Auth0::Api::V1::Users}
41
- it {expect(subject).not_to be_a Auth0::Api::V1::Connections}
42
- it {expect(subject).not_to be_a Auth0::Api::V1::Clients}
43
- it {expect(subject).not_to be_a Auth0::Api::V1::Rules}
44
- it {expect(subject).not_to be_a Auth0::Api::V1::Logs}
45
- it {expect(subject).to be_a Auth0::Api::AuthenticationEndpoints}
85
+
86
+ context "with namespace" do
87
+
88
+ let(:subject) { Auth0::Client.new(protocols: "v2", access_token: "access_token", namespace: "samples.auth0.com") }
89
+
90
+ it_should_behave_like "v2 API client"
91
+ it_should_behave_like "authentication API client"
92
+
93
+ end
94
+
95
+ context "with domain" do
96
+
97
+ let(:subject) { Auth0::Client.new(protocols: "v2", access_token: "access_token", domain: "samples.auth0.com") }
98
+
99
+ it_should_behave_like "v2 API client"
100
+ it_should_behave_like "authentication API client"
101
+
102
+ end
103
+
104
+ context "with version" do
105
+
106
+ let(:subject) { Auth0::Client.new(api_version: 2, access_token: "access_token", domain: "samples.auth0.com") }
107
+
108
+ it_should_behave_like "v2 API client"
109
+ it_should_behave_like "authentication API client"
110
+
111
+ end
112
+
46
113
  end
114
+
47
115
  end
@@ -1,4 +1,5 @@
1
1
  require "spec_helper"
2
+
2
3
  class MockClass
3
4
  attr_reader :token
4
5
  include Auth0::Mixins::Initializer
@@ -6,7 +7,7 @@ class MockClass
6
7
  end
7
8
 
8
9
  describe Auth0::Mixins::Initializer do
9
- let(:params) { { } }
10
+ let(:params) { { namespace: 'samples.auth0.com' } }
10
11
  let(:instance) { DummyClassForProxy.include(described_class).new(params) }
11
12
  context 'api v2' do
12
13
  before do
@@ -1,18 +1,2 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
3
- require 'simplecov'
4
- SimpleCov.start do
5
- add_filter "/spec/"
6
- end
7
- require 'rspec'
8
- require 'rack/test'
9
- require 'webmock/rspec'
10
- require 'byebug'
11
- require 'auth0'
12
- Dir[("./lib/**/*.rb")].each { |f| require f }
13
- Dir[("./spec/support/**/*.rb")].each { |f| require f }
14
- RSpec.configure do |config|
15
- config.include WebMock::API
16
- config.include Rack::Test::Methods
17
- # config.fail_fast = true
18
- end
1
+ mode = ENV["MODE"] || "unit"
2
+ require_relative "spec_helper_#{mode}"
@@ -0,0 +1,33 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+
4
+ require 'coveralls'
5
+ Coveralls.wear!
6
+
7
+ require 'simplecov'
8
+ SimpleCov.start do
9
+ add_filter "/spec/"
10
+ add_filter "/spec/integration"
11
+ end
12
+
13
+ require 'rspec'
14
+ require 'rack/test'
15
+ require 'faker'
16
+ require 'auth0'
17
+ require 'pry'
18
+
19
+ Dir[("./lib/**/*.rb")].each { |f| require f }
20
+ Dir[("./spec/support/**/*.rb")].each { |f| require f }
21
+
22
+ RSpec.configure do |config|
23
+ config.include Rack::Test::Methods
24
+ config.include Credentials
25
+ config.after(:suite) do
26
+ v2_client = Auth0Client.new({token: ENV["MASTER_JWT"], api_version: 2, domain: ENV["DOMAIN"]})
27
+ v2_client
28
+ .clients
29
+ .select { |client| client["name"] != "DefaultApp" and not client["global"] }
30
+ .each { |client| v2_client.delete_client(client["client_id"]) }
31
+ v2_client.delete_users
32
+ end
33
+ end
@@ -0,0 +1,12 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'rspec'
4
+ require 'rack/test'
5
+ require 'faker'
6
+ require 'auth0'
7
+ Dir[("./lib/**/*.rb")].each { |f| require f }
8
+ Dir[("./spec/support/**/*.rb")].each { |f| require f }
9
+ RSpec.configure do |config|
10
+ config.include Rack::Test::Methods
11
+ config.fail_fast = true
12
+ end
@@ -0,0 +1,13 @@
1
+ module Credentials
2
+ def v1_creds
3
+ {client_id: ENV["CLIENT_ID"], client_secret: ENV["CLIENT_SECRET"], domain: ENV["DOMAIN"]}
4
+ end
5
+
6
+ def v1_global_creds
7
+ {client_id: ENV["GLOBAL_CLIENT_ID"], client_secret: ENV["GLOBAL_CLIENT_SECRET"], domain: ENV["DOMAIN"]}
8
+ end
9
+
10
+ def v2_creds
11
+ {token: ENV["MASTER_JWT"], api_version: 2, domain: ENV["DOMAIN"]}
12
+ end
13
+ 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.2.0
4
+ version: 3.3.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-04-14 00:00:00.000000000 Z
14
+ date: 2015-04-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httparty
@@ -31,134 +31,176 @@ dependencies:
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ">="
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: '0'
36
+ version: '10.4'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ">="
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: '10.4'
44
44
  - !ruby/object:Gem::Dependency
45
- name: rspec
45
+ name: fuubar
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 3.1.0
51
- - - ">="
50
+ version: '2.0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
52
56
  - !ruby/object:Gem::Version
53
- version: 3.1.0
57
+ version: '2.0'
58
+ - !ruby/object:Gem::Dependency
59
+ name: guard-rspec
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: '4.5'
54
65
  type: :development
55
66
  prerelease: false
56
67
  version_requirements: !ruby/object:Gem::Requirement
57
68
  requirements:
58
69
  - - "~>"
59
70
  - !ruby/object:Gem::Version
60
- version: 3.1.0
61
- - - ">="
71
+ version: '4.5'
72
+ - !ruby/object:Gem::Dependency
73
+ name: dotenv-rails
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - "~>"
62
77
  - !ruby/object:Gem::Version
63
- version: 3.1.0
78
+ version: '2.0'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '2.0'
64
86
  - !ruby/object:Gem::Dependency
65
- name: rack-test
87
+ name: pry
66
88
  requirement: !ruby/object:Gem::Requirement
67
89
  requirements:
68
- - - ">="
90
+ - - "~>"
69
91
  - !ruby/object:Gem::Version
70
- version: '0'
92
+ version: '0.10'
71
93
  type: :development
72
94
  prerelease: false
73
95
  version_requirements: !ruby/object:Gem::Requirement
74
96
  requirements:
75
- - - ">="
97
+ - - "~>"
76
98
  - !ruby/object:Gem::Version
77
- version: '0'
99
+ version: '0.10'
78
100
  - !ruby/object:Gem::Dependency
79
- name: simplecov
101
+ name: pry-nav
80
102
  requirement: !ruby/object:Gem::Requirement
81
103
  requirements:
82
- - - ">="
104
+ - - "~>"
83
105
  - !ruby/object:Gem::Version
84
- version: '0'
106
+ version: 0.2.4
85
107
  type: :development
86
108
  prerelease: false
87
109
  version_requirements: !ruby/object:Gem::Requirement
88
110
  requirements:
89
- - - ">="
111
+ - - "~>"
90
112
  - !ruby/object:Gem::Version
91
- version: '0'
113
+ version: 0.2.4
92
114
  - !ruby/object:Gem::Dependency
93
- name: webmock
115
+ name: rspec
94
116
  requirement: !ruby/object:Gem::Requirement
95
117
  requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '3.1'
96
121
  - - ">="
97
122
  - !ruby/object:Gem::Version
98
- version: '0'
123
+ version: 3.1.0
99
124
  type: :development
100
125
  prerelease: false
101
126
  version_requirements: !ruby/object:Gem::Requirement
102
127
  requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '3.1'
103
131
  - - ">="
104
132
  - !ruby/object:Gem::Version
105
- version: '0'
133
+ version: 3.1.0
106
134
  - !ruby/object:Gem::Dependency
107
- name: byebug
135
+ name: rack-test
108
136
  requirement: !ruby/object:Gem::Requirement
109
137
  requirements:
110
- - - ">="
138
+ - - "~>"
111
139
  - !ruby/object:Gem::Version
112
- version: '0'
140
+ version: '0.6'
113
141
  type: :development
114
142
  prerelease: false
115
143
  version_requirements: !ruby/object:Gem::Requirement
116
144
  requirements:
117
- - - ">="
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '0.6'
148
+ - !ruby/object:Gem::Dependency
149
+ name: simplecov
150
+ requirement: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '0.9'
155
+ type: :development
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
118
160
  - !ruby/object:Gem::Version
119
- version: '0'
161
+ version: '0.9'
120
162
  - !ruby/object:Gem::Dependency
121
163
  name: faker
122
164
  requirement: !ruby/object:Gem::Requirement
123
165
  requirements:
124
- - - ">="
166
+ - - "~>"
125
167
  - !ruby/object:Gem::Version
126
- version: '0'
168
+ version: '1.4'
127
169
  type: :development
128
170
  prerelease: false
129
171
  version_requirements: !ruby/object:Gem::Requirement
130
172
  requirements:
131
- - - ">="
173
+ - - "~>"
132
174
  - !ruby/object:Gem::Version
133
- version: '0'
175
+ version: '1.4'
134
176
  - !ruby/object:Gem::Dependency
135
177
  name: yard
136
178
  requirement: !ruby/object:Gem::Requirement
137
179
  requirements:
138
- - - ">="
180
+ - - "~>"
139
181
  - !ruby/object:Gem::Version
140
- version: '0'
182
+ version: '0.8'
141
183
  type: :development
142
184
  prerelease: false
143
185
  version_requirements: !ruby/object:Gem::Requirement
144
186
  requirements:
145
- - - ">="
187
+ - - "~>"
146
188
  - !ruby/object:Gem::Version
147
- version: '0'
189
+ version: '0.8'
148
190
  - !ruby/object:Gem::Dependency
149
191
  name: gem-release
150
192
  requirement: !ruby/object:Gem::Requirement
151
193
  requirements:
152
- - - ">="
194
+ - - "~>"
153
195
  - !ruby/object:Gem::Version
154
- version: '0'
196
+ version: '0.7'
155
197
  type: :development
156
198
  prerelease: false
157
199
  version_requirements: !ruby/object:Gem::Requirement
158
200
  requirements:
159
- - - ">="
201
+ - - "~>"
160
202
  - !ruby/object:Gem::Version
161
- version: '0'
203
+ version: '0.7'
162
204
  description: Ruby client library for the Auth0 API.
163
205
  email:
164
206
  - support@auth0.com
@@ -167,10 +209,12 @@ extensions: []
167
209
  extra_rdoc_files: []
168
210
  files:
169
211
  - ".bundle/config"
212
+ - ".gemrelease"
170
213
  - ".gitignore"
171
214
  - ".rspec"
172
215
  - ".travis.yml"
173
216
  - Gemfile
217
+ - Guardfile
174
218
  - LICENSE
175
219
  - README.md
176
220
  - Rakefile
@@ -196,6 +240,11 @@ files:
196
240
  - lib/auth0/mixins/initializer.rb
197
241
  - lib/auth0/version.rb
198
242
  - lib/auth0_client.rb
243
+ - spec/integration/lib/auth0/api/v1/api_clients_spec.rb
244
+ - spec/integration/lib/auth0/api/v1/api_users_spec.rb
245
+ - spec/integration/lib/auth0/api/v2/api_clients_spec.rb
246
+ - spec/integration/lib/auth0/api/v2/api_users_spec.rb
247
+ - spec/integration/lib/auth0/auth0_client_spec.rb
199
248
  - spec/lib/auth0/api/authentication_endpoints_spec.rb
200
249
  - spec/lib/auth0/api/v1/clients_spec.rb
201
250
  - spec/lib/auth0/api/v1/connections_spec.rb
@@ -210,8 +259,10 @@ files:
210
259
  - spec/lib/auth0/client_spec.rb
211
260
  - spec/lib/auth0/mixins/httparty_proxy_spec.rb
212
261
  - spec/lib/auth0/mixins/initializer_spec.rb
213
- - spec/lib/auth0_client_spec.rb
214
262
  - spec/spec_helper.rb
263
+ - spec/spec_helper_full.rb
264
+ - spec/spec_helper_unit.rb
265
+ - spec/support/credentials.rb
215
266
  - spec/support/dummy_class.rb
216
267
  - spec/support/dummy_class_for_proxy.rb
217
268
  - spec/support/stub_response.rb
@@ -240,6 +291,11 @@ signing_key:
240
291
  specification_version: 4
241
292
  summary: Auth0 API Client
242
293
  test_files:
294
+ - spec/integration/lib/auth0/api/v1/api_clients_spec.rb
295
+ - spec/integration/lib/auth0/api/v1/api_users_spec.rb
296
+ - spec/integration/lib/auth0/api/v2/api_clients_spec.rb
297
+ - spec/integration/lib/auth0/api/v2/api_users_spec.rb
298
+ - spec/integration/lib/auth0/auth0_client_spec.rb
243
299
  - spec/lib/auth0/api/authentication_endpoints_spec.rb
244
300
  - spec/lib/auth0/api/v1/clients_spec.rb
245
301
  - spec/lib/auth0/api/v1/connections_spec.rb
@@ -254,8 +310,10 @@ test_files:
254
310
  - spec/lib/auth0/client_spec.rb
255
311
  - spec/lib/auth0/mixins/httparty_proxy_spec.rb
256
312
  - spec/lib/auth0/mixins/initializer_spec.rb
257
- - spec/lib/auth0_client_spec.rb
258
313
  - spec/spec_helper.rb
314
+ - spec/spec_helper_full.rb
315
+ - spec/spec_helper_unit.rb
316
+ - spec/support/credentials.rb
259
317
  - spec/support/dummy_class.rb
260
318
  - spec/support/dummy_class_for_proxy.rb
261
319
  - spec/support/stub_response.rb
@@ -1,8 +0,0 @@
1
- require "spec_helper"
2
- describe Auth0Client do
3
- let(:subject){Auth0Client.new({})}
4
- before :each do
5
- allow_any_instance_of(Auth0::Api::AuthenticationEndpoints).to receive(:obtain_access_token)
6
- end
7
- it {expect(subject).to be_a Auth0::Client}
8
- end