1bb9dafe39
FossilOrigin-Name: f1def5fc963f9b5be6fdc11b12615815662405568b3ff991317983ad1a747523
64 lines
1.4 KiB
C
64 lines
1.4 KiB
C
/*
|
|
* Licensed under BSD 2-Clause License
|
|
*/
|
|
|
|
#ifndef MASTODONT_APPLICATION
|
|
#define MASTODONT_APPLICATION
|
|
#include "mastodont_types.h"
|
|
#include "mastodont_fetch.h"
|
|
#include <cjson/cJSON.h>
|
|
|
|
struct mstdnt_app
|
|
{
|
|
char* id;
|
|
char* name;
|
|
char* website;
|
|
char* redirect_uri;
|
|
char* client_id;
|
|
char* client_secret;
|
|
char* vapid_key;
|
|
};
|
|
|
|
struct mstdnt_oauth_token
|
|
{
|
|
char* access_token;
|
|
char* token_type;
|
|
char* scope;
|
|
char* id;
|
|
char* me;
|
|
time_t time;
|
|
};
|
|
|
|
struct mstdnt_application_args
|
|
{
|
|
char* grant_type;
|
|
char* client_id;
|
|
char* client_secret;
|
|
char* redirect_uri;
|
|
char* scope;
|
|
char* code;
|
|
char* username;
|
|
char* password;
|
|
char* client_name;
|
|
char* redirect_uris;
|
|
char* scopes;
|
|
char* website;
|
|
};
|
|
|
|
int
|
|
mstdnt_register_app(mastodont_t* data,
|
|
struct mstdnt_args* m_args,
|
|
mstdnt_request_cb_t cb_request,
|
|
void* cb_args,
|
|
struct mstdnt_application_args args);
|
|
|
|
int
|
|
mstdnt_obtain_oauth_token(mastodont_t* data,
|
|
struct mstdnt_args* m_args,
|
|
mstdnt_request_cb_t cb_request,
|
|
void* cb_args,
|
|
struct mstdnt_application_args args);
|
|
|
|
void _mstdnt_val_malloc_application_call(cJSON* v, void* _type);
|
|
|
|
#endif /* MASTODONT_ACCOUNT */
|