Browse Source

Merge pull request #236 from Leptopoda/fix/#235

fix security for loginFlow2
pull/242/head
Kate 2 years ago committed by GitHub
parent
commit
bcd0f6430c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  2. 2
      packages/nextcloud/lib/src/nextcloud.openapi.json
  3. 2
      specs/core.json

10
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -244,11 +244,6 @@ class NextcloudCoreClient {
'Accept': 'application/json', 'Accept': 'application/json',
}; };
Uint8List? body; Uint8List? body;
if (rootClient.authentications.map((final a) => a.id).contains('basic_auth')) {
headers.addAll(rootClient.authentications.singleWhere((final a) => a.id == 'basic_auth').headers);
} else {
throw Exception('Missing authentication for basic_auth');
}
final response = await rootClient.doRequest( final response = await rootClient.doRequest(
'post', 'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
@ -269,11 +264,6 @@ class NextcloudCoreClient {
'Accept': 'application/json', 'Accept': 'application/json',
}; };
Uint8List? body; Uint8List? body;
if (rootClient.authentications.map((final a) => a.id).contains('basic_auth')) {
headers.addAll(rootClient.authentications.singleWhere((final a) => a.id == 'basic_auth').headers);
} else {
throw Exception('Missing authentication for basic_auth');
}
queryParameters['token'] = token; queryParameters['token'] = token;
final response = await rootClient.doRequest( final response = await rootClient.doRequest(
'post', 'post',

2
packages/nextcloud/lib/src/nextcloud.openapi.json

@ -2069,6 +2069,7 @@
"tags": [ "tags": [
"core" "core"
], ],
"security": [],
"responses": { "responses": {
"200": { "200": {
"description": "Login flow init", "description": "Login flow init",
@ -2089,6 +2090,7 @@
"tags": [ "tags": [
"core" "core"
], ],
"security": [],
"parameters": [ "parameters": [
{ {
"name": "token", "name": "token",

2
specs/core.json

@ -1043,6 +1043,7 @@
"tags": [ "tags": [
"core" "core"
], ],
"security": [],
"responses": { "responses": {
"200": { "200": {
"description": "Login flow init", "description": "Login flow init",
@ -1063,6 +1064,7 @@
"tags": [ "tags": [
"core" "core"
], ],
"security": [],
"parameters": [ "parameters": [
{ {
"name": "token", "name": "token",

Loading…
Cancel
Save