Changeset c2ecadc for lib/oauth.h


Ignore:
Timestamp:
2010-05-01T13:53:59Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f4b0911
Parents:
85ef57f
Message:

Cleaned up OAuth stuff: consumer key/secret should *not* be in lib/oauth.c.
Keep it in the Twitter module, and use the oauth_info struct through the
whole session to keep all this together.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth.h

    r85ef57f rc2ecadc  
    4040{
    4141        oauth_stage_t stage;
     42        struct oauth_service *sp;
    4243       
    4344        oauth_cb func;
     
    4647        struct http_request *http;
    4748       
    48         char *auth_params;
     49        char *auth_url;
    4950        char *request_token;
    5051       
    51         char *access_token;
     52        char *token;
     53        char *token_secret;
     54};
     55
     56struct oauth_service
     57{
     58        char *url_request_token;
     59        char *url_access_token;
     60        char *url_authorize;
     61       
     62        char *consumer_key;
     63        char *consumer_secret;
    5264};
    5365
     
    5668   authorization URL for the user. This is passed to the callback function
    5769   in a struct oauth_info. */
    58 struct oauth_info *oauth_request_token( const char *url, oauth_cb func, void *data );
     70struct oauth_info *oauth_request_token( struct oauth_service *sp, oauth_cb func, void *data );
    5971
    6072/* http://oauth.net/core/1.0a/#auth_step3 (section 6.3)
     
    6274   token. This is passed to the callback function in the same
    6375   struct oauth_info. */
    64 void oauth_access_token( const char *url, const char *pin, struct oauth_info *st );
     76gboolean oauth_access_token( const char *pin, struct oauth_info *st );
    6577
    6678/* http://oauth.net/core/1.0a/#anchor12 (section 7)
     
    6981   whatever's going to be in the POST body of the request. GET args will
    7082   automatically be grabbed from url. */
    71 char *oauth_http_header( char *access_token, const char *method, const char *url, char *args );
     83char *oauth_http_header( struct oauth_info *oi, const char *method, const char *url, char *args );
    7284
    7385/* Shouldn't normally be required unless the process is aborted by the user. */
Note: See TracChangeset for help on using the changeset viewer.