diff options
author | Timm Bäder <mail@baedert.org> | 2017-02-21 17:37:47 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-02-21 17:39:03 +0100 |
commit | b9dc0b383e2c4ce0324df5bb7851ff8dfb1d231e (patch) | |
tree | 702ca83eee9c758a6d745fb7701ef39e2fe06184 | |
parent | ab261f44dda5434c39264a7c3ec3608608899ad6 (diff) | |
download | librest-b9dc0b383e2c4ce0324df5bb7851ff8dfb1d231e.tar.gz |
oauth2-proxy: Add gtkdoc annotations and predoncition checks
-rw-r--r-- | 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); |