REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / reclaim / oidc_helper.h
index 7a0f45bf9bf5a6406a5c9c7e1824554515f72dfc..6fe1721d38d022c894a2cfc86f2c5a58f807b464 100644 (file)
       WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Affero General Public License for more details.
-     
+
       You should have received a copy of the GNU Affero General Public License
       along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
  */
 
 /**
@@ -34,7 +36,7 @@
 
 #define JWT_TYP_VALUE "jwt"
 
-#define SERVER_ADDRESS "https://reclaim.id"
+#define SERVER_ADDRESS "https://api.reclaim"
 
 /**
  * Create a JWT from attributes
@@ -60,12 +62,14 @@ OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
  *
  * @param issuer the issuer of the ticket, used to sign the ticket and nonce
  * @param ticket the ticket to include in the code
+ * @param attrs list of attributes to share
  * @param nonce the nonce to include in the code
  * @return a new authorization code (caller must free)
  */
 char*
 OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
                        const struct GNUNET_RECLAIM_Ticket *ticket,
+                       struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
                        const char* nonce);
 
 /**
@@ -73,16 +77,18 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
  * authorization code.
  * This also verifies the signature in the code.
  *
- * @param audience the expected audience of the code
+ * @param ecdsa_priv the audience of the ticket
  * @param code the string representation of the code
  * @param ticket where to store the ticket
+ * @param attrs the attributes found in the code
  * @param nonce where to store the nonce
  * @return GNUNET_OK if successful, else GNUNET_SYSERR
  */
 int
-OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
+OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv,
                        const char* code,
-                       struct GNUNET_RECLAIM_Ticket **ticket,
+                       struct GNUNET_RECLAIM_Ticket *ticket,
+                       struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList **attrs,
                        char **nonce);
 
 /**