Merge lp:~mandel/ubuntuone-windows-installer/add_ubuntu_sso_service_skeleton into lp:ubuntuone-windows-installer/beta

Proposed by Manuel de la Peña
Status: Merged
Approved by: John Lenton
Approved revision: 58
Merged at revision: 82
Proposed branch: lp:~mandel/ubuntuone-windows-installer/add_ubuntu_sso_service_skeleton
Merge into: lp:ubuntuone-windows-installer/beta
Prerequisite: lp:~mandel/ubuntuone-windows-installer/fix_xml_comments
Diff against target: 751 lines (+653/-2)
14 files modified
.bzrignore (+2/-0)
src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj (+67/-0)
src/Canonical.Ubuntu.SSO/CredentialsDeniedEventArgs.cs (+52/-0)
src/Canonical.Ubuntu.SSO/CredentialsErrorEventArgs.cs (+75/-0)
src/Canonical.Ubuntu.SSO/CredentialsFoundEventArgs.cs (+65/-0)
src/Canonical.Ubuntu.SSO/IKeyring.cs (+59/-0)
src/Canonical.Ubuntu.SSO/ILoginOrRegisterView.cs (+29/-0)
src/Canonical.Ubuntu.SSO/ILoginView.cs (+50/-0)
src/Canonical.Ubuntu.SSO/ISSOCredentialsProvider.cs (+78/-0)
src/Canonical.Ubuntu.SSO/LoginCredentialsEventArgs.cs (+58/-0)
src/Canonical.Ubuntu.SSO/Properties/AssemblyInfo.cs (+36/-0)
src/Canonical.Ubuntu.SSO/SSOCredentialsProvider.cs (+68/-0)
src/UbuntuOne.sln (+12/-0)
src/UbuntuOneClient/Program.cs (+2/-2)
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/add_ubuntu_sso_service_skeleton
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Rick McBride (community) Approve
Review via email: mp+34850@code.launchpad.net

Description of the change

Provides the initial skeleton of the Ubuntu SSO on windows.

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) wrote :

Only one minor problem and this should be fine.

In several places you have "Ubuntu One" as "UbuntuOne" without the space. This needs to be fixed.

Once that is done I'll approve this.

review: Needs Fixing
58. By Manuel de la Peña

Standarize the name used for the project in the licenses to 'Ubuntu One'

Revision history for this message
Rick McBride (rmcbride) :
review: Approve
Revision history for this message
John Lenton (chipaca) wrote :

oops, I've used up all my witty review comments already.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-08-29 21:02:29 +0000
3+++ .bzrignore 2010-09-09 09:58:06 +0000
4@@ -6,6 +6,8 @@
5 src/UbuntuOne.sln.cache
6 src/UbuntuOne.suo
7 src/_ReSharper.UbuntuOne
8+src/Canonical.Ubuntu.SSO/bin
9+src/Canonical.Ubuntu.SSO/obj
10 src/Canonical.UbuntuOne.Client/bin
11 src/Canonical.UbuntuOne.Client/obj
12 src/Canonical.UbuntuOne.Client.Test/obj
13
14=== added directory 'src/Canonical.Ubuntu.SSO'
15=== added file 'src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj'
16--- src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj 1970-01-01 00:00:00 +0000
17+++ src/Canonical.Ubuntu.SSO/Canonical.Ubuntu.SSO.csproj 2010-09-09 09:58:06 +0000
18@@ -0,0 +1,67 @@
19+<?xml version="1.0" encoding="utf-8"?>
20+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
21+ <PropertyGroup>
22+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
23+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
24+ <ProductVersion>9.0.21022</ProductVersion>
25+ <SchemaVersion>2.0</SchemaVersion>
26+ <ProjectGuid>{9460A771-2589-45DA-9618-9FE8BB7D16E8}</ProjectGuid>
27+ <OutputType>Library</OutputType>
28+ <AppDesignerFolder>Properties</AppDesignerFolder>
29+ <RootNamespace>Canonical.Ubuntu.SSO</RootNamespace>
30+ <AssemblyName>Canonical.Ubuntu.SSO</AssemblyName>
31+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
32+ <FileAlignment>512</FileAlignment>
33+ </PropertyGroup>
34+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
35+ <DebugSymbols>true</DebugSymbols>
36+ <DebugType>full</DebugType>
37+ <Optimize>false</Optimize>
38+ <OutputPath>bin\Debug\</OutputPath>
39+ <DefineConstants>DEBUG;TRACE</DefineConstants>
40+ <ErrorReport>prompt</ErrorReport>
41+ <WarningLevel>4</WarningLevel>
42+ </PropertyGroup>
43+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
44+ <DebugType>pdbonly</DebugType>
45+ <Optimize>true</Optimize>
46+ <OutputPath>bin\Release\</OutputPath>
47+ <DefineConstants>TRACE</DefineConstants>
48+ <ErrorReport>prompt</ErrorReport>
49+ <WarningLevel>4</WarningLevel>
50+ </PropertyGroup>
51+ <ItemGroup>
52+ <Reference Include="System" />
53+ <Reference Include="System.Core">
54+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
55+ </Reference>
56+ <Reference Include="System.Xml.Linq">
57+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
58+ </Reference>
59+ <Reference Include="System.Data.DataSetExtensions">
60+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
61+ </Reference>
62+ <Reference Include="System.Data" />
63+ <Reference Include="System.Xml" />
64+ </ItemGroup>
65+ <ItemGroup>
66+ <Compile Include="CredentialsDeniedEventArgs.cs" />
67+ <Compile Include="CredentialsErrorEventArgs.cs" />
68+ <Compile Include="CredentialsFoundEventArgs.cs" />
69+ <Compile Include="ILoginOrRegisterView.cs" />
70+ <Compile Include="ILoginView.cs" />
71+ <Compile Include="LoginCredentialsEventArgs.cs" />
72+ <Compile Include="SSOCredentialsProvider.cs" />
73+ <Compile Include="IKeyring.cs" />
74+ <Compile Include="ISSOCredentialsProvider.cs" />
75+ <Compile Include="Properties\AssemblyInfo.cs" />
76+ </ItemGroup>
77+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
79+ Other similar extension points exist, see Microsoft.Common.targets.
80+ <Target Name="BeforeBuild">
81+ </Target>
82+ <Target Name="AfterBuild">
83+ </Target>
84+ -->
85+</Project>
86\ No newline at end of file
87
88=== added file 'src/Canonical.Ubuntu.SSO/CredentialsDeniedEventArgs.cs'
89--- src/Canonical.Ubuntu.SSO/CredentialsDeniedEventArgs.cs 1970-01-01 00:00:00 +0000
90+++ src/Canonical.Ubuntu.SSO/CredentialsDeniedEventArgs.cs 2010-09-09 09:58:06 +0000
91@@ -0,0 +1,52 @@
92+/*
93+ * Copyright 2010 Canonical Ltd.
94+ *
95+ * This file is part of Ubuntu One on Windows.
96+ *
97+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
98+ * it under the terms of the GNU Lesser General Public License version
99+ * as published by the Free Software Foundation.
100+ *
101+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
102+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
103+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
104+ * GNU Lesser General Public License for more details.
105+ *
106+ * You should have received a copy of the GNU Lesser General Public License
107+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
108+ *
109+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
110+ */
111+using System;
112+
113+namespace Canonical.Ubuntu.SSO
114+{
115+ /// <summary>
116+ /// Event args used to notify that the user denied the credentials to
117+ /// an application.
118+ /// </summary>
119+ public class CredentialsDeniedEventArgs : EventArgs
120+ {
121+ /// <summary>
122+ /// The name of the application whose credentials were denied.
123+ /// </summary>
124+ public string ApplicationName { get; set; }
125+
126+ /// <summary>
127+ /// Creates a new instance of the class with its data init to the basic values.
128+ /// </summary>
129+ public CredentialsDeniedEventArgs()
130+ : this (""){
131+
132+ }
133+
134+ /// <summary>
135+ /// Creates a new instance of the class with the passed data.
136+ /// </summary>
137+ /// <param name="applicationName">The name of the application whose credentials were denied.</param>
138+ public CredentialsDeniedEventArgs(string applicationName)
139+ {
140+ ApplicationName = applicationName;
141+ }
142+ }
143+}
144
145=== added file 'src/Canonical.Ubuntu.SSO/CredentialsErrorEventArgs.cs'
146--- src/Canonical.Ubuntu.SSO/CredentialsErrorEventArgs.cs 1970-01-01 00:00:00 +0000
147+++ src/Canonical.Ubuntu.SSO/CredentialsErrorEventArgs.cs 2010-09-09 09:58:06 +0000
148@@ -0,0 +1,75 @@
149+/*
150+ * Copyright 2010 Canonical Ltd.
151+ *
152+ * This file is part of Ubuntu One on Windows.
153+ *
154+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
155+ * it under the terms of the GNU Lesser General Public License version
156+ * as published by the Free Software Foundation.
157+ *
158+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
159+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
160+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
161+ * GNU Lesser General Public License for more details.
162+ *
163+ * You should have received a copy of the GNU Lesser General Public License
164+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
165+ *
166+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
167+ */
168+using System;
169+
170+namespace Canonical.Ubuntu.SSO
171+{
172+ /// <summary>
173+ /// Envent argument used to notify that there was an error when retrieving the credentials
174+ /// for an application.
175+ /// </summary>
176+ public class CredentialsErrorEventArgs : EventArgs
177+ {
178+ /// <summary>
179+ /// Gets and sets the name of the application that requested the credentials that
180+ /// got an error.
181+ /// </summary>
182+ public string ApplicationName { get; set; }
183+
184+ /// <summary>
185+ /// Gets and sets the message that can be shown to the user explaining the error.
186+ /// </summary>
187+ public string ErrorMessage { get; set; }
188+
189+ /// <summary>
190+ /// Gets and sets the stack trace with the details of the error.
191+ /// </summary>
192+ public string DetailedErrorMessage { get; set; }
193+
194+ /// <summary>
195+ /// Creates a new instance of the class with its data init to the base values.
196+ /// </summary>
197+ public CredentialsErrorEventArgs()
198+ : this("",""){
199+ }
200+
201+ /// <summary>
202+ /// Creates a new instance of the class with the passed data.
203+ /// </summary>
204+ /// <param name="applicationName">The name of the applications whose credentials were requested.</param>
205+ /// <param name="errorMessage">An error message that can be shown to the user.</param>
206+ public CredentialsErrorEventArgs(string applicationName, string errorMessage)
207+ : this(applicationName, errorMessage, ""){
208+ }
209+
210+ /// <summary>
211+ /// Creates a new instance of the calss with the passed data.
212+ /// </summary>
213+ /// <param name="appliactionName">The name of the applications whose credentials were requested.</param>
214+ /// <param name="errorMessage">An error message that can be shown to the user.</param>
215+ /// <param name="detailErrorMessage">A stack trace with the details of the error.</param>
216+ public CredentialsErrorEventArgs(string appliactionName, string errorMessage, string detailErrorMessage)
217+ {
218+ ApplicationName = appliactionName;
219+ ErrorMessage = errorMessage;
220+ DetailedErrorMessage = detailErrorMessage;
221+ }
222+ }
223+}
224
225=== added file 'src/Canonical.Ubuntu.SSO/CredentialsFoundEventArgs.cs'
226--- src/Canonical.Ubuntu.SSO/CredentialsFoundEventArgs.cs 1970-01-01 00:00:00 +0000
227+++ src/Canonical.Ubuntu.SSO/CredentialsFoundEventArgs.cs 2010-09-09 09:58:06 +0000
228@@ -0,0 +1,65 @@
229+/*
230+ * Copyright 2010 Canonical Ltd.
231+ *
232+ * This file is part of Ubuntu One on Windows.
233+ *
234+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
235+ * it under the terms of the GNU Lesser General Public License version
236+ * as published by the Free Software Foundation.
237+ *
238+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
239+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
240+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
241+ * GNU Lesser General Public License for more details.
242+ *
243+ * You should have received a copy of the GNU Lesser General Public License
244+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
245+ *
246+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
247+ */
248+using System;
249+using System.Collections.Generic;
250+
251+namespace Canonical.Ubuntu.SSO
252+{
253+ /// <summary>
254+ /// Event argsuments that are used to notify that the credentials of an
255+ /// application where correctly retrieved.
256+ /// </summary>
257+ public class CredentialsFoundEventArgs : EventArgs
258+ {
259+ /// <summary>
260+ /// Gets and sets the name of the application whose credentials were
261+ /// found.
262+ /// </summary>
263+ public string ApplicationName { get; set; }
264+
265+ /// <summary>
266+ /// Gets and set the dictionary that contains at least four keys with
267+ /// the token and consumer keys and secrets. The keys are named "consumer_key",
268+ /// "consumer_secret", "token" and "token_secret".
269+ /// </summary>
270+ public IDictionary<string, string> Credentials { get; set; }
271+
272+ /// <summary>
273+ /// Creates a new instance of the class with its data init to the
274+ /// basic values.
275+ /// </summary>
276+ public CredentialsFoundEventArgs()
277+ : this("", new Dictionary<string, string>()){
278+ }
279+
280+ /// <summary>
281+ /// Creates a new isntance of the class with the given data.
282+ /// </summary>
283+ /// <param name="applicationName">The name of the application whose credentials
284+ /// were found.</param>
285+ /// <param name="credentials">The credentials of the application.</param>
286+ public CredentialsFoundEventArgs(string applicationName,
287+ IDictionary<string, string> credentials)
288+ {
289+ ApplicationName = applicationName;
290+ Credentials = credentials;
291+ }
292+ }
293+}
294
295=== added file 'src/Canonical.Ubuntu.SSO/IKeyring.cs'
296--- src/Canonical.Ubuntu.SSO/IKeyring.cs 1970-01-01 00:00:00 +0000
297+++ src/Canonical.Ubuntu.SSO/IKeyring.cs 2010-09-09 09:58:06 +0000
298@@ -0,0 +1,59 @@
299+/*
300+ * Copyright 2010 Canonical Ltd.
301+ *
302+ * This file is part of Ubuntu One on Windows.
303+ *
304+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
305+ * it under the terms of the GNU Lesser General Public License version
306+ * as published by the Free Software Foundation.
307+ *
308+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
309+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
310+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311+ * GNU Lesser General Public License for more details.
312+ *
313+ * You should have received a copy of the GNU Lesser General Public License
314+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
315+ *
316+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
317+ */
318+using System.Collections.Generic;
319+
320+namespace Canonical.Ubuntu.SSO
321+{
322+ /// <summary>
323+ /// Interface to be implemented by a class that allows to store data in the registry of the
324+ /// current user and makes the class behave like a keyring.
325+ /// </summary>
326+ public interface IKeyring
327+ {
328+ /// <summary>
329+ /// Creates a new secret in the the keyring with the given name for a given applciation.
330+ /// </summary>
331+ /// <param name="keyringName">The name of the keyring where the secret will be stored.</param>
332+ /// <param name="applicationName">The name of the application whose secret will be stored.</param>
333+ /// <param name="secret">The secret to store in the keyring.</param>
334+ void CreateSecret(string keyringName, string applicationName, string secret);
335+
336+ /// <summary>
337+ ///
338+ /// </summary>
339+ /// <param name="keyringName"></param>
340+ /// <param name="applicationName"></param>
341+ /// <returns></returns>
342+ string GetSecretByName(string keyringName, string applicationName);
343+
344+ /// <summary>
345+ /// Gets a lists with all the names of the available ekyrings.
346+ /// </summary>
347+ /// <returns>An enumerable with all the names of the different keyrings.</returns>
348+ IEnumerable<string> GetKeyrings();
349+
350+ /// <summary>
351+ /// Gets a list with all the applications in a keyring.
352+ /// </summary>
353+ /// <param name="keyring">The name of the keyring that is queried.</param>
354+ /// <returns>An enumerable with all the applications in the keyring.</returns>
355+ IEnumerable<string> GetApplications(string keyring);
356+ }
357+}
358
359=== added file 'src/Canonical.Ubuntu.SSO/ILoginOrRegisterView.cs'
360--- src/Canonical.Ubuntu.SSO/ILoginOrRegisterView.cs 1970-01-01 00:00:00 +0000
361+++ src/Canonical.Ubuntu.SSO/ILoginOrRegisterView.cs 2010-09-09 09:58:06 +0000
362@@ -0,0 +1,29 @@
363+/*
364+ * Copyright 2010 Canonical Ltd.
365+ *
366+ * This file is part of Ubuntu One on Windows.
367+ *
368+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
369+ * it under the terms of the GNU Lesser General Public License version
370+ * as published by the Free Software Foundation.
371+ *
372+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
373+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
374+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
375+ * GNU Lesser General Public License for more details.
376+ *
377+ * You should have received a copy of the GNU Lesser General Public License
378+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
379+ *
380+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
381+ */
382+namespace Canonical.Ubuntu.SSO
383+{
384+ /// <summary>
385+ /// Interface that allows the user to login or register to an application using ubuntu sso.
386+ /// </summary>
387+ public interface ILoginOrRegisterView : ILoginView
388+ {
389+
390+ }
391+}
392
393=== added file 'src/Canonical.Ubuntu.SSO/ILoginView.cs'
394--- src/Canonical.Ubuntu.SSO/ILoginView.cs 1970-01-01 00:00:00 +0000
395+++ src/Canonical.Ubuntu.SSO/ILoginView.cs 2010-09-09 09:58:06 +0000
396@@ -0,0 +1,50 @@
397+/*
398+ * Copyright 2010 Canonical Ltd.
399+ *
400+ * This file is part of Ubuntu One on Windows.
401+ *
402+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
403+ * it under the terms of the GNU Lesser General Public License version
404+ * as published by the Free Software Foundation.
405+ *
406+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
407+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
408+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
409+ * GNU Lesser General Public License for more details.
410+ *
411+ * You should have received a copy of the GNU Lesser General Public License
412+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
413+ *
414+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
415+ */
416+using System;
417+
418+namespace Canonical.Ubuntu.SSO
419+{
420+ /// <summary>
421+ /// Interface to be implemented by a GUI that will interact with the user to perform the login
422+ /// to retrieve the credentials.
423+ /// </summary>
424+ public interface ILoginView
425+ {
426+ #region Events
427+
428+ event EventHandler<LoginCredentialsEventArgs> OnLogin;
429+
430+ #endregion
431+
432+ #region Properties
433+
434+ /// <summary>
435+ /// Gets if the view is visible.
436+ /// </summary>
437+ bool IsShown { get; }
438+
439+ #endregion
440+
441+ /// <summary>
442+ /// Shows the gui to the user.
443+ /// </summary>
444+ void Show();
445+ }
446+}
447
448=== added file 'src/Canonical.Ubuntu.SSO/ISSOCredentialsProvider.cs'
449--- src/Canonical.Ubuntu.SSO/ISSOCredentialsProvider.cs 1970-01-01 00:00:00 +0000
450+++ src/Canonical.Ubuntu.SSO/ISSOCredentialsProvider.cs 2010-09-09 09:58:06 +0000
451@@ -0,0 +1,78 @@
452+/*
453+ * Copyright 2010 Canonical Ltd.
454+ *
455+ * This file is part of Ubuntu One on Windows.
456+ *
457+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
458+ * it under the terms of the GNU Lesser General Public License version
459+ * as published by the Free Software Foundation.
460+ *
461+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
462+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
463+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
464+ * GNU Lesser General Public License for more details.
465+ *
466+ * You should have received a copy of the GNU Lesser General Public License
467+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
468+ *
469+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
470+ */
471+using System;
472+
473+namespace Canonical.Ubuntu.SSO
474+{
475+ /// <summary>
476+ /// Provides the interface to be implemented by a class that will provided a way
477+ /// to retrieve the credentials of the user using the Ubuntu SSO webservice.
478+ /// </summary>
479+ public interface ISSOCredentialsProvider
480+ {
481+ #region Events
482+
483+ /// <summary>
484+ /// Event raised when the credentials for an application were found.
485+ /// </summary>
486+ event EventHandler<CredentialsFoundEventArgs> OnCredentialsFound;
487+
488+ /// <summary>
489+ /// Event raised when the credetials from an application were denied.
490+ /// </summary>
491+ event EventHandler<CredentialsDeniedEventArgs> OnCredetialsDenied;
492+
493+ /// <summary>
494+ /// Event raised when there was an error when retireving the credentials.
495+ /// </summary>
496+ event EventHandler<CredentialsErrorEventArgs> OnCredentialsError;
497+
498+ #endregion
499+
500+ #region Methods
501+
502+ /// <summary>
503+ /// This method will try to fetch the encrypted credentials from the registry and
504+ /// return them, and if the credentials are not found it will open a
505+ /// dialog letting the user just log into an existing account via the
506+ /// Ubuntu SSO webservice, and will then get the related credentials,
507+ /// store them into the keyring for future usage and finally return them.
508+ ///
509+ /// The result of this action will be notified through the use of the event handlers
510+ /// due to the fact that the call to the sso webservice is async.
511+ /// </summary>
512+ void LoginToGetCredentials();
513+
514+ /// <summary>
515+ /// This method will try to fetch the credentials from the registry and return them,
516+ /// and if the credentials are not found it will open a dialog letting the user
517+ /// either register a new or log into an existing account via the Ubuntu SSO webservice,
518+ /// and will then get the related credentials, store them into the registry for future
519+ /// usage and finally return them.
520+ ///
521+ /// The result of this action will be notified through the use of the event handlers
522+ /// due to the fact that the call to the sso webservice is async.
523+ /// </summary>
524+ void LoginOrRegisterToGetCredentials();
525+
526+ #endregion
527+
528+ }
529+}
530
531=== added file 'src/Canonical.Ubuntu.SSO/LoginCredentialsEventArgs.cs'
532--- src/Canonical.Ubuntu.SSO/LoginCredentialsEventArgs.cs 1970-01-01 00:00:00 +0000
533+++ src/Canonical.Ubuntu.SSO/LoginCredentialsEventArgs.cs 2010-09-09 09:58:06 +0000
534@@ -0,0 +1,58 @@
535+/*
536+ * Copyright 2010 Canonical Ltd.
537+ *
538+ * This file is part of Ubuntu One on Windows.
539+ *
540+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
541+ * it under the terms of the GNU Lesser General Public License version
542+ * as published by the Free Software Foundation.
543+ *
544+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
545+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
546+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
547+ * GNU Lesser General Public License for more details.
548+ *
549+ * You should have received a copy of the GNU Lesser General Public License
550+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
551+ *
552+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
553+ */
554+using System;
555+
556+namespace Canonical.Ubuntu.SSO
557+{
558+ /// <summary>
559+ /// Event args that will return the username and password provided by the user in the UI.
560+ /// </summary>
561+ public class LoginCredentialsEventArgs : EventArgs
562+ {
563+ /// <summary>
564+ ///
565+ /// </summary>
566+ public string Username { get; set; }
567+
568+ /// <summary>
569+ ///
570+ /// </summary>
571+ public string Password { get; set; }
572+
573+ /// <summary>
574+ /// Creates a new instance of the class with its data init to the basic values.
575+ /// </summary>
576+ public LoginCredentialsEventArgs()
577+ : this ("",""){
578+
579+ }
580+
581+ /// <summary>
582+ /// Creates a new instance with the given data.
583+ /// </summary>
584+ /// <param name="username">The username give to the UI.</param>
585+ /// <param name="password">The password given to the UI</param>
586+ public LoginCredentialsEventArgs(string username, string password)
587+ {
588+ Username = username;
589+ Password = password;
590+ }
591+ }
592+}
593
594=== added directory 'src/Canonical.Ubuntu.SSO/Properties'
595=== added file 'src/Canonical.Ubuntu.SSO/Properties/AssemblyInfo.cs'
596--- src/Canonical.Ubuntu.SSO/Properties/AssemblyInfo.cs 1970-01-01 00:00:00 +0000
597+++ src/Canonical.Ubuntu.SSO/Properties/AssemblyInfo.cs 2010-09-09 09:58:06 +0000
598@@ -0,0 +1,36 @@
599+using System.Reflection;
600+using System.Runtime.CompilerServices;
601+using System.Runtime.InteropServices;
602+
603+// General Information about an assembly is controlled through the following
604+// set of attributes. Change these attribute values to modify the information
605+// associated with an assembly.
606+[assembly: AssemblyTitle("Canonical.Ubuntu.SSO")]
607+[assembly: AssemblyDescription("")]
608+[assembly: AssemblyConfiguration("")]
609+[assembly: AssemblyCompany("")]
610+[assembly: AssemblyProduct("Canonical.Ubuntu.SSO")]
611+[assembly: AssemblyCopyright("Copyright © 2010")]
612+[assembly: AssemblyTrademark("")]
613+[assembly: AssemblyCulture("")]
614+
615+// Setting ComVisible to false makes the types in this assembly not visible
616+// to COM components. If you need to access a type in this assembly from
617+// COM, set the ComVisible attribute to true on that type.
618+[assembly: ComVisible(false)]
619+
620+// The following GUID is for the ID of the typelib if this project is exposed to COM
621+[assembly: Guid("81025507-607b-4b41-95e3-5cf3c68101bc")]
622+
623+// Version information for an assembly consists of the following four values:
624+//
625+// Major Version
626+// Minor Version
627+// Build Number
628+// Revision
629+//
630+// You can specify all the values or you can default the Build and Revision Numbers
631+// by using the '*' as shown below:
632+// [assembly: AssemblyVersion("1.0.*")]
633+[assembly: AssemblyVersion("1.0.0.0")]
634+[assembly: AssemblyFileVersion("1.0.0.0")]
635
636=== added file 'src/Canonical.Ubuntu.SSO/SSOCredentialsProvider.cs'
637--- src/Canonical.Ubuntu.SSO/SSOCredentialsProvider.cs 1970-01-01 00:00:00 +0000
638+++ src/Canonical.Ubuntu.SSO/SSOCredentialsProvider.cs 2010-09-09 09:58:06 +0000
639@@ -0,0 +1,68 @@
640+/*
641+ * Copyright 2010 Canonical Ltd.
642+ *
643+ * This file is part of Ubuntu One on Windows.
644+ *
645+ * Ubuntu One on Windows is free software: you can redistribute it and/or modify
646+ * it under the terms of the GNU Lesser General Public License version
647+ * as published by the Free Software Foundation.
648+ *
649+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
650+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
651+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
652+ * GNU Lesser General Public License for more details.
653+ *
654+ * You should have received a copy of the GNU Lesser General Public License
655+ * along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
656+ *
657+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
658+ */
659+using System;
660+
661+namespace Canonical.Ubuntu.SSO
662+{
663+ /// <summary>
664+ /// Implementation of the SSOCredentials provider that uses the DAPI framework to encrypt the
665+ /// data and store it in the registry.
666+ /// </summary>
667+ public class SSOCredentialsProvider : ISSOCredentialsProvider
668+ {
669+ #region Implementation of ISSOCredentialsProvider
670+
671+ public event EventHandler<CredentialsFoundEventArgs> OnCredentialsFound;
672+ public event EventHandler<CredentialsDeniedEventArgs> OnCredetialsDenied;
673+ public event EventHandler<CredentialsErrorEventArgs> OnCredentialsError;
674+
675+ /// <summary>
676+ /// This method will try to fetch the encrypted credentials from the registry and
677+ /// return them, and if the credentials are not found it will open a
678+ /// dialog letting the user just log into an existing account via the
679+ /// Ubuntu SSO webservice, and will then get the related credentials,
680+ /// store them into the keyring for future usage and finally return them.
681+ ///
682+ /// The result of this action will be notified through the use of the event handlers
683+ /// due to the fact that the call to the sso webservice is async.
684+ /// </summary>
685+ public void LoginToGetCredentials()
686+ {
687+ throw new NotImplementedException();
688+ }
689+
690+ /// <summary>
691+ /// This method will try to fetch the credentials from the registry and return them,
692+ /// and if the credentials are not found it will open a dialog letting the user
693+ /// either register a new or log into an existing account via the Ubuntu SSO webservice,
694+ /// and will then get the related credentials, store them into the registry for future
695+ /// usage and finally return them.
696+ ///
697+ /// The result of this action will be notified through the use of the event handlers
698+ /// due to the fact that the call to the sso webservice is async.
699+ /// </summary>
700+ public void LoginOrRegisterToGetCredentials()
701+ {
702+ throw new NotImplementedException();
703+ }
704+
705+ #endregion
706+ }
707+}
708
709=== modified file 'src/UbuntuOne.sln'
710--- src/UbuntuOne.sln 2010-08-24 18:25:47 +0000
711+++ src/UbuntuOne.sln 2010-09-09 09:58:06 +0000
712@@ -23,6 +23,8 @@
713 EndProject
714 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Canonical.UbuntuOne.SyncDaemon", "Canonical.UbuntuOne.SyncDaemon\Canonical.UbuntuOne.SyncDaemon.csproj", "{38042450-48E0-472F-A7D8-577A7B763279}"
715 EndProject
716+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Canonical.Ubuntu.SSO", "Canonical.Ubuntu.SSO\Canonical.Ubuntu.SSO.csproj", "{9460A771-2589-45DA-9618-9FE8BB7D16E8}"
717+EndProject
718 Global
719 GlobalSection(SolutionConfigurationPlatforms) = preSolution
720 Debug|Any CPU = Debug|Any CPU
721@@ -143,6 +145,16 @@
722 {38042450-48E0-472F-A7D8-577A7B763279}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
723 {38042450-48E0-472F-A7D8-577A7B763279}.Release|Mixed Platforms.Build.0 = Release|Any CPU
724 {38042450-48E0-472F-A7D8-577A7B763279}.Release|x86.ActiveCfg = Release|Any CPU
725+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
726+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
727+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
728+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
729+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Debug|x86.ActiveCfg = Debug|Any CPU
730+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
731+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Release|Any CPU.Build.0 = Release|Any CPU
732+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
733+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
734+ {9460A771-2589-45DA-9618-9FE8BB7D16E8}.Release|x86.ActiveCfg = Release|Any CPU
735 EndGlobalSection
736 GlobalSection(SolutionProperties) = preSolution
737 HideSolutionNode = FALSE
738
739=== modified file 'src/UbuntuOneClient/Program.cs'
740--- src/UbuntuOneClient/Program.cs 2010-08-02 14:31:39 +0000
741+++ src/UbuntuOneClient/Program.cs 2010-09-09 09:58:06 +0000
742@@ -1,7 +1,7 @@
743-/**
744+/*
745 * Copyright 2010 Canonical Ltd.
746 *
747- * This file is part of UbuntuOne on Windows.
748+ * This file is part of Ubuntu One on Windows.
749 *
750 * UbuntuOne on Windows is free software: you can redistribute it and/or modify
751 * it under the terms of the GNU Lesser General Public License version

Subscribers

People subscribed via source and target branches

to all changes: