;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require sx sx-request sx-cache] 2) (defconst sx-auth-root "https://stackexchange.com/oauth/dialog") (defconst sx-auth-redirect-uri "http://seanallred.com/sx.el/auth/auth.htm") (defconst sx-auth-client-id "3291") #@217 Your access token. This is needed to use your account to write questions, make comments, and read your inbox. Do not alter this unless you know what you are doing! This variable is set with `sx-auth-authenticate'. (defvar sx-auth-access-token nil (#$ . 354)) #@218 List of methods that require auth. Methods are of the form (METHOD . SUBMETHODS) where SUBMETHODS is (METHOD METHOD METHOD ...). If all SUBMETHODS require auth or there are no submethods, form will be (METHOD . t) (defconst sx-auth-method-auth '((me . t) (inbox . t) (notifications . t) (events . t) (posts (comments add)) (comments delete edit flags upvote) (answers accept delete downvote edit flags upvote) (questions answers add close delete downvote edit favorite flags render upvote (unanswered my-tags))) (#$ . 622)) #@120 List of filter types that require auth. Keywords are of the form (OBJECT TYPES) where TYPES is (FILTER FILTER FILTER). (defconst sx-auth-filter-auth '(question\.upvoted question\.downvoted answer\.upvoted answer\.downvoted comment\.upvoted) (#$ . 1156)) #@773 Authenticate this application. Authentication is required to read your personal data (such as notifications) and to write with the API (asking and answering questions). When this function is called, `browse-url' is used to send the user to an authorization page managed by StackExchange. The following privileges are requested: * read_inbox use SX to manage and visit items in your inbox * write_acesss write comments, ask questions, and post answers on your behalf * no_expiry do not pester you to reauthorize again After authorization with StackExchange, the user is then redirected to a website managed by SX. The access token required to use authenticated methods is included in the hash (which is parsed and displayed prominently on the page). (defalias 'sx-authenticate #[0 "\304\305\306 B\307\310\311\n!BE\312\"Q\313!\210\314\315!\262\211\316\230\203&\317\320\321!\207\322\323\324 BC\"\207" [sx-auth-root sx-auth-client-id sx-auth-redirect-uri sx-auth-access-token "?" sx-request--build-keyword-arguments client_id (scope read_inbox no_expiry private_info write_access) redirect_uri url-hexify-string "," browse-url read-string "Enter the access token displayed on the webpage: " "" nil error "You must enter this code to use this client fully" sx-cache-set auth access_token] 9 (#$ . 1417) nil]) #@155 Check if METHOD is one that may require authentication. If it has `auth-required' SUBMETHODs, or no submethod, return t. (fn METHOD &optional SUBMETHOD) (defalias 'sx-auth--method-p #[513 "\301\"A<\205\f@\302\303\304\305$\210\205&\306=\206&\211\235\206&\235\207" [sx-auth-method-auth assoc lwarn " sx-auth method" :debug "Method %s requires auth" t] 9 (#$ . 2757)]) #@168 Check if FILTER contains properties that require authentication. If it has `auth-required' properties, return a filter that has removed those properties. (fn FILTER) (defalias 'sx-auth--filter-p #[257 "\211<\205\211@\211\205 A\300\301\302\303\206\"\"\301\211\304\305\306\307 $\210\2036\310\311\312\"\2063\"\262\203F\203FB\262\202I\262\304\313\306\314%\210\207" [remove nil mapcar #[257 "\211\235@\207" [sx-auth-filter-auth] 3 "\n\n(fn PROP)"] lwarn "sx-auth filter" :debug "Filter: %S" cl-remove-if make-closure #[257 "\211\300\235\207" [V0] 3 "\n\n(fn PROP)"] "sx-auth filter2" "Filter property %s requires auth. %S"] 12 (#$ . 3145)]) (provide 'sx-auth)