Skip to content

Commit

Permalink
Bump minimal ruby version to 2.7 and run tests in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeigarts committed Sep 27, 2023
1 parent d55a0b0 commit 0295549
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Ruby

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2']

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rspec
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Omniauth strategy for using Citadele as an authentication service provider.

[![Build Status](https://travis-ci.org/mitigate-dev/omniauth-citadele.svg?branch=master)](https://travis-ci.org/mitigate-dev/omniauth-citadele)

Supported Ruby versions: 2.3+
Supported Ruby versions: 2.7+

## Related projects

Expand Down
5 changes: 3 additions & 2 deletions omniauth-citadele.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.3.0'
spec.required_ruby_version = '>= 2.7'

spec.add_runtime_dependency 'omniauth', '~> 2.1'
spec.add_runtime_dependency 'i18n'

spec.add_development_dependency 'rack', '~> 2.0'
spec.add_development_dependency 'rack'
spec.add_development_dependency 'rack-test'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rack-session'

spec.add_dependency 'xmldsig'
spec.add_dependency 'nokogiri'
Expand Down
11 changes: 6 additions & 5 deletions spec/omniauth/strategies/citadele_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
require 'spec_helper'
require 'rack-protection'
require 'rack/session'

describe OmniAuth::Strategies::Citadele do
PRIVATE_KEY = File.read(File.join(RSpec.configuration.cert_folder, 'request.key'))
PRIVATE_CRT = File.read(File.join(RSpec.configuration.cert_folder, 'request.crt'))
PUBLIC_CRT = File.read(File.join(RSpec.configuration.cert_folder, 'response.crt'))

let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie, {secret: 'abc123'}
b.use Rack::Session::Cookie, {secret: '5242e6bd9daf0e9645c2d4e22b11ba8cee0bed44439906d5f1bd5dad409d8637'}
b.use(OmniAuth::Strategies::Citadele, PRIVATE_KEY, PRIVATE_CRT, PUBLIC_CRT, 'MY_FROM')
b.run lambda{|env| [404, {}, ['Not Found']]}
end.to_app }
Expand Down Expand Up @@ -87,7 +88,7 @@

context 'with custom options' do
let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie, {secret: 'abc123'}
b.use Rack::Session::Cookie, {secret: '5242e6bd9daf0e9645c2d4e22b11ba8cee0bed44439906d5f1bd5dad409d8637'}
b.use(OmniAuth::Strategies::Citadele, PRIVATE_KEY, PRIVATE_CRT, PUBLIC_CRT, 'MY_FROM',
site: 'https://test.lv/banklink')
b.run lambda{|env| [404, {}, ['Not Found']]}
Expand All @@ -101,7 +102,7 @@

context 'with non-existant private key file' do
let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie, {secret: 'abc123'}
b.use Rack::Session::Cookie, {secret: '5242e6bd9daf0e9645c2d4e22b11ba8cee0bed44439906d5f1bd5dad409d8637'}
b.use(OmniAuth::Strategies::Citadele, 'missing-private-key-file.pem', PRIVATE_CRT, PUBLIC_CRT, 'MY_FROM')
b.run lambda{|env| [404, {}, ['Not Found']]}
end.to_app }
Expand All @@ -115,7 +116,7 @@

context 'with non-existant private certificate file' do
let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie, {secret: 'abc123'}
b.use Rack::Session::Cookie, {secret: '5242e6bd9daf0e9645c2d4e22b11ba8cee0bed44439906d5f1bd5dad409d8637'}
b.use(OmniAuth::Strategies::Citadele, PRIVATE_KEY, 'missing-private-crt-file.pem', PUBLIC_CRT, 'MY_FROM')
b.run lambda{|env| [404, {}, ['Not Found']]}
end.to_app }
Expand Down Expand Up @@ -161,7 +162,7 @@ def post_to_request_phase_path

context 'with non-existant public key file' do
let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie, {secret: 'abc123'}
b.use Rack::Session::Cookie, {secret: '5242e6bd9daf0e9645c2d4e22b11ba8cee0bed44439906d5f1bd5dad409d8637'}
b.use(OmniAuth::Strategies::Citadele, PRIVATE_KEY, PRIVATE_CRT, 'missing-public-key-file.pem' )
b.run lambda{|env| [404, {}, ['Not Found']]}
end.to_app }
Expand Down

0 comments on commit 0295549

Please sign in to comment.