Skip to content

Commit

Permalink
Merge pull request #3 from foxford/t-bank-rebranding
Browse files Browse the repository at this point in the history
Rebrading T-bank
  • Loading branch information
badlamer authored Aug 1, 2024
2 parents 5469f83 + 911a122 commit 68ec3a3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ Metrics/BlockLength:
Naming/FileName:
Exclude:
- lib/omniauth-tinkoff-id.rb

Gemspec/RequireMFA:
Enabled: false
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TinkoffId OAuth strategy for OmniAuth
# T-Id OAuth strategy for OmniAuth

[![Ruby](https://github.com/foxford/omniauth-tinkoff-id/actions/workflows/main.yml/badge.svg)](https://github.com/foxford/omniauth-tinkoff-id/actions/workflows/main.yml)

Expand All @@ -18,7 +18,7 @@ This gem already added.

gem "omniauth-tinkoff-id"

[Join](https://tinkoff.github.io/tinkoff-id/join/) to TinkoffId
[Join](https://developer.tbank.ru/docs/intro/partner/tid) to TinkoffId

### Usage

Expand Down Expand Up @@ -74,4 +74,4 @@ This project is licensed under the [MIT License](LICENSE.txt).

## Acknowledgments

* https://tinkoff.github.io/tinkoff-id/
* https://developer.tbank.ru/docs/intro/partner/tid
8 changes: 4 additions & 4 deletions lib/omniauth/strategies/tinkoff_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

module OmniAuth
module Strategies
# Authenticate to Tinkoff ID utilizing OAuth 2.0
# https://tinkoff.github.io/tinkoff-id/
# Authenticate to T-ID utilizing OAuth 2.0
# https://developer.tbank.ru/docs/api/t-id
class TinkoffId < OmniAuth::Strategies::OAuth2
option :name, 'tinkoff_id'

option :client_options, {
site: 'https://id.tinkoff.ru',
site: 'https://id.tbank.ru',
token_url: '/auth/token',
authorize_url: '/auth/authorize',
auth_scheme: :basic_auth
Expand Down Expand Up @@ -64,7 +64,7 @@ def verified_email
end

def connection
@connection ||= Faraday.new('https://id.tinkoff.ru') do |conn|
@connection ||= Faraday.new('https://id.tbank.ru') do |conn|
conn.request :url_encoded
conn.request :authorization, 'Bearer', access_token.token
conn.response :json
Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth/tinkoff_id/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Omniauth
module TinkoffId
VERSION = '0.1.0'
VERSION = '0.2.0'
end
end
2 changes: 1 addition & 1 deletion omniauth-tinkoff-id.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Gem::Specification.new do |spec|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
spec.files = `git ls-files`.split("\n")
spec.require_paths = ['lib']
spec.add_runtime_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.8.0'
spec.add_dependency 'omniauth-oauth2', '>= 1.5', '<= 1.8.0'
end
4 changes: 2 additions & 2 deletions spec/omniauth/strategies/tinkoff_id_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

describe '#client_options' do
it 'has correct site' do
expect(subject.client.site).to eq('https://id.tinkoff.ru')
expect(subject.client.site).to eq('https://id.tbank.ru')
end

it 'has correct authorize_url' do
Expand Down Expand Up @@ -129,7 +129,7 @@
end

before do
stub_request(:post, 'https://id.tinkoff.ru/userinfo/userinfo')
stub_request(:post, 'https://id.tbank.ru/userinfo/userinfo')
.with(
body: { 'client_id' => 'client_id', 'client_secret' => 'client_secret' },
headers: {
Expand Down

0 comments on commit 68ec3a3

Please sign in to comment.