-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Directory.Build.props as single source of truth for package metadata * Switch to first party BouncyCastle package * Improve HttpClientExtensions for fetching access token
- Loading branch information
1 parent
8492935
commit 84504d4
Showing
19 changed files
with
572 additions
and
509 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
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,37 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageProjectUrl>https://www.eryph.io</PackageProjectUrl> | ||
<PackageReleaseNotes>https://github.com/eryph-org/dotnet-identitymodel/releases</PackageReleaseNotes> | ||
<Authors>dbosoft GmbH and Eryph contributors</Authors> | ||
<Company>dbosoft GmbH</Company> | ||
<Product>Eryph</Product> | ||
<Copyright>dbosoft GmbH. All rights reserved.</Copyright> | ||
<RepositoryUrl>https://github.com/eryph-org/dotnet-identitymodel</RepositoryUrl> | ||
<!-- Declare that the Repository URL can be published to NuSpec --> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<!-- Embed source files that are not tracked by the source control manager to the PDB --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Include PDB in the built .nupkg --> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<LangVersion>12</LangVersion> | ||
<NoWarn>CS1591</NoWarn> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<ContinuousIntegrationBuild Condition="'$(TF_BUILD)' == 'true'">True</ContinuousIntegrationBuild> | ||
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/> | ||
</ItemGroup> | ||
</Project> |
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
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 |
---|---|---|
@@ -1,33 +1,11 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.Serialization; | ||
using JetBrains.Annotations; | ||
|
||
namespace Eryph.IdentityModel.Clients | ||
{ | ||
[PublicAPI] | ||
public sealed class ClientData | ||
{ | ||
|
||
public ClientData(string id, string name) | ||
{ | ||
Id = id; | ||
Name = name; | ||
} | ||
|
||
/// <summary> | ||
/// constructor for deserialization | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
internal ClientData() | ||
{} | ||
using JetBrains.Annotations; | ||
|
||
namespace Eryph.IdentityModel.Clients; | ||
|
||
[DataMember] | ||
public string Id { get; } | ||
|
||
|
||
[DataMember] | ||
public string Name { get; } | ||
[PublicAPI] | ||
public sealed class ClientData(string id, string name) | ||
{ | ||
public string Id { get; } = id; | ||
|
||
} | ||
} | ||
public string Name { get; } = name; | ||
} |
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
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
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,19 @@ | ||
using System; | ||
|
||
namespace Eryph.IdentityModel.Clients; | ||
|
||
/// <summary> | ||
/// This exception is thrown when an access token cannot be retrieved. | ||
/// </summary> | ||
public class AccessTokenException : Exception | ||
{ | ||
public AccessTokenException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public AccessTokenException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
} |
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Eryph.IdentityModel.Clients | ||
namespace Eryph.IdentityModel.Clients; | ||
|
||
/// <summary> | ||
/// Contains the requested access token and some metadata about it. | ||
/// </summary> | ||
public sealed class AccessTokenResponse | ||
{ | ||
public sealed class AccessTokenResponse | ||
{ | ||
/// <summary>Gets the Access Token requested.</summary> | ||
[DataMember] | ||
public string AccessToken { get; internal set; } | ||
/// <summary> | ||
/// The requested access token. | ||
/// </summary> | ||
public string AccessToken { get; internal set; } | ||
|
||
/// <summary> | ||
/// Gets the point in time in which the Access Token returned in the AccessToken property ceases to be valid. | ||
/// This value is calculated based on current UTC time measured locally and the value expiresIn received from the | ||
/// service. | ||
/// </summary> | ||
[DataMember] | ||
public DateTimeOffset? ExpiresOn { get; internal set; } | ||
/// <summary> | ||
/// Gets the point in time when the access token ceases to be valid. | ||
/// This value is calculated based on current UTC time measured locally and the | ||
/// value <c>expiresIn</c> received from the service. | ||
/// </summary> | ||
public DateTimeOffset? ExpiresOn { get; internal set; } | ||
|
||
/// <summary> | ||
/// The scopes for this access token | ||
/// </summary> | ||
[DataMember] | ||
public IEnumerable<string> Scopes { get; internal set; } | ||
} | ||
} | ||
/// <summary> | ||
/// The scopes which have been granted to this access token. | ||
/// </summary> | ||
public IReadOnlyList<string> Scopes { get; internal set; } | ||
} |
Oops, something went wrong.