Changeset 3b878a1 for lib/oauth.h


Ignore:
Timestamp:
2010-05-02T21:20:09Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6824fb3
Parents:
839189b (diff), f4b0911 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

OAuth sanity fix: Twitter-specific stuff should *not* be in lib/oauth.c.
Somewhat intrusive, should've done this right immediately. :-/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth.h

    r839189b r3b878a1  
    4040{
    4141        oauth_stage_t stage;
     42        const 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( const 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. */
    7486void oauth_info_free( struct oauth_info *info );
     87
     88/* Convert to and back from strings, for easier saving. */
     89char *oauth_to_string( struct oauth_info *oi );
     90struct oauth_info *oauth_from_string( char *in, const struct oauth_service *sp );
Note: See TracChangeset for help on using the changeset viewer.