summaryrefslogtreecommitdiff
path: root/src/reclaim/oidc_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/oidc_helper.h')
-rw-r--r--src/reclaim/oidc_helper.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h
index 2c533357e..e713dab62 100644
--- a/src/reclaim/oidc_helper.h
+++ b/src/reclaim/oidc_helper.h
@@ -49,7 +49,7 @@
* @return a new base64-encoded JWT string.
*/
char*
-OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
+OIDC_generate_id_token (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
struct GNUNET_RECLAIM_AttributeList *attrs,
struct GNUNET_RECLAIM_AttestationList *attests,
@@ -90,7 +90,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
* @return GNUNET_OK if successful, else GNUNET_SYSERR
*/
int
-OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv,
+OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *ecdsa_pub,
const char *code,
const char *code_verifier,
struct GNUNET_RECLAIM_Ticket *ticket,
@@ -117,7 +117,40 @@ OIDC_build_token_response (const char *access_token,
* Generate a new access token
*/
char*
-OIDC_access_token_new ();
+OIDC_access_token_new (const struct GNUNET_RECLAIM_Ticket *ticket);
+/**
+ * Parse an access token
+ */
+int
+OIDC_access_token_parse (const char* token,
+ struct GNUNET_RECLAIM_Ticket **ticket);
+
+
+/**
+ * Checks if a claim is implicitly requested through standard
+ * scope(s)
+ *
+ * @param scopes the scopes which have been requested
+ * @param attr the attribute name to check
+ * @return GNUNET_YES if attribute is implcitly requested
+ */
+enum GNUNET_GenericReturnValue
+OIDC_check_scopes_for_claim_request (const char*scopes,
+ const char*attr);
+
+
+/**
+ * Generate userinfo JSON as string
+ *
+ * @param sub_key the subject (user)
+ * @param attrs user attribute list
+ * @param attests user attribute attestation list (may be empty)
+ * @return Userinfo JSON
+ */
+char *
+OIDC_generate_userinfo (const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
+ struct GNUNET_RECLAIM_AttributeList *attrs,
+ struct GNUNET_RECLAIM_AttestationList *attests);
#endif