[librest/wip/baedert/tests: 21/27] oauth2-proxy: Add gtkdoc annotations and predoncition checks



commit b9dc0b383e2c4ce0324df5bb7851ff8dfb1d231e
Author: Timm Bäder <mail baedert org>
Date:   Tue Feb 21 17:37:47 2017 +0100

    oauth2-proxy: Add gtkdoc annotations and predoncition checks

 rest/oauth2-proxy.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/rest/oauth2-proxy.c b/rest/oauth2-proxy.c
index 10ae8bb..975f10b 100644
--- a/rest/oauth2-proxy.c
+++ b/rest/oauth2-proxy.c
@@ -330,7 +330,9 @@ char *
 oauth2_proxy_build_login_url (OAuth2Proxy *proxy,
                               const char* redirect_uri)
 {
-    return oauth2_proxy_build_login_url_full (proxy, redirect_uri, NULL);
+  g_return_val_if_fail (OAUTH2_IS_PROXY (proxy), NULL);
+
+  return oauth2_proxy_build_login_url_full (proxy, redirect_uri, NULL);
 }
 
 /**
@@ -339,12 +341,15 @@ oauth2_proxy_build_login_url (OAuth2Proxy *proxy,
  *
  * Get the current request or access token.
  *
- * Returns: (nullable): the token, or %NULL if there is no token yet.  This string is owned
- * by #OAuth2Proxy and should not be freed.
+ * Returns: (nullable): the token, or
+ *   %NULL if there is no token yet.  This string is owned
+ *   by #OAuth2Proxy and should not be freed.
  */
 const char *
 oauth2_proxy_get_access_token (OAuth2Proxy *proxy)
 {
+  g_return_val_if_fail (OAUTH2_IS_PROXY (proxy), NULL);
+
   return proxy->priv->access_token;
 }
 
@@ -359,6 +364,7 @@ void
 oauth2_proxy_set_access_token (OAuth2Proxy *proxy, const char *access_token)
 {
   g_return_if_fail (OAUTH2_IS_PROXY (proxy));
+  g_return_if_fail (access_token != NULL);
 
   g_free (proxy->priv->access_token);
   proxy->priv->access_token = g_strdup (access_token);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]