fidor_api 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/fidor_api/client/authentication.rb +1 -1
- data/lib/fidor_api/client/dsl.rb +3 -1
- data/lib/fidor_api/environment/base.rb +4 -0
- data/lib/fidor_api/environment/fidor_de/production.rb +4 -0
- data/lib/fidor_api/environment/fidor_de/sandbox.rb +4 -0
- data/lib/fidor_api/environment/future.rb +5 -1
- data/lib/fidor_api/model/helpers/attribute_decimal_methods.rb +1 -0
- data/lib/fidor_api/model/transfer/generic.rb +1 -0
- data/lib/fidor_api/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea591697f4b9ea4d84d1b836aa2cb67de5e70d86c9cb726518c139cdfa3df157
|
4
|
+
data.tar.gz: d69f03db3d2efceef5ed2851d6780c088bdae26baeded6de1dbbe7144cbdaf1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd4cd844e1385350d18a38cbe9c8ecfcd333b0ff476f8be646d9e66e5c5a9590543baa73f924218459b10ef0afb7c7b8a9492dc0f4b97bb9d01b84b95d11c7d
|
7
|
+
data.tar.gz: ef18b392a1561fafd657720f9e7b116ae5a1c0e09d4a47a0b2560c62d79c7bb91f93f3a6c8b35c1486a96f961c78a22b8b011cae97dd0f50687b8ebc3a96a3e6
|
data/README.md
CHANGED
@@ -72,6 +72,10 @@ module FidorApi
|
|
72
72
|
api_host
|
73
73
|
end
|
74
74
|
|
75
|
+
def auth_redirect_host
|
76
|
+
'http://auth.custom.example.com'
|
77
|
+
end
|
78
|
+
|
75
79
|
def auth_methods
|
76
80
|
%i[authorization_code resource_owner_password_credentials client_credentials].freeze
|
77
81
|
end
|
@@ -90,6 +94,16 @@ Rails.application.config.x.tap do |config|
|
|
90
94
|
end
|
91
95
|
```
|
92
96
|
|
97
|
+
Methods required to be implemented:
|
98
|
+
|
99
|
+
| Method Name | Expected to Return | Usage |
|
100
|
+
| - | - | - |
|
101
|
+
| `api_host` | `String` | Used as endpoint for the normal API calls |
|
102
|
+
| `auth_host` | `String` | Used for the oAuth2 calls |
|
103
|
+
| `auth_redirect_host` | `String` | Used for the web-based redirect flow URLs |
|
104
|
+
| `auth_methods` | `Array` of `Symbol` | Defines the supported oAuth2 authentication methods |
|
105
|
+
| `transfers_api` | `Symbol` | Defines which transfer API is supported. `:generic` or `:classic` |
|
106
|
+
|
93
107
|
### 1. oAuth (Rails)
|
94
108
|
|
95
109
|
Redirect the user to the authorize URL:
|
@@ -25,7 +25,7 @@ module FidorApi
|
|
25
25
|
def authorize_start(redirect_uri:, state: SecureRandom.hex(8))
|
26
26
|
check_flow_support! :authorization_code
|
27
27
|
|
28
|
-
"#{config.environment.
|
28
|
+
"#{config.environment.auth_redirect_host}/oauth/authorize" \
|
29
29
|
+ "?client_id=#{config.client_id}" \
|
30
30
|
+ "&redirect_uri=#{CGI.escape(redirect_uri)}" \
|
31
31
|
+ "&state=#{state}" \
|
data/lib/fidor_api/client/dsl.rb
CHANGED
@@ -49,13 +49,15 @@ module FidorApi
|
|
49
49
|
end
|
50
50
|
rescue Faraday::ClientError => e
|
51
51
|
raise if e.response[:status] != 422
|
52
|
+
|
52
53
|
model.tap { |m| m.parse_errors(e.response[:body]) }
|
53
54
|
end
|
54
55
|
|
55
56
|
POSSIBLE_CONFIRMABLE_HEADERS = %w[x-fidor-confirmation-path location].freeze
|
56
57
|
|
57
58
|
def extract_confirmable_id(headers)
|
58
|
-
return if (tuple = headers.detect { |key,
|
59
|
+
return if (tuple = headers.detect { |key, value| POSSIBLE_CONFIRMABLE_HEADERS.include?(key) && value.present? }).nil?
|
60
|
+
|
59
61
|
tuple.last.split('/').last
|
60
62
|
end
|
61
63
|
end
|
data/lib/fidor_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fidor_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fidor Solutions AG
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '12.3'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '12.3'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,16 +126,16 @@ dependencies:
|
|
126
126
|
name: rubocop
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 0.59.1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 0.59.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: simplecov
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|