Skip to content

Bump faraday, and fix deprecation warning #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task :default => [:test]

desc 'Run tests'
Rake::TestTask.new(:test) do |t|
t.ruby_opts = ["-rubygems"] if defined? Gem
t.ruby_opts = ["-r rubygems"] if defined? Gem
t.libs << "lib" << "test"
t.pattern = 'test/**/*_test.rb'
t.verbose = true
Expand Down
22 changes: 10 additions & 12 deletions lib/podio/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,16 @@ def authenticate_with_sso(attributes)
end

# Sign in with SAML SSO
if show_feature?(:sso_saml)
def authenticate_with_saml(attributes)
response = @oauth_connection.post do |req|
req.url '/oauth/token', :grant_type => 'saml', :client_id => SETTINGS.podio_api.default_client.api_key, :client_secret => SETTINGS.podio_api.default_client.api_secret
req.body = attributes
end
@oauth_token = OAuthToken.new(response.body)
configure_oauth
@oauth_token
def authenticate_with_saml(attributes)
response = @oauth_connection.post do |req|
req.url '/oauth/token', :grant_type => 'saml', :client_id => SETTINGS.podio_api.default_client.api_key, :client_secret => SETTINGS.podio_api.default_client.api_secret
req.body = attributes
end
@oauth_token = OAuthToken.new(response.body)
configure_oauth
@oauth_token
end

# Sign in with an OpenID, only available for Podio
def authenticate_with_openid(identifier, type)
response = @trusted_connection.post do |req|
Expand Down Expand Up @@ -201,11 +199,11 @@ def configure_connection
builder.use Middleware::OAuth2, :podio_client => self
builder.use Middleware::Logger, :podio_client => self

builder.adapter(*default_adapter)

# first response middleware defined get's executed last
builder.use Middleware::ErrorResponse
builder.use Middleware::JsonResponse

builder.adapter(*default_adapter)
end
end

Expand Down
4 changes: 1 addition & 3 deletions podio.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ['lib']

s.has_rdoc = false

s.add_dependency('faraday', ['>= 0.8.0', '< 0.10.0'])
s.add_dependency('faraday', ['>= 0.8.0', '< 0.16.0'])
s.add_dependency('multi_json')

if RUBY_VERSION < '1.9.3'
Expand Down