|
Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
|
#include <curl/curl.h>#include <cjson/cJSON.h>#include <time.h>#include <log.h>#include "http.h"#include "utils.h"Go to the source code of this file.
Data Structures | |
| struct | IBM_AuthHandle_TypeDef |
| IBM token handler. More... | |
Macros | |
| #define | IBM_DEFAULT_TOKEN_NAME "IBM_TOKEN" |
| Default ENV variable name of API key. More... | |
| #define | IBM_ACCESS_TOKEN_SIZE 2000 |
| Buffer size to hold access token. More... | |
| #define | IBM_REFRESH_TOKEN_SIZE 50 |
| Buffer size of hold refresh token. More... | |
Functions | |
| int8_t | IBM_HandleAuth (IBM_AuthHandle_TypeDef *auth_handle) |
| Authentication handler for IBM EIS. More... | |
| CURLcode | IBM_Authenticate (const char *token, IBM_AuthHandle_TypeDef *auth_handle) |
| Authenticate with IBM's Environmental Intelligence Suite (EIS). More... | |
| CURLcode | IBM_Refresh (IBM_AuthHandle_TypeDef *auth_handle) |
| Obtain a new access token from IBM's EMS. More... | |
Variables | |
| static const char * | IBM_TOKEN_URL = "https://auth-b2b-twc.ibm.com/connect/token" |
| IBM authenticate (token) URL. More... | |
| #define IBM_ACCESS_TOKEN_SIZE 2000 |
Buffer size to hold access token.
| #define IBM_DEFAULT_TOKEN_NAME "IBM_TOKEN" |
Default ENV variable name of API key.
| #define IBM_REFRESH_TOKEN_SIZE 50 |
Buffer size of hold refresh token.
| CURLcode IBM_Authenticate | ( | const char * | token, |
| IBM_AuthHandle_TypeDef * | auth_handle | ||
| ) |
Authenticate with IBM's Environmental Intelligence Suite (EIS).
Authenticate with IBM's Enviornmental Monitoring Suite.
IBM used OAuth2 for authentication. This function takes care of this process. The lengths of the tokens are:
| token | IBM API key to use. |
| auth_handle | Authenication handler for IBM tokens |
| int8_t IBM_HandleAuth | ( | IBM_AuthHandle_TypeDef * | auth_handle | ) |
Authentication handler for IBM EIS.
Handles authentication, checking and re-authentication of IBM EIS access tokens.
| auth_handle | Authentication hander with tokens and expiry information. |
Check if initialised already
| CURLcode IBM_Refresh | ( | IBM_AuthHandle_TypeDef * | auth_handle | ) |
Obtain a new access token from IBM's EMS.
Re-authenticate with IBM's Enviornmental Monitoring Suite.
IBM used OAuth2 for re-authentication. This function takes care of this process. The access_token length is at least 1861 characters.
| auth_handle | IBM EIS authentication handler. |
|
static |
IBM authenticate (token) URL.