You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -79,7 +81,6 @@ With `verify_ssl` it is possible to disable the verifications of certificates.
79
81
Disabling the verification is not recommended, but it might be useful during
80
82
local development or testing
81
83
82
-
83
84
```python
84
85
from fds.sdk.utils.authentication import ConfidentialClient
85
86
@@ -90,55 +91,86 @@ client = ConfidentialClient(
90
91
)
91
92
```
92
93
94
+
### Request Retries
95
+
96
+
In case the request retry behaviour should be customized, it is possible to pass a `urllib3.Retry` object to
97
+
the `ConfidentialClient`.
98
+
99
+
```python
100
+
from urllib3 import Retry
101
+
from fds.sdk.utils.authentication import ConfidentialClient
102
+
103
+
client = ConfidentialClient(
104
+
config_path='/path/to/config.json',
105
+
retry=Retry(
106
+
total=5,
107
+
backoff_factor=0.1,
108
+
status_forcelist=[500, 502, 503, 504]
109
+
)
110
+
)
111
+
```
112
+
93
113
## Modules
94
114
95
115
Information about the various utility modules contained in this library can be found below.
96
116
97
117
### Authentication
98
118
99
-
The [authentication module](src/fds/sdk/utils/authentication) provides helper classes that facilitate [OAuth 2.0](https://developer.factset.com/learn/authentication-oauth2) authentication and authorization with FactSet's APIs. Currently the module has support for the [client credentials flow](https://github.com/factset/oauth2-guidelines#client-credentials-flow-1).
119
+
The [authentication module](src/fds/sdk/utils/authentication) provides helper classes that
120
+
facilitate [OAuth 2.0](https://developer.factset.com/learn/authentication-oauth2) authentication and authorization with
121
+
FactSet's APIs. Currently the module has support for
122
+
the [client credentials flow](https://github.com/factset/oauth2-guidelines#client-credentials-flow-1).
100
123
101
124
Each helper class in the module has the following features:
102
125
103
-
* Accepts a configuration file or `dict` that contains information about the OAuth 2.0 client, including the client ID and private key.
126
+
* Accepts a configuration file or `dict` that contains information about the OAuth 2.0 client, including the client ID
127
+
and private key.
104
128
* Performs authentication with FactSet's OAuth 2.0 authorization server and retrieves an access token.
105
129
* Caches the access token for reuse and requests a new access token as needed when one expires.
106
130
* In order for this to work correctly, the helper class instance should be reused in production environments.
107
131
108
132
#### Configuration
109
133
110
-
Classes in the authentication module require OAuth 2.0 client configuration information to be passed to constructors through a JSON-formatted file or a `dict`. In either case the format is the same:
134
+
Classes in the authentication module require OAuth 2.0 client configuration information to be passed to constructors
135
+
through a JSON-formatted file or a `dict`. In either case the format is the same:
111
136
112
137
```json
113
138
{
114
-
"name": "Application name registered with FactSet's Developer Portal",
115
-
"clientId": "OAuth 2.0 Client ID registered with FactSet's Developer Portal",
116
-
"clientAuthType": "Confidential",
117
-
"owners": ["USERNAME-SERIAL"],
118
-
"jwk": {
119
-
"kty": "RSA",
120
-
"use": "sig",
121
-
"alg": "RS256",
122
-
"kid": "Key ID",
123
-
"d": "ECC Private Key",
124
-
"n": "Modulus",
125
-
"e": "Exponent",
126
-
"p": "First Prime Factor",
127
-
"q": "Second Prime Factor",
128
-
"dp": "First Factor CRT Exponent",
129
-
"dq": "Second Factor CRT Exponent",
130
-
"qi": "First CRT Coefficient",
131
-
}
139
+
"name": "Application name registered with FactSet's Developer Portal",
140
+
"clientId": "OAuth 2.0 Client ID registered with FactSet's Developer Portal",
141
+
"clientAuthType": "Confidential",
142
+
"owners": [
143
+
"USERNAME-SERIAL"
144
+
],
145
+
"jwk": {
146
+
"kty": "RSA",
147
+
"use": "sig",
148
+
"alg": "RS256",
149
+
"kid": "Key ID",
150
+
"d": "ECC Private Key",
151
+
"n": "Modulus",
152
+
"e": "Exponent",
153
+
"p": "First Prime Factor",
154
+
"q": "Second Prime Factor",
155
+
"dp": "First Factor CRT Exponent",
156
+
"dq": "Second Factor CRT Exponent",
157
+
"qi": "First CRT Coefficient"
158
+
}
132
159
}
133
160
```
134
161
135
-
If you're just starting out, you can visit FactSet's Developer Portal to [create a new application](https://developer.factset.com/applications) and download a configuration file in this format.
162
+
If you're just starting out, you can visit FactSet's Developer Portal
163
+
to [create a new application](https://developer.factset.com/applications) and download a configuration file in this
164
+
format.
136
165
137
-
If you're creating and managing your signing key pair yourself, see the required [JWK parameters](https://github.com/factset/oauth2-guidelines#jwk-parameters) for public-private key pairs.
166
+
If you're creating and managing your signing key pair yourself, see the
167
+
required [JWK parameters](https://github.com/factset/oauth2-guidelines#jwk-parameters) for public-private key pairs.
138
168
139
169
## Debugging
140
170
141
-
This library uses the [logging module](https://docs.python.org/3/howto/logging.html) to log various messages that will help you understand what it's doing. You can increase the log level to see additional debug information using standard conventions. For example:
171
+
This library uses the [logging module](https://docs.python.org/3/howto/logging.html) to log various messages that will
172
+
help you understand what it's doing. You can increase the log level to see additional debug information using standard
0 commit comments