Add oauth2 feature key 63/139663/13
authorjkjo92 <jkjo92@samsung.com>
Thu, 20 Jul 2017 04:45:20 +0000 (13:45 +0900)
committerjkjo92 <jkjo92@samsung.com>
Thu, 27 Jul 2017 08:19:33 +0000 (17:19 +0900)
Change-Id: I8a90f67466d0c4d71b8d36945c79f1162e32f295
Signed-off-by: jkjo92 <jkjo92@samsung.com>
doc/liboauth2_doc.h [changed mode: 0644->0755]
include/oauth2_error.h
include/oauth2_manager.h
include/oauth2_request.h
include/oauth2_response.h
src/oauth2_error.c
src/oauth2_manager.c
src/oauth2_private.h [changed mode: 0644->0755]
src/oauth2_request.c
src/oauth2_response.c

old mode 100644 (file)
new mode 100755 (executable)
index a3477d3..31ef863
@@ -29,9 +29,9 @@
  * @section CAPI_OAUTH2_MODULE_OVERVIEW Overview
  * The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf.
  *
- * @if WEARABLE
  * @section CAPI_OAUTH2_MODULE_FEATURE Related Features
  * This API is related with the following features:
+ *  - http://tizen.org/feature/oauth2
  *  - http://tizen.org/feature/network.internet
  *
  * It is recommended to design feature related codes in your application for reliability.\n
@@ -40,9 +40,7 @@
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
  *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
- * @endif
- *
-*/
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature List</b>.</a>a>
+ */
 
 #endif /* __OAUTH2_DOC_H__  */
index c547fcc54df2480bf8848ff01d89ed5fb8a2b8ca..074b1f64373e050428abb8e445ddee14d728f57a 100755 (executable)
@@ -58,6 +58,7 @@ typedef struct oauth2_error_s *oauth2_error_h;
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_error_get_code(oauth2_error_h handle, int *server_error_code, int *platform_error_code);
 
@@ -75,6 +76,7 @@ OAUTH2_API int oauth2_error_get_code(oauth2_error_h handle, int *server_error_co
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_error_get_description(oauth2_error_h handle, char **description);
 
@@ -92,6 +94,7 @@ OAUTH2_API int oauth2_error_get_description(oauth2_error_h handle, char **descri
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_error_get_uri(oauth2_error_h handle, char **uri);
 
@@ -110,6 +113,7 @@ OAUTH2_API int oauth2_error_get_uri(oauth2_error_h handle, char **uri);
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_error_get_custom_data(oauth2_error_h handle, const char *custom_key, char **custom_value);
 
index ba0240cfbf2a6a61ac4500788b42e61375d1ec35..215cda8d7c001b880e8cf28ba0c1fbd10706c62c 100755 (executable)
@@ -62,6 +62,7 @@ typedef struct oauth2_manager_s *oauth2_manager_h;
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  *
  * @see oauth2_manager_destroy()
  */
@@ -77,6 +78,7 @@ OAUTH2_API int oauth2_manager_create(oauth2_manager_h *handle);
  *             otherwise a negative error value
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_manager_destroy(oauth2_manager_h handle);
 
@@ -260,6 +262,7 @@ OAUTH2_API int oauth2_manager_refresh_access_token(oauth2_manager_h handle, oaut
  * @param[in] handle The auth2 manager handle.
  * @retval     false No pending request
  * @retval     true There is pending request.
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API bool oauth2_manager_is_request_in_progress(oauth2_manager_h handle);
 
index 719114c082bd1dedad733aa145e71816458e7a90..6d8f96b29959c5eb26312d8da200354e20aba927 100755 (executable)
@@ -55,6 +55,7 @@ typedef struct oauth2_request_s *oauth2_request_h;
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_create(oauth2_request_h *handle);
 
@@ -68,6 +69,7 @@ OAUTH2_API int oauth2_request_create(oauth2_request_h *handle);
  *             otherwise a negative error value
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_destroy(oauth2_request_h handle);
 
@@ -83,6 +85,7 @@ OAUTH2_API int oauth2_request_destroy(oauth2_request_h handle);
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_auth_end_point_url(oauth2_request_h handle, const char *url);
 
@@ -98,6 +101,7 @@ OAUTH2_API int oauth2_request_set_auth_end_point_url(oauth2_request_h handle, co
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_token_end_point_url(oauth2_request_h handle, const char *url);
 
@@ -113,6 +117,7 @@ OAUTH2_API int oauth2_request_set_token_end_point_url(oauth2_request_h handle, c
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_redirection_url(oauth2_request_h handle, const char *url);
 
@@ -128,6 +133,7 @@ OAUTH2_API int oauth2_request_set_redirection_url(oauth2_request_h handle, const
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_refresh_token_url(oauth2_request_h handle, const char *url);
 
@@ -143,6 +149,7 @@ OAUTH2_API int oauth2_request_set_refresh_token_url(oauth2_request_h handle, con
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_refresh_token(oauth2_request_h handle, char *refresh_token);
 
@@ -158,6 +165,7 @@ OAUTH2_API int oauth2_request_set_refresh_token(oauth2_request_h handle, char *r
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_response_type(oauth2_request_h handle, oauth2_response_type_e response_type);
 
@@ -173,6 +181,7 @@ OAUTH2_API int oauth2_request_set_response_type(oauth2_request_h handle, oauth2_
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_client_id(oauth2_request_h handle, const char *client_id);
 
@@ -188,6 +197,7 @@ OAUTH2_API int oauth2_request_set_client_id(oauth2_request_h handle, const char
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_client_secret(oauth2_request_h handle, const char *client_secret);
 
@@ -206,6 +216,7 @@ OAUTH2_API int oauth2_request_set_client_secret(oauth2_request_h handle, const c
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_client_authentication_type(oauth2_request_h handle, oauth2_client_authentication_type_e client_auth_type);
 
@@ -221,6 +232,7 @@ OAUTH2_API int oauth2_request_set_client_authentication_type(oauth2_request_h ha
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_scope(oauth2_request_h handle, const char *scope);
 
@@ -236,6 +248,7 @@ OAUTH2_API int oauth2_request_set_scope(oauth2_request_h handle, const char *sco
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_state(oauth2_request_h handle, const char *state);
 
@@ -251,6 +264,7 @@ OAUTH2_API int oauth2_request_set_state(oauth2_request_h handle, const char *sta
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_grant_type(oauth2_request_h handle, oauth2_grant_type_e grant_type);
 
@@ -266,6 +280,7 @@ OAUTH2_API int oauth2_request_set_grant_type(oauth2_request_h handle, oauth2_gra
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  *
  * @see oauth2_response_get_authorization_code()
  */
@@ -283,6 +298,7 @@ OAUTH2_API int oauth2_request_set_authorization_code(oauth2_request_h handle, co
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_user_name(oauth2_request_h handle, const char *user_name);
 
@@ -298,6 +314,7 @@ OAUTH2_API int oauth2_request_set_user_name(oauth2_request_h handle, const char
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_set_password(oauth2_request_h handle, const char *password);
 
@@ -314,6 +331,7 @@ OAUTH2_API int oauth2_request_set_password(oauth2_request_h handle, const char *
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  *
  * @see oauth2_request_get_custom_data()
  */
@@ -333,6 +351,7 @@ OAUTH2_API int oauth2_request_add_custom_data(oauth2_request_h handle, const cha
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_auth_end_point_url(oauth2_request_h handle, char **url);
 
@@ -350,6 +369,7 @@ OAUTH2_API int oauth2_request_get_auth_end_point_url(oauth2_request_h handle, ch
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_token_end_point_url(oauth2_request_h handle, char **url);
 
@@ -367,6 +387,7 @@ OAUTH2_API int oauth2_request_get_token_end_point_url(oauth2_request_h handle, c
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_redirection_url(oauth2_request_h handle, char **url);
 
@@ -385,6 +406,7 @@ OAUTH2_API int oauth2_request_get_redirection_url(oauth2_request_h handle, char
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_refresh_token_url(oauth2_request_h handle, char **url);
 
@@ -402,6 +424,7 @@ OAUTH2_API int oauth2_request_get_refresh_token_url(oauth2_request_h handle, cha
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_refresh_token(oauth2_request_h handle, char **refresh_token);
 
@@ -419,6 +442,7 @@ OAUTH2_API int oauth2_request_get_refresh_token(oauth2_request_h handle, char **
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_response_type(oauth2_request_h handle, oauth2_response_type_e *response_type);
 
@@ -436,6 +460,7 @@ OAUTH2_API int oauth2_request_get_response_type(oauth2_request_h handle, oauth2_
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_client_id(oauth2_request_h handle, char **client_id);
 
@@ -453,6 +478,7 @@ OAUTH2_API int oauth2_request_get_client_id(oauth2_request_h handle, char **clie
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_client_secret(oauth2_request_h handle, char **client_secret);
 
@@ -470,6 +496,7 @@ OAUTH2_API int oauth2_request_get_client_secret(oauth2_request_h handle, char **
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_scope(oauth2_request_h handle, char **scope);
 
@@ -487,6 +514,7 @@ OAUTH2_API int oauth2_request_get_scope(oauth2_request_h handle, char **scope);
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_state(oauth2_request_h handle, char **state);
 
@@ -504,6 +532,7 @@ OAUTH2_API int oauth2_request_get_state(oauth2_request_h handle, char **state);
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_grant_type(oauth2_request_h handle, oauth2_grant_type_e *grant_type);
 
@@ -521,6 +550,7 @@ OAUTH2_API int oauth2_request_get_grant_type(oauth2_request_h handle, oauth2_gra
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_authorization_code(oauth2_request_h handle, char **code);
 
@@ -538,6 +568,7 @@ OAUTH2_API int oauth2_request_get_authorization_code(oauth2_request_h handle, ch
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_user_name(oauth2_request_h handle, char **user_name);
 
@@ -555,6 +586,7 @@ OAUTH2_API int oauth2_request_get_user_name(oauth2_request_h handle, char **user
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_password(oauth2_request_h handle, char **password);
 
@@ -573,6 +605,7 @@ OAUTH2_API int oauth2_request_get_password(oauth2_request_h handle, char **passw
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_request_get_custom_data(oauth2_request_h handle, const char *custom_key, char **custom_value);
 
index c1ac206ece160848d91befd268e2f4e484673308..276053892f35cf0f68c53442532201f983ce5e3c 100755 (executable)
@@ -53,6 +53,7 @@ typedef struct oauth2_response_s *oauth2_response_h;
  *             otherwise a negative error value
  * @retval     #OAUTH2_ERROR_NONE               Successful
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_destroy(oauth2_response_h handle);
 
@@ -70,6 +71,7 @@ OAUTH2_API int oauth2_response_destroy(oauth2_response_h handle);
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  *
  * @see oauth2_request_set_authorization_code()
  */
@@ -89,6 +91,7 @@ OAUTH2_API int oauth2_response_get_authorization_code(oauth2_response_h handle,
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_state(oauth2_response_h handle, char **state);
 
@@ -106,6 +109,7 @@ OAUTH2_API int oauth2_response_get_state(oauth2_response_h handle, char **state)
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_access_token(oauth2_response_h handle, char **access_token);
 
@@ -123,6 +127,7 @@ OAUTH2_API int oauth2_response_get_access_token(oauth2_response_h handle, char *
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_token_type(oauth2_response_h handle, char **token_type);
 
@@ -140,6 +145,7 @@ OAUTH2_API int oauth2_response_get_token_type(oauth2_response_h handle, char **t
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_expires_in(oauth2_response_h handle, long long *expires_in);
 
@@ -157,6 +163,7 @@ OAUTH2_API int oauth2_response_get_expires_in(oauth2_response_h handle, long lon
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_refresh_token(oauth2_response_h handle, char **refresh_token);
 
@@ -174,6 +181,7 @@ OAUTH2_API int oauth2_response_get_refresh_token(oauth2_response_h handle, char
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_scope(oauth2_response_h handle, char **scope);
 
@@ -191,6 +199,7 @@ OAUTH2_API int oauth2_response_get_scope(oauth2_response_h handle, char **scope)
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  *
  * @see oauth2_error_h
  */
@@ -212,6 +221,7 @@ OAUTH2_API int oauth2_response_get_error(oauth2_response_h handle, oauth2_error_
  * @retval     #OAUTH2_ERROR_OUT_OF_MEMORY      Out of Memory
  * @retval     #OAUTH2_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval     #OAUTH2_ERROR_VALUE_NOT_FOUND    Value not found
+ * @retval     #OAUTH2_ERROR_NOT_SUPPORTED      Not supported
  */
 OAUTH2_API int oauth2_response_get_custom_data(oauth2_response_h handle, const char *custom_key, char **custom_value);
 
index c6df3ecd40d9d00ba5e47501e8c2e197f5136661..d4ef03ce8a13ac220ba979219c5ec326f30354c4 100755 (executable)
@@ -23,6 +23,9 @@ OAUTH2_API
 int oauth2_error_get_code(oauth2_error_h handle, int *server_error_code,
        int *platform_error_code)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -83,6 +86,9 @@ int oauth2_error_get_code(oauth2_error_h handle, int *server_error_code,
 OAUTH2_API
 int oauth2_error_get_description(oauth2_error_h handle, char **description)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -102,6 +108,9 @@ int oauth2_error_get_description(oauth2_error_h handle, char **description)
 OAUTH2_API
 int oauth2_error_get_uri(oauth2_error_h handle, char **uri)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -122,6 +131,9 @@ OAUTH2_API
 int oauth2_error_get_custom_data(oauth2_error_h handle, const char *custom_key,
        char **custom_value)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
index c3d4c459e5037ecd108db82b41ccf8b377832df7..9baeb3c42a8a249990cd780c367d1232b2ac96e6 100755 (executable)
@@ -25,7 +25,7 @@
 #include "oauth2_util.h"
 #include "oauth2_private.h"
 
-#define NETWORK_FEATURE "tizen.org/feature/network.internet"
+#define OAUTH2_FEATURE "tizen.org/feature/oauth2"
 #define INTERNET_PRIVILEGE "http://tizen.org/privilege/internet"
 #define SMACK_LABEL_LEN 255
 
@@ -39,6 +39,9 @@ oauth2_manager_create(oauth2_manager_h *handle)
 {
        OAUTH2_LOG_I("oauth2_manager_create");
 
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+       "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "Null Input");
 
@@ -64,6 +67,9 @@ oauth2_manager_create(oauth2_manager_h *handle)
 OAUTH2_API int
 oauth2_manager_destroy(oauth2_manager_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "Null Input");
 
@@ -74,12 +80,12 @@ oauth2_manager_destroy(oauth2_manager_h handle)
 }
 
 /*LCOV_EXCL_START*/
-static bool
+bool
 __is_feature_supported(void)
 {
        bool supported = FALSE;
-       int ret = system_info_get_platform_bool(NETWORK_FEATURE, &supported);
-       OAUTH2_RETURN_VAL(ret == SYSTEM_INFO_ERROR_NONE, {}, false, "network feature support check failed");
+       int ret = system_info_get_platform_bool(OAUTH2_FEATURE, &supported);
+       OAUTH2_RETURN_VAL(ret == SYSTEM_INFO_ERROR_NONE, {}, false, "oauth2 feature support check failed");
 
        return supported;
 }
@@ -1229,6 +1235,9 @@ OAUTH2_API int
 oauth2_manager_request_token(oauth2_manager_h handle, oauth2_request_h request,
        oauth2_token_cb callback, void *user_data)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(callback, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "callback is Null");
 
@@ -1238,8 +1247,6 @@ oauth2_manager_request_token(oauth2_manager_h handle, oauth2_request_h request,
        OAUTH2_RETURN_VAL(request, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "request is Null");
        /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
@@ -1344,6 +1351,9 @@ oauth2_manager_request_authorization_grant(oauth2_manager_h handle,
        oauth2_request_h request, oauth2_auth_grant_cb callback,
        void *user_data)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(callback, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "callback is Null");
 
@@ -1352,10 +1362,8 @@ oauth2_manager_request_authorization_grant(oauth2_manager_h handle,
 
        OAUTH2_RETURN_VAL(request, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "request is Null");
-       /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
+       /*LCOV_EXCL_START*/
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
 
@@ -1433,6 +1441,9 @@ oauth2_manager_request_access_token(oauth2_manager_h handle,
        oauth2_request_h request, oauth2_access_token_cb callback,
        void *user_data)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(callback, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "callback is Null");
 
@@ -1441,10 +1452,8 @@ oauth2_manager_request_access_token(oauth2_manager_h handle,
 
        OAUTH2_RETURN_VAL(request, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "request is Null");
-       /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
+       /*LCOV_EXCL_START*/
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
 
@@ -1598,6 +1607,9 @@ oauth2_manager_refresh_access_token(oauth2_manager_h handle,
        oauth2_request_h request, oauth2_refresh_token_cb callback,
        void *user_data)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(callback, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "callback is Null");
 
@@ -1606,10 +1618,8 @@ oauth2_manager_refresh_access_token(oauth2_manager_h handle,
 
        OAUTH2_RETURN_VAL(request, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "request is Null");
-       /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
+       /*LCOV_EXCL_START*/
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
 
@@ -1663,6 +1673,9 @@ oauth2_manager_refresh_access_token(oauth2_manager_h handle,
 OAUTH2_API bool
 oauth2_manager_is_request_in_progress(oauth2_manager_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, FALSE, "handle is Null");
 
        /*LCOV_EXCL_START*/
@@ -1673,12 +1686,13 @@ oauth2_manager_is_request_in_progress(oauth2_manager_h handle)
 OAUTH2_API int
 oauth2_manager_clear_cookies(oauth2_manager_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "handle is Null");
-       /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
+       /*LCOV_EXCL_START*/
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
 
@@ -1715,12 +1729,13 @@ oauth2_manager_clear_cookies(oauth2_manager_h handle)
 OAUTH2_API int
 oauth2_manager_clear_cache(oauth2_manager_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "handle is Null");
-       /*LCOV_EXCL_START*/
-       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
-               "network feature not supported");
 
+       /*LCOV_EXCL_START*/
        OAUTH2_RETURN_VAL(__check_permission(), {}, OAUTH2_ERROR_PERMISSION_DENIED,
                "permission denied, no internet privilege");
 
old mode 100644 (file)
new mode 100755 (executable)
index e73f3b3..11c436d
@@ -136,5 +136,6 @@ typedef struct _oauth2_manager_s {
 } oauth2_manager_s;
 
 int _oauth2_response_create(oauth2_response_s **response);
+bool __is_feature_supported(void);
 
 #endif /* OAUTH2_PRIVATE_H_ */
index c424a88b20aaeba76b4f35f56fc05843f1dd8823..0aa670ba7808a8f94ba20d82ee105e64d5491b67 100755 (executable)
@@ -22,6 +22,9 @@
 OAUTH2_API int
 oauth2_request_create(oauth2_request_h *handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -47,6 +50,9 @@ oauth2_request_create(oauth2_request_h *handle)
 OAUTH2_API int
 oauth2_request_destroy(oauth2_request_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -64,6 +70,9 @@ oauth2_request_destroy(oauth2_request_h handle)
 OAUTH2_API int
 oauth2_request_set_auth_end_point_url(oauth2_request_h handle, const char *url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -81,6 +90,9 @@ oauth2_request_set_auth_end_point_url(oauth2_request_h handle, const char *url)
 OAUTH2_API int
 oauth2_request_set_token_end_point_url(oauth2_request_h handle, const char *url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -98,6 +110,9 @@ oauth2_request_set_token_end_point_url(oauth2_request_h handle, const char *url)
 OAUTH2_API int
 oauth2_request_set_redirection_url(oauth2_request_h handle, const char *url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -115,6 +130,9 @@ oauth2_request_set_redirection_url(oauth2_request_h handle, const char *url)
 OAUTH2_API int
 oauth2_request_set_refresh_token_url(oauth2_request_h handle, const char *url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -132,6 +150,9 @@ oauth2_request_set_refresh_token_url(oauth2_request_h handle, const char *url)
 OAUTH2_API int
 oauth2_request_set_refresh_token(oauth2_request_h handle, char *refresh_token)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
@@ -149,6 +170,9 @@ OAUTH2_API int
 oauth2_request_set_response_type(oauth2_request_h handle,
        oauth2_response_type_e response_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -174,6 +198,9 @@ oauth2_request_set_response_type(oauth2_request_h handle,
 OAUTH2_API int
 oauth2_request_set_client_id(oauth2_request_h handle, const char *client_id)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -192,6 +219,9 @@ OAUTH2_API int
 oauth2_request_set_client_secret(oauth2_request_h handle,
        const char *client_secret)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -210,6 +240,9 @@ OAUTH2_API int
 oauth2_request_set_client_authentication_type(oauth2_request_h handle,
        oauth2_client_authentication_type_e client_auth_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -235,6 +268,9 @@ oauth2_request_set_client_authentication_type(oauth2_request_h handle,
 OAUTH2_API int
 oauth2_request_set_scope(oauth2_request_h handle, const char *scope)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -252,6 +288,9 @@ oauth2_request_set_scope(oauth2_request_h handle, const char *scope)
 OAUTH2_API int
 oauth2_request_set_state(oauth2_request_h handle, const char *state)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -270,6 +309,9 @@ OAUTH2_API int
 oauth2_request_set_grant_type(oauth2_request_h handle,
        oauth2_grant_type_e grant_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -280,10 +322,6 @@ oauth2_request_set_grant_type(oauth2_request_h handle,
        }
 
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
-       if (!req_impl) {
-               OAUTH2_LOG_E("Null Input");
-               return OAUTH2_ERROR_INVALID_PARAMETER;
-       }
 
        if (!req_impl->request_data) {
                OAUTH2_LOG_E("oauth2_request_h must be created first.");
@@ -299,14 +337,13 @@ oauth2_request_set_grant_type(oauth2_request_h handle,
 OAUTH2_API int
 oauth2_request_set_authorization_code(oauth2_request_h handle, const char *code)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
-       if (!req_impl) {
-               OAUTH2_LOG_E("Null Input");
-               return OAUTH2_ERROR_INVALID_PARAMETER;
-       }
 
        if (!req_impl->request_data) {
                OAUTH2_LOG_E("oauth2_request_h must be created first.");
@@ -320,14 +357,13 @@ oauth2_request_set_authorization_code(oauth2_request_h handle, const char *code)
 OAUTH2_API int
 oauth2_request_set_user_name(oauth2_request_h handle, const char *user_name)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
-       if (!req_impl) {
-               OAUTH2_LOG_E("Null Input");
-               return OAUTH2_ERROR_INVALID_PARAMETER;
-       }
 
        if (!req_impl->request_data) {
                OAUTH2_LOG_E("oauth2_request_h must be created first.");
@@ -341,14 +377,13 @@ oauth2_request_set_user_name(oauth2_request_h handle, const char *user_name)
 OAUTH2_API int
 oauth2_request_set_password(oauth2_request_h handle, const char *password)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
-       if (!req_impl) {
-               OAUTH2_LOG_E("Null Input");
-               return OAUTH2_ERROR_INVALID_PARAMETER;
-       }
 
        if (!req_impl->request_data) {
                OAUTH2_LOG_E("oauth2_request_h must be created first.");
@@ -363,6 +398,9 @@ OAUTH2_API int
 oauth2_request_add_custom_data(oauth2_request_h handle, const char *key,
        const char *value)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        if (!key || !value) {
                OAUTH2_LOG_E("key and value must not be null");
                return OAUTH2_ERROR_INVALID_PARAMETER;
@@ -372,10 +410,6 @@ oauth2_request_add_custom_data(oauth2_request_h handle, const char *key,
                "NULL handle");
 
        oauth2_request_s *req_impl = (oauth2_request_s *)handle;
-       if (!req_impl) {
-               OAUTH2_LOG_E("Null Input");
-               return OAUTH2_ERROR_INVALID_PARAMETER;
-       }
 
        if (!req_impl->request_data) {
                OAUTH2_LOG_E("oauth2_request_h must be created first.");
@@ -388,6 +422,9 @@ oauth2_request_add_custom_data(oauth2_request_h handle, const char *key,
 OAUTH2_API int
 oauth2_request_get_auth_end_point_url(oauth2_request_h handle, char **url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -406,6 +443,9 @@ oauth2_request_get_auth_end_point_url(oauth2_request_h handle, char **url)
 OAUTH2_API int
 oauth2_request_get_token_end_point_url(oauth2_request_h handle, char **url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -424,6 +464,9 @@ oauth2_request_get_token_end_point_url(oauth2_request_h handle, char **url)
 OAUTH2_API int
 oauth2_request_get_redirection_url(oauth2_request_h handle, char **url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -442,6 +485,9 @@ oauth2_request_get_redirection_url(oauth2_request_h handle, char **url)
 OAUTH2_API int
 oauth2_request_get_refresh_token_url(oauth2_request_h handle, char **url)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -461,6 +507,9 @@ OAUTH2_API
 int oauth2_request_get_refresh_token(oauth2_request_h handle,
        char **refresh_token)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -480,6 +529,9 @@ OAUTH2_API int
 oauth2_request_get_response_type(oauth2_request_h handle,
        oauth2_response_type_e *response_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -519,6 +571,9 @@ oauth2_request_get_response_type(oauth2_request_h handle,
 OAUTH2_API int
 oauth2_request_get_client_id(oauth2_request_h handle, char **client_id)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -537,6 +592,9 @@ oauth2_request_get_client_id(oauth2_request_h handle, char **client_id)
 OAUTH2_API int
 oauth2_request_get_client_secret(oauth2_request_h handle, char **client_secret)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -555,6 +613,9 @@ oauth2_request_get_client_secret(oauth2_request_h handle, char **client_secret)
 OAUTH2_API int
 oauth2_request_get_scope(oauth2_request_h handle, char **scope)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -573,6 +634,9 @@ oauth2_request_get_scope(oauth2_request_h handle, char **scope)
 OAUTH2_API int
 oauth2_request_get_state(oauth2_request_h handle, char **state)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -592,6 +656,9 @@ OAUTH2_API int
 oauth2_request_get_grant_type(oauth2_request_h handle,
        oauth2_grant_type_e *grant_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -631,6 +698,9 @@ oauth2_request_get_grant_type(oauth2_request_h handle,
 OAUTH2_API int
 oauth2_request_get_authorization_code(oauth2_request_h handle, char **code)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -649,6 +719,9 @@ oauth2_request_get_authorization_code(oauth2_request_h handle, char **code)
 OAUTH2_API int
 oauth2_request_get_user_name(oauth2_request_h handle, char **user_name)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -667,6 +740,9 @@ oauth2_request_get_user_name(oauth2_request_h handle, char **user_name)
 OAUTH2_API int
 oauth2_request_get_password(oauth2_request_h handle, char **password)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
 
@@ -686,6 +762,9 @@ OAUTH2_API int
 oauth2_request_get_custom_data(oauth2_request_h handle, const char *custom_key,
        char **custom_value)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        oauth2_request_s *request_data_temp = (oauth2_request_s *)handle;
index a8260b2ee4ec78d434940bdf67ab1370cb020680..dc029c9c768b25ed6675be11c3969c86ba2ed273 100755 (executable)
@@ -38,6 +38,9 @@ _oauth2_response_create(oauth2_response_s **response)
 OAUTH2_API int
 oauth2_response_destroy(oauth2_response_h handle)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER, "NULL handle");
        /*LCOV_EXCL_START*/
        oauth2_response_s *response_temp = (oauth2_response_s *)handle;
@@ -60,6 +63,9 @@ oauth2_response_destroy(oauth2_response_h handle)
 OAUTH2_API int
 oauth2_response_get_authorization_code(oauth2_response_h handle, char **code)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -84,6 +90,9 @@ oauth2_response_get_authorization_code(oauth2_response_h handle, char **code)
 OAUTH2_API int
 oauth2_response_get_state(oauth2_response_h handle, char **state)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -108,6 +117,9 @@ oauth2_response_get_state(oauth2_response_h handle, char **state)
 OAUTH2_API int
 oauth2_response_get_access_token(oauth2_response_h handle, char **access_token)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -132,6 +144,9 @@ oauth2_response_get_access_token(oauth2_response_h handle, char **access_token)
 OAUTH2_API int
 oauth2_response_get_token_type(oauth2_response_h handle, char **token_type)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -157,6 +172,9 @@ OAUTH2_API int
 oauth2_response_get_expires_in(oauth2_response_h handle,
        long long int *expires_in)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -202,6 +220,9 @@ OAUTH2_API int
 oauth2_response_get_refresh_token(oauth2_response_h handle,
        char **refresh_token)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -226,6 +247,9 @@ oauth2_response_get_refresh_token(oauth2_response_h handle,
 OAUTH2_API int
 oauth2_response_get_scope(oauth2_response_h handle, char **scope)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -251,6 +275,9 @@ oauth2_response_get_scope(oauth2_response_h handle, char **scope)
 OAUTH2_API int
 oauth2_response_get_error(oauth2_response_h handle, oauth2_error_h *error)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER,
                "NULL handle");
        /*LCOV_EXCL_START*/
@@ -269,6 +296,9 @@ OAUTH2_API int
 oauth2_response_get_custom_data(oauth2_response_h handle,
        const char *custom_key, char **custom_value)
 {
+       OAUTH2_RETURN_VAL(__is_feature_supported(), {}, OAUTH2_ERROR_NOT_SUPPORTED,
+               "oauth2 feature not supported");
+
        OAUTH2_RETURN_VAL(handle, {}, OAUTH2_ERROR_INVALID_PARAMETER, "NULL handle");
        /*LCOV_EXCL_START*/
        oauth2_response_s *response_data_temp = (oauth2_response_s *)handle;