Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial addition of Nullable property to Abstractions Project. #2139

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(SrcTargets)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">$(SrcStandardTargets)</TargetFrameworks>
<NetStandardImplicitPackageVersion>$(NetStandardVersion)</NetStandardImplicitPackageVersion>
<LangVersion>7.3</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
Expand Down
12 changes: 6 additions & 6 deletions src/Microsoft.IdentityModel.Abstractions/ITelemetryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ void TrackEvent(
/// <param name="guidProperties">Key value pair of Guids to long with the event.</param>
void TrackEvent(
string eventName,
IDictionary<string, string> stringProperties = null,
IDictionary<string, long> longProperties = null,
IDictionary<string, bool> boolProperties = null,
IDictionary<string, DateTime> dateTimeProperties = null,
IDictionary<string, double> doubleProperties = null,
IDictionary<string, Guid> guidProperties = null);
IDictionary<string, string>? stringProperties = null,
IDictionary<string, long>? longProperties = null,
IDictionary<string, bool>? boolProperties = null,
IDictionary<string, DateTime>? dateTimeProperties = null,
IDictionary<string, double>? doubleProperties = null,
IDictionary<string, Guid>? guidProperties = null);
}
}
4 changes: 2 additions & 2 deletions src/Microsoft.IdentityModel.Abstractions/LogEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public class LogEntry
/// <summary>
/// Message to be logged.
/// </summary>
public string Message { get; set; }
public string? Message { get; set; }

/// <summary>
/// A unique identifier for a request that can help with diagnostics across components.
/// </summary>
/// <remarks>
/// Also referred to as ActivityId in Microsoft.IdentityModel.Tokens.CallContext.
/// </remarks>
public string CorrelationId { get; set; }
public string? CorrelationId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageId>Microsoft.IdentityModel.Abstractions</PackageId>
<PackageTags>.NET;Windows;Authentication;Identity;Abstractions</PackageTags>
<IsTrimmable>true</IsTrimmable>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public class NullTelemetryClient : ITelemetryClient
/// <remarks>
/// Private constructor to prevent the default constructor being exposed.
/// </remarks>
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
jmprieur marked this conversation as resolved.
Show resolved Hide resolved
private NullTelemetryClient() { }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

/// <inheritdoc />
public bool IsEnabled() => false;
Expand All @@ -48,12 +50,12 @@ public void TrackEvent(TelemetryEventDetails eventDetails)
/// <inheritdoc/>
public void TrackEvent(
string eventName,
IDictionary<string, string> stringProperties = null,
IDictionary<string, long> longProperties = null,
IDictionary<string, bool> boolProperties = null,
IDictionary<string, DateTime> dateTimeProperties = null,
IDictionary<string, double> doubleProperties = null,
IDictionary<string, Guid> guidProperties = null)
IDictionary<string, string>? stringProperties = null,
IDictionary<string, long>? longProperties = null,
IDictionary<string, bool>? boolProperties = null,
IDictionary<string, DateTime>? dateTimeProperties = null,
IDictionary<string, double>? doubleProperties = null,
IDictionary<string, Guid>? guidProperties = null)
{
// no-op
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class TelemetryEventDetails
/// <summary>
/// Name of the telemetry event, should be unique between events.
/// </summary>
public virtual string Name { get; set; }
public virtual string? Name { get; set; }

/// <summary>
/// Properties which describe the event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
[assembly: SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "Vendored component", Scope = "module")]
[assembly: SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "Breaking change", Scope = "type", Target = "~T:Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestHandler")]
[assembly: SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Previously released as read / write", Scope = "member", Target = "~P:Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvalidNonceClaimException.PropertyBag")]
[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "Breaking Change", Scope = "member", Target = "~T:Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestHandler)")]
FuPingFranco marked this conversation as resolved.
Show resolved Hide resolved