Skip to content
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

Migration to LinkedIn versioned API #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
19 changes: 19 additions & 0 deletions .github/config/rubocop_linter_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
check_name: 'RuboCop'

# Instead of installing gems from rubygems, we can run `bundle install` on your project,
# you would need to do this if you are using something like 'rubocop-github' or if you don't
# want to list out dependencies with the `versions` key.
# Valid options: true || false
# Default: false
bundle: true

gemfile: .overcommit_gems.rb

# The scope of code that Rubocop should lint. Use this if you only want to lint changed files. If this is not set
# or not equal to 'modified', Rubocop is run against the entire codebase. Note that this will not work on the main branch.
# Valid options: 'modified'
# Default: nil
check_scope: 'modified'

rubocop_force_exclusion: true
base_branch: 'origin/main'
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build
on:
push:
branches:
- main

jobs:
test:
uses: ./.github/workflows/test.yml
17 changes: 17 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Linters

on:
push:
branches-ignore:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Rubocop Linter
uses: g2crowd/rubocop-linter-action@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_call:
inputs:
runs-on:
required: false
type: string
default: "ubuntu-22.04"
jobs:
test:
name: Run Specs
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Specs
run: bundle exec rspec spec --require fivemat --format Fivemat
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ test/tmp
test/version_tmp
tmp
.ruby-gemset
.ruby-version
.ruby-version

.idea
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions lib/omniauth/strategies/linkedin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def callback_url

def access_token
::OAuth2::AccessToken.new(client, oauth2_access_token.token, {
:mode => :query,
:param_name => 'oauth2_access_token',
:expires_in => oauth2_access_token.expires_in,
:expires_at => oauth2_access_token.expires_at
mode: :query,
param_name: 'oauth2_access_token',
expires_in: oauth2_access_token.expires_in,
expires_at: oauth2_access_token.expires_at
})
end

Expand Down
4 changes: 2 additions & 2 deletions omniauth-linkedin-oauth2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'omniauth', '~> 1.0'
gem.add_runtime_dependency 'omniauth-oauth2'

gem.add_development_dependency 'bundler', '~> 1.3'
gem.add_development_dependency 'bundler'
gem.add_development_dependency 'rake'

gem.add_development_dependency 'rspec', '~> 2.14.1'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'simplecov'
end
5 changes: 2 additions & 3 deletions spec/omniauth/strategies/linkedin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@
end

context 'api_version is v2' do
before :each do
subject.stub(:options => double('options', :api_version => 'v2').as_null_object)
end

subject { OmniAuth::Strategies::LinkedIn.new(nil, options: { :api_version => 'v2' }) }

context 'and therefore has all the necessary fields' do
it { expect(subject.info).to have_key :name }
Expand Down