@openeo/js-client 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/openeo.d.ts +2 -0
- package/openeo.js +8445 -8427
- package/openeo.min.js +1 -1
- package/package.json +5 -5
- package/src/authprovider.js +12 -4
- package/src/connection.js +1 -1
- package/src/oidcprovider.js +12 -1
- package/src/openeo.js +1 -1
package/src/authprovider.js
CHANGED
|
@@ -88,15 +88,23 @@ class AuthProvider {
|
|
|
88
88
|
*
|
|
89
89
|
* Returns `null` if no access token has been set yet (i.e. not authenticated any longer).
|
|
90
90
|
*
|
|
91
|
+
* Checks whether the server supports the JWT conformance class.
|
|
92
|
+
*
|
|
91
93
|
* @returns {string | null}
|
|
92
94
|
*/
|
|
93
95
|
getToken() {
|
|
96
|
+
//check conformance
|
|
97
|
+
const isJWT = this.connection.capabilities().hasConformance(
|
|
98
|
+
"https://api.openeo.org/*/authentication/jwt"
|
|
99
|
+
);
|
|
94
100
|
if (typeof this.token === 'string') {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
if(isJWT) {
|
|
102
|
+
return this.token; // JWT since API v1.3.0
|
|
103
|
+
} else {
|
|
104
|
+
return this.getType() + "/" + this.getProviderId() + "/" + this.token; // legacy
|
|
105
|
+
}
|
|
99
106
|
}
|
|
107
|
+
return null;
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
/**
|
package/src/connection.js
CHANGED
|
@@ -745,7 +745,7 @@ class Connection {
|
|
|
745
745
|
const response = await this._post('/validation', this._normalizeUserProcess(process).process);
|
|
746
746
|
if (Array.isArray(response.data.errors)) {
|
|
747
747
|
const errors = response.data.errors;
|
|
748
|
-
errors['federation:backends'] = Array.isArray(response.data['federation:
|
|
748
|
+
errors['federation:backends'] = Array.isArray(response.data['federation:backends']) ? response.data['federation:backends'] : [];
|
|
749
749
|
return errors;
|
|
750
750
|
}
|
|
751
751
|
else {
|
package/src/oidcprovider.js
CHANGED
|
@@ -127,6 +127,16 @@ class OidcProvider extends AuthProvider {
|
|
|
127
127
|
*/
|
|
128
128
|
this.defaultClients = Array.isArray(options.default_clients) ? options.default_clients : [];
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Additional parameters to include in authorization requests.
|
|
132
|
+
*
|
|
133
|
+
* As defined by the API, these parameters MUST be included when
|
|
134
|
+
* requesting the authorization endpoint.
|
|
135
|
+
*
|
|
136
|
+
* @type {object.<string, *>}
|
|
137
|
+
*/
|
|
138
|
+
this.authorizationParameters = Utils.isObject(options.authorization_parameters) ? options.authorization_parameters : {};
|
|
139
|
+
|
|
130
140
|
/**
|
|
131
141
|
* The detected default Client.
|
|
132
142
|
*
|
|
@@ -244,7 +254,8 @@ class OidcProvider extends AuthProvider {
|
|
|
244
254
|
scope: scope.join(' '),
|
|
245
255
|
validateSubOnSilentRenew: true,
|
|
246
256
|
response_type,
|
|
247
|
-
response_mode: response_type.includes('code') ? 'query' : 'fragment'
|
|
257
|
+
response_mode: response_type.includes('code') ? 'query' : 'fragment',
|
|
258
|
+
extraQueryParams: this.authorizationParameters
|
|
248
259
|
}, options);
|
|
249
260
|
}
|
|
250
261
|
|