[Pkg-cli-apps-commits] [SCM] Tomboy - desktop note taking program using Wiki style links branch, master, updated. debian/1.0.0-1-6-gec42510
Iain Lane
laney at ubuntu.com
Wed Oct 7 15:29:18 UTC 2009
The following commit has been merged in the master branch:
commit ec425100c6b8ab5a7913f7daf12b8a736b8e1f20
Author: Iain Lane <laney at ubuntu.com>
Date: Wed Oct 7 16:02:57 2009 +0100
debian/patches/02_support_oauth_1.0a.patch: Add upstream/Ubuntu patch to support new OAuth protocol required by some services such as U1.
diff --git a/debian/changelog b/debian/changelog
index 580df8f..deaa5aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ tomboy (1.0.0-2) UNRELEASED; urgency=low
[ Iain Lane ]
* debian/rules: Update the translation template after the build, doesn't
affect Debian but is required for Ubuntu. Reduces the delta.
+ * debian/patches/02_support_oauth_1.0a.patch: Add upstream/Ubuntu patch to
+ support new OAuth protocol required by some services such as U1.
[ Stefan Ebner ]
* debian/rules:
@@ -12,7 +14,7 @@ tomboy (1.0.0-2) UNRELEASED; urgency=low
* Added debian/dirs
* debian/watch: Bump version to 3
- -- Stefan Ebner <sebner at ubuntu.com> Fri, 02 Oct 2009 23:24:57 +0200
+ -- Iain Lane <laney at ubuntu.com> Wed, 07 Oct 2009 16:01:38 +0100
tomboy (1.0.0-1) unstable; urgency=low
diff --git a/debian/patches/01_dllmaps.patch b/debian/patches/01_dllmaps.patch
index 3992041..8db26ff 100644
--- a/debian/patches/01_dllmaps.patch
+++ b/debian/patches/01_dllmaps.patch
@@ -1,5 +1,7 @@
---- git.orig/Tomboy/Tomboy.exe.config.in
-+++ git/Tomboy/Tomboy.exe.config.in
+Index: tomboy.git/Tomboy/Tomboy.exe.config.in
+===================================================================
+--- tomboy.git.orig/Tomboy/Tomboy.exe.config.in 2009-04-27 18:29:09.000000000 +0100
++++ tomboy.git/Tomboy/Tomboy.exe.config.in 2009-10-07 16:00:35.894147250 +0100
@@ -2,6 +2,6 @@
<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
diff --git a/debian/patches/02_support_oauth_1.0a.patch b/debian/patches/02_support_oauth_1.0a.patch
new file mode 100644
index 0000000..12aab5c
--- /dev/null
+++ b/debian/patches/02_support_oauth_1.0a.patch
@@ -0,0 +1,149 @@
+Index: tomboy.git/Tomboy/Addins/WebSyncService/Api/OAuth.cs
+===================================================================
+--- tomboy.git.orig/Tomboy/Addins/WebSyncService/Api/OAuth.cs 2009-09-24 13:58:41.469760425 +0100
++++ tomboy.git/Tomboy/Addins/WebSyncService/Api/OAuth.cs 2009-10-07 16:00:52.064108681 +0100
+@@ -45,7 +45,7 @@
+ #region Constructor
+ public OAuth ()
+ {
+- Debugging = false;
++ Debugging = true;
+ }
+ #endregion
+
+@@ -192,8 +192,11 @@
+ var outUrl = string.Empty;
+ List<IQueryParameter<string>> parameters = null;
+
++ string callbackUrl = string.Empty;
++ if (url.StartsWith (RequestTokenBaseUrl) || url.StartsWith (AccessTokenBaseUrl))
++ callbackUrl = CallbackUrl;
+ var sig = GenerateSignature (uri, ConsumerKey, ConsumerSecret, Token, TokenSecret, Verifier, method,
+- timeStamp, nonce, out outUrl, out parameters);
++ timeStamp, nonce, callbackUrl, out outUrl, out parameters);
+
+ if (Debugging)
+ Logger.Debug ("Generated signature {0}", sig);
+Index: tomboy.git/Tomboy/Addins/WebSyncService/OAuth/Base.cs
+===================================================================
+--- tomboy.git.orig/Tomboy/Addins/WebSyncService/OAuth/Base.cs 2009-09-24 13:58:41.469760425 +0100
++++ tomboy.git/Tomboy/Addins/WebSyncService/OAuth/Base.cs 2009-10-07 16:00:52.084146564 +0100
+@@ -159,7 +159,8 @@
+ /// <param name="signatureType">The signature type. To use the default values use <see cref="SignatureType">SignatureType</see>.</param>
+ /// <returns>The signature base.</returns>
+ private string GenerateSignatureBase (Uri url, string consumerKey, string token, string tokenSecret, string verifier,
+- RequestMethod method, TimeSpan timeStamp, string nonce, SignatureType signatureType, out string normalizedUrl,
++ RequestMethod method, TimeSpan timeStamp, string nonce, SignatureType signatureType, string callbackUrl,
++ out string normalizedUrl,
+ out List<IQueryParameter<string>> parameters)
+ {
+ log.LogDebug ("Generating signature base for OAuth request.");
+@@ -196,6 +197,7 @@
+
+ if (!string.IsNullOrEmpty (token)) parameters.Add (new QueryParameter<string> (OAuthTokenKey, token, s => string.IsNullOrEmpty (s)));
+ if (!string.IsNullOrEmpty (verifier)) parameters.Add (new QueryParameter<string> (OAuthVerifierKey, verifier, s => string.IsNullOrEmpty (s)));
++ if (!string.IsNullOrEmpty (callbackUrl)) parameters.Add (new QueryParameter<string> (OAuthCallbackKey, UrlEncode (callbackUrl), s => string.IsNullOrEmpty (s)));
+
+ log.LogDebug ("Normalizing URL for signature.");
+
+@@ -251,12 +253,13 @@
+ /// <param name="httpMethod">The HTTP method used. Must be valid HTTP method verb (POST, GET, PUT, etc).</param>
+ /// <returns>A Base64 string of the hash value.</returns>
+ protected string GenerateSignature (Uri url, string consumerKey, string consumerSecret, string token,
+- string tokenSecret, string verifier, RequestMethod method, TimeSpan timeStamp, string nonce, out string normalizedUrl,
+- out List<IQueryParameter<string>> parameters)
++ string tokenSecret, string verifier, RequestMethod method, TimeSpan timeStamp, string nonce,
++ string callbackUrl, out string normalizedUrl,
++ out List<IQueryParameter<string>> parameters)
+ {
+ log.LogDebug ("Generating signature using HMAC-SHA1 algorithm.");
+ return GenerateSignature (url, consumerKey, consumerSecret, token, tokenSecret, verifier, method, timeStamp, nonce,
+- SignatureType.HMACSHA1, out normalizedUrl, out parameters);
++ SignatureType.HMACSHA1, callbackUrl, out normalizedUrl, out parameters);
+ }
+
+ /// <summary>
+@@ -272,8 +275,8 @@
+ /// <param name="signatureType">The type of signature to use.</param>
+ /// <returns>A Base64 string of the hash value.</returns>
+ private string GenerateSignature (Uri url, string consumerKey, string consumerSecret, string token,
+- string tokenSecret, string verifier, RequestMethod method, TimeSpan timeStamp, string nonce, SignatureType signatureType,
+- out string normalizedUrl, out List<IQueryParameter<string>> parameters)
++ string tokenSecret, string verifier, RequestMethod method, TimeSpan timeStamp, string nonce, SignatureType signatureType,
++ string callbackUrl, out string normalizedUrl, out List<IQueryParameter<string>> parameters)
+ {
+ log.LogDebug ("Generating signature using signature type {0}", signatureType);
+
+@@ -288,7 +291,8 @@
+ return signature;
+ case SignatureType.HMACSHA1:
+ string signatureBase = GenerateSignatureBase (url, consumerKey, token, tokenSecret, verifier, method,
+- timeStamp, nonce, SignatureType.HMACSHA1, out normalizedUrl, out parameters);
++ timeStamp, nonce, SignatureType.HMACSHA1, callbackUrl,
++ out normalizedUrl, out parameters);
+
+ var hmacsha1 = new HMACSHA1 ();
+ hmacsha1.Key = Encoding.ASCII.GetBytes (string.Format ("{0}&{1}",
+Index: tomboy.git/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs
+===================================================================
+--- tomboy.git.orig/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs 2009-09-24 13:58:41.469760425 +0100
++++ tomboy.git/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs 2009-10-07 16:00:52.114107121 +0100
+@@ -107,25 +107,24 @@
+ }
+
+ // TODO: Move this
+- if (Auth == null) {
+- string rootUri = Server + "/api/1.0";
+- try {
+- RootInfo root = RootInfo.GetRoot (rootUri, new Api.AnonymousConnection ());
+-
+- Auth = new Api.OAuth ();
++ if (Auth == null)
++ Auth = new Api.OAuth ();
+
+- Auth.AuthorizeLocation = root.AuthorizeUrl;
+- Auth.AccessTokenBaseUrl = root.AccessTokenUrl;
+- Auth.RequestTokenBaseUrl = root.RequestTokenUrl;
+- Auth.ConsumerKey = "anyone";
+- Auth.ConsumerSecret = "anyone";
+- Auth.Realm = "Snowy";
+- } catch (Exception e) {
+- Logger.Error ("Failed to get Root resource " + rootUri + ". Exception was: " + e.ToString());
+- authButton.Label = Catalog.GetString ("Server not responding. Try again later.");
+- oauth = null;
+- return;
+- }
++ string rootUri = Server + "/api/1.0";
++ try {
++ RootInfo root = RootInfo.GetRoot (rootUri, new Api.AnonymousConnection ());
++
++ Auth.AuthorizeLocation = root.AuthorizeUrl;
++ Auth.AccessTokenBaseUrl = root.AccessTokenUrl;
++ Auth.RequestTokenBaseUrl = root.RequestTokenUrl;
++ Auth.ConsumerKey = "anyone";
++ Auth.ConsumerSecret = "anyone";
++ Auth.Realm = "Snowy";
++ } catch (Exception e) {
++ Logger.Error ("Failed to get Root resource " + rootUri + ". Exception was: " + e.ToString());
++ authButton.Label = Catalog.GetString ("Server not responding. Try again later.");
++ oauth = null;
++ return;
+ }
+
+ if (!Auth.IsAccessToken) {
+@@ -159,6 +158,7 @@
+ return;
+ }
+
++ Logger.Debug ("Listening on {0} for OAuth callback", callbackUrl);
+ string authUrl = string.Empty;
+ try {
+ authUrl = Auth.GetAuthorizationUrl ();
+@@ -223,7 +223,6 @@
+ }
+ }, null);
+
+- Logger.Debug ("Listening on {0} for OAuth callback", callbackUrl);
+ Logger.Debug ("Launching browser to authorize web sync: " + authUrl);
+ authButton.Label = Catalog.GetString ("Authorizing in browser (Press to reset connection)");
+ try {
diff --git a/debian/patches/series b/debian/patches/series
index b0814fc..4a09063 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01_dllmaps.patch
+02_support_oauth_1.0a.patch
--
Tomboy - desktop note taking program using Wiki style links
More information about the Pkg-cli-apps-commits
mailing list