]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/oauth1/oauth1.factor
assocs.extras: Move some often-used words to core
[factor.git] / basis / oauth1 / oauth1.factor
index 497d7f2e314b85566a58ba68b0d11da2cff5f72b..195dbd7cc027a00c8c5d55b460c601fab6273869 100644 (file)
@@ -60,21 +60,22 @@ nonce ;
         ] bi
     ] H{ } make ; inline
 
-! Checksum all the params but only return the oauth_ params for use in the auth header.
+! Checksum all the params but only return the oauth_ params for
+! use in the auth header.
 ! See https://github.com/factor/factor/issues/2487
 :: sign-params ( url request-method consumer-token request-token params -- oauth-params )
     params sort-keys :> params
     url request-method params signature-base-string :> sbs
-    consumer-token secret>> request-token dup [ secret>> ] when hmac-key :> key
+    consumer-token secret>> request-token dup [ secret>> ] when
+    hmac-key :> key
     sbs key sha1 hmac-bytes >base64 >string :> signature
     params { "oauth_signature" signature } prefix
-    [ drop "oauth_" head? ] assoc-filter ;
+    [ "oauth_" head? ] filter-keys ;
 
 : extract-user-data ( assoc -- assoc' )
     [
-        drop
         { "oauth_token" "oauth_token_secret" } member? not
-    ] assoc-filter ;
+    ] filter-keys ;
 
 : parse-token ( response data -- token )
     nip