Skip to content

Commit d643aac

Browse files
committed
Fix token signing error reporting issue
1 parent 470258a commit d643aac

File tree

8 files changed

+39
-174
lines changed

8 files changed

+39
-174
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP-Google-Sheet-Client",
3-
"version": "1.4.10",
3+
"version": "1.4.11",
44
"keywords": "communication, REST, esp32, esp8266, raspberrypi, arduino",
55
"description": "Arduino Google Sheet REST client library for Arduino devices. This library allows devices to communicate with Google Sheet API to read, edit and delete the spreadsheets",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=ESP-Google-Sheet-Client
22

3-
version=1.4.10
3+
version=1.4.11
44

55
author=Mobizt
66

src/ESP_Google_Sheet_Client.cpp

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
1-
/**
2-
* Google Sheet Client, ESP_GOOGLE_SHEET_CLIENT_Google_Sheet_Client.cpp v1.4.10
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
33
*
4-
* This library supports Espressif ESP8266 and ESP32 MCUs
5-
*
6-
* Created August 11, 2025
7-
*
8-
* The MIT License (MIT)
9-
* Copyright (c) 2025 K. Suwatchai (Mobizt)
10-
*
11-
*
12-
* Permission is hereby granted, free of charge, to any person returning a copy of
13-
* this software and associated documentation files (the "Software"), to deal in
14-
* the Software without restriction, including without limitation the rights to
15-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16-
* the Software, and to permit persons to whom the Software is furnished to do so,
17-
* subject to the following conditions:
18-
*
19-
* The above copyright notice and this permission notice shall be included in all
20-
* copies or substantial portions of the Software.
21-
*
22-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4+
* SPDX-License-Identifier: MIT
285
*/
296

307
#ifndef ESP_GOOGLE_SHEET_CLIEN_CPP

src/ESP_Google_Sheet_Client.h

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
11
#ifndef ESP_GOOGLE_SHEET_CLIENT_VERSION
2-
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.10"
2+
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.11"
33
#endif
44

5-
/**
6-
* Google Sheet Client, ESP_Google_Sheet_Client.h v1.4.10
5+
/*
6+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
77
*
8-
* This library supports Espressif ESP8266 and ESP32 MCUs
9-
*
10-
* Created August 11, 2025
11-
*
12-
* The MIT License (MIT)
13-
* Copyright (c) 2025 K. Suwatchai (Mobizt)
14-
*
15-
*
16-
* Permission is hereby granted, free of charge, to any person returning a copy of
17-
* this software and associated documentation files (the "Software"), to deal in
18-
* the Software without restriction, including without limitation the rights to
19-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
20-
* the Software, and to permit persons to whom the Software is furnished to do so,
21-
* subject to the following conditions:
22-
*
23-
* The above copyright notice and this permission notice shall be included in all
24-
* copies or substantial portions of the Software.
25-
*
26-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
28-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
29-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
30-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+
* SPDX-License-Identifier: MIT
329
*/
3310

3411
#include <Arduino.h>
@@ -129,8 +106,8 @@ class GSheet_Values
129106
friend class ESP_Google_Sheet_Client;
130107

131108
public:
132-
GSheet_Values(){};
133-
~GSheet_Values(){};
109+
GSheet_Values() {};
110+
~GSheet_Values() {};
134111

135112
/** Get a range of values from a spreadsheet.
136113
*
@@ -1151,8 +1128,8 @@ class GSheet_Sheets
11511128
friend class ESP_Google_Sheet_Client;
11521129

11531130
public:
1154-
GSheet_Sheets(){};
1155-
~GSheet_Sheets(){};
1131+
GSheet_Sheets() {};
1132+
~GSheet_Sheets() {};
11561133

11571134
/** Copies a single sheet from a spreadsheet to another spreadsheet.
11581135
*
@@ -1241,8 +1218,8 @@ class GSheet_Metadata
12411218
friend class ESP_Google_Sheet_Client;
12421219

12431220
public:
1244-
GSheet_Metadata(){};
1245-
~GSheet_Metadata(){};
1221+
GSheet_Metadata() {};
1222+
~GSheet_Metadata() {};
12461223

12471224
/** Get the developer metadata with the specified ID.
12481225
*
@@ -1468,8 +1445,8 @@ class ESP_Google_Sheet_Client
14681445
* @param client The pointer to Arduino Client derived class of SSL Client.
14691446
* @param networkConnectionCB The function that handles the network connection.
14701447
* @param networkStatusCB The function that handle the network connection status acknowledgement.
1471-
*
1472-
* Due to the client pointer is assigned, to avoid dangling pointer,
1448+
*
1449+
* Due to the client pointer is assigned, to avoid dangling pointer,
14731450
* client should be existed as long as it was used for transportation.
14741451
*/
14751452
void setExternalClient(Client *client, ESP_GOOGLE_SHEET_CLIENT_NetworkConnectionRequestCallback networkConnectionCB,
@@ -1486,8 +1463,8 @@ class ESP_Google_Sheet_Client
14861463
* @param apn The GPRS APN (Access Point Name).
14871464
* @param user The GPRS user.
14881465
* @param password The GPRS password.
1489-
*
1490-
* Due to the client and modem pointers are assigned, to avoid dangling pointer,
1466+
*
1467+
* Due to the client and modem pointers are assigned, to avoid dangling pointer,
14911468
* client and modem should be existed as long as it was used for transportation.
14921469
*/
14931470
void setGSMClient(Client *client, void *modem = nullptr, const char *pin = nullptr, const char *apn = nullptr, const char *user = nullptr, const char *password = nullptr)

src/auth/GAuthManager.cpp

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
1-
/**
2-
* Google Sheet Client, GAuthManager v1.0.5
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
33
*
4-
* This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico MCUs.
5-
*
6-
* Created November 10, 2023
7-
*
8-
* The MIT License (MIT)
9-
* Copyright (c) 2022 K. Suwatchai (Mobizt)
10-
*
11-
*
12-
* Permission is hereby granted, free of charge, to any person returning a copy of
13-
* this software and associated documentation files (the "Software"), to deal in
14-
* the Software without restriction, including without limitation the rights to
15-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16-
* the Software, and to permit persons to whom the Software is furnished to do so,
17-
* subject to the following conditions:
18-
*
19-
* The above copyright notice and this permission notice shall be included in all
20-
* copies or substantial portions of the Software.
21-
*
22-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4+
* SPDX-License-Identifier: MIT
285
*/
296

307
#ifndef GAUTH_MANAGER_CPP
@@ -626,21 +603,11 @@ bool GAuthManager::refreshToken()
626603

627604
void GAuthManager::setTokenError(int code)
628605
{
629-
if (code != 0)
630-
config->signer.tokens.status = token_status_error;
631-
else
632-
{
633-
config->signer.tokens.error.message.clear();
634-
config->signer.tokens.status = token_status_ready;
635-
}
636-
606+
config->signer.tokens.error.message.clear();
607+
config->signer.tokens.status = code == 0 ? token_status_ready : token_status_error;
637608
config->signer.tokens.error.code = code;
638-
639-
if (config->signer.tokens.error.message.length() == 0)
640-
{
641-
config->internal.processing = false;
642-
errorToString(code, config->signer.tokens.error.message);
643-
}
609+
config->internal.processing = false;
610+
errorToString(code, config->signer.tokens.error.message);
644611
}
645612

646613
bool GAuthManager::handleTaskError(int code, int httpCode)

src/auth/GAuthManager.h

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
/**
2-
* Google Sheet Client, GAuthManager v1.0.5
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
33
*
4-
* This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico MCUs.
5-
*
6-
* Created November 10, 2023
7-
*
8-
* The MIT License (MIT)
9-
* Copyright (c) 2022 K. Suwatchai (Mobizt)
10-
*
11-
*
12-
* Permission is hereby granted, free of charge, to any person returning a copy of
13-
* this software and associated documentation files (the "Software"), to deal in
14-
* the Software without restriction, including without limitation the rights to
15-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16-
* the Software, and to permit persons to whom the Software is furnished to do so,
17-
* subject to the following conditions:
18-
*
19-
* The above copyright notice and this permission notice shall be included in all
20-
* copies or substantial portions of the Software.
21-
*
22-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4+
* SPDX-License-Identifier: MIT
285
*/
6+
297
#ifndef GAUTH_MANAGER_H
308
#define GAUTH_MANAGER_H
319

src/client/GS_TCP_Client.h

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11

2-
/**
3-
* The MIT License (MIT)
4-
* Copyright (c) 2025 K. Suwatchai (Mobizt)
2+
/*
3+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
54
*
6-
*
7-
* Permission is hereby granted, free of charge, to any person returning a copy of
8-
* this software and associated documentation files (the "Software"), to deal in
9-
* the Software without restriction, including without limitation the rights to
10-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11-
* the Software, and to permit persons to whom the Software is furnished to do so,
12-
* subject to the following conditions:
13-
*
14-
* The above copyright notice and this permission notice shall be included in all
15-
* copies or substantial portions of the Software.
16-
*
17-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5+
* SPDX-License-Identifier: MIT
236
*/
247

258
#ifndef GS_TCP_Client_H

src/client/WiFiClientImpl.h

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,12 @@
55
*
66
* The WiFiClient in ESP32 cannot be used in multithreading environment as in FreeRTOS task
77
* which can (always) lead to the assetion error "pbuf_free: p->ref > 0".
8+
*/
9+
10+
/*
11+
* SPDX-FileCopyrightText: 2025 Suwatchai K. <suwatchai@outlook.com>
812
*
9-
* Created August 20, 2023
10-
*
11-
* The MIT License (MIT)
12-
* Copyright (c) 2022 K. Suwatchai (Mobizt)
13-
*
14-
*
15-
* Permission is hereby granted, free of charge, to any person returning a copy of
16-
* this software and associated documentation files (the "Software"), to deal in
17-
* the Software without restriction, including without limitation the rights to
18-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
19-
* the Software, and to permit persons to whom the Software is furnished to do so,
20-
* subject to the following conditions:
21-
*
22-
* The above copyright notice and this permission notice shall be included in all
23-
* copies or substantial portions of the Software.
24-
*
25-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
27-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
28-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
29-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13+
* SPDX-License-Identifier: MIT
3114
*/
3215

3316
#if !defined(WIFICLIENT_IMPL_H) && defined(ESP32)
@@ -37,7 +20,7 @@
3720
class WiFiClientImpl : public Client
3821
{
3922
public:
40-
WiFiClientImpl(){};
23+
WiFiClientImpl() {};
4124
virtual ~WiFiClientImpl() { tcpClose(); };
4225
int connect(IPAddress ip, uint16_t port) { return tcpConnect(ip, port, _timeout); }
4326
int connect(IPAddress ip, uint16_t port, int32_t timeout_ms) { return tcpConnect(ip, port, timeout_ms); }

0 commit comments

Comments
 (0)