-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af00695
commit 359f104
Showing
72 changed files
with
5,674 additions
and
916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
src/CommunityToolkit.Datasync.Client/Extensions/EnsureThatExtensions.cs
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
src/CommunityToolkit.Datasync.Client/GlobalSuppressions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Style", "IDE0058:Expression value is never used", | ||
Justification = "This is used in reflection and parameter checking.", | ||
Scope = "namespaceanddescendants", Target = "~N:CommunityToolkit.Datasync.Client")] |
34 changes: 34 additions & 0 deletions
34
src/CommunityToolkit.Datasync.Client/Http/AuthenticationProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace CommunityToolkit.Datasync.Client.Http; | ||
|
||
/// <summary> | ||
/// Definition of an authentication provider, which is a specific type of | ||
/// delegating handler that handles authentication updates. | ||
/// </summary> | ||
public abstract class AuthenticationProvider : DelegatingHandler | ||
{ | ||
/// <summary> | ||
/// The display name for the currently logged in user. This may be null. | ||
/// </summary> | ||
public string DisplayName { get; protected set; } | ||
|
||
/// <summary> | ||
/// If true, the user is logged in (and the UserId is available) | ||
/// </summary> | ||
public bool IsLoggedIn { get; protected set; } | ||
|
||
/// <summary> | ||
/// The user ID for this user. | ||
/// </summary> | ||
public string UserId { get; protected set; } | ||
|
||
/// <summary> | ||
/// Initiate a login request out of band of the pipeline. This can be used | ||
/// to initiate the login process via a button. | ||
/// </summary> | ||
/// <returns>An async task that resolves when the login is complete</returns> | ||
public abstract Task LoginAsync(); | ||
} |
43 changes: 43 additions & 0 deletions
43
src/CommunityToolkit.Datasync.Client/Http/AuthenticationToken.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace CommunityToolkit.Datasync.Client.Http; | ||
|
||
/// <summary> | ||
/// Definition of an authentication token response. | ||
/// </summary> | ||
public struct AuthenticationToken | ||
{ | ||
/// <summary> | ||
/// The display name for this user. | ||
/// </summary> | ||
public string DisplayName { get; set; } | ||
|
||
/// <summary> | ||
/// The expiry date of the JWT Token | ||
/// </summary> | ||
public DateTimeOffset ExpiresOn { get; set; } | ||
/// <summary> | ||
/// The actual JWT Token | ||
/// </summary> | ||
public string Token { get; set; } | ||
|
||
/// <summary> | ||
/// The User Id for this user | ||
/// </summary> | ||
public string UserId { get; set; } | ||
|
||
/// <summary> | ||
/// Return a visual representation of the authentication token for logging purposes. | ||
/// </summary> | ||
/// <returns>The string representation of the authentication token</returns> | ||
public override readonly string ToString() | ||
{ | ||
string displayName = DisplayName is null ? "null" : $"\"{DisplayName}\""; | ||
string expiresOn = ExpiresOn.ToString("O", System.Globalization.CultureInfo.InvariantCulture); | ||
string token = Token is null ? "null" : $"\"{Token}\""; | ||
string userId = UserId is null ? "null" : $"\"{UserId}\""; | ||
return $"AuthenticationToken(DisplayName={displayName},ExpiresOn=\"{expiresOn}\",Token={token},UserId={userId})"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/CommunityToolkit.Datasync.Client/Http/DatasyncHttpClientOptions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.